本文整理汇总了C++中ConsensusMap::sortByMaps方法的典型用法代码示例。如果您正苦于以下问题:C++ ConsensusMap::sortByMaps方法的具体用法?C++ ConsensusMap::sortByMaps怎么用?C++ ConsensusMap::sortByMaps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConsensusMap
的用法示例。
在下文中一共展示了ConsensusMap::sortByMaps方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: group_
void FeatureGroupingAlgorithmQT::group_(const vector<MapType>& maps,
ConsensusMap& out)
{
// check that the number of maps is ok:
if (maps.size() < 2)
{
throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
"At least two maps must be given!");
}
QTClusterFinder cluster_finder;
cluster_finder.setParameters(param_.copy("", true));
cluster_finder.run(maps, out);
StringList ms_run_locations;
// add protein IDs and unassigned peptide IDs to the result map here,
// to keep the same order as the input maps (useful for output later):
for (typename vector<MapType>::const_iterator map_it = maps.begin();
map_it != maps.end(); ++map_it)
{
// add protein identifications to result map:
out.getProteinIdentifications().insert(
out.getProteinIdentifications().end(),
map_it->getProteinIdentifications().begin(),
map_it->getProteinIdentifications().end());
// add unassigned peptide identifications to result map:
out.getUnassignedPeptideIdentifications().insert(
out.getUnassignedPeptideIdentifications().end(),
map_it->getUnassignedPeptideIdentifications().begin(),
map_it->getUnassignedPeptideIdentifications().end());
}
// canonical ordering for checking the results:
out.sortByQuality();
out.sortByMaps();
out.sortBySize();
return;
}
示例2: group
void FeatureGroupingAlgorithmUnlabeled::group(const std::vector<FeatureMap> & maps, ConsensusMap & out)
{
// check that the number of maps is ok
if (maps.size() < 2)
{
throw Exception::IllegalArgument(__FILE__, __LINE__, __PRETTY_FUNCTION__, "At least two maps must be given!");
}
// define reference map (the one with most peaks)
Size reference_map_index = 0;
Size max_count = 0;
for (Size m = 0; m < maps.size(); ++m)
{
if (maps[m].size() > max_count)
{
max_count = maps[m].size();
reference_map_index = m;
}
}
std::vector<ConsensusMap> input(2);
// build a consensus map of the elements of the reference map (contains only singleton consensus elements)
MapConversion::convert(reference_map_index, maps[reference_map_index],
input[0]);
// loop over all other maps, extend the groups
StablePairFinder pair_finder;
pair_finder.setParameters(param_.copy("", true));
for (Size i = 0; i < maps.size(); ++i)
{
if (i != reference_map_index)
{
MapConversion::convert(i, maps[i], input[1]);
// compute the consensus of the reference map and map i
ConsensusMap result;
pair_finder.run(input, result);
input[0].swap(result);
}
}
// replace result with temporary map
out.swap(input[0]);
// copy back the input maps (they have been deleted while swapping)
out.getFileDescriptions() = input[0].getFileDescriptions();
// add protein IDs and unassigned peptide IDs to the result map here,
// to keep the same order as the input maps (useful for output later)
for (std::vector<FeatureMap>::const_iterator map_it = maps.begin();
map_it != maps.end(); ++map_it)
{
// add protein identifications to result map
out.getProteinIdentifications().insert(
out.getProteinIdentifications().end(),
map_it->getProteinIdentifications().begin(),
map_it->getProteinIdentifications().end());
// add unassigned peptide identifications to result map
out.getUnassignedPeptideIdentifications().insert(
out.getUnassignedPeptideIdentifications().end(),
map_it->getUnassignedPeptideIdentifications().begin(),
map_it->getUnassignedPeptideIdentifications().end());
}
// canonical ordering for checking the results, and the ids have no real meaning anyway
#if 1 // the way this was done in DelaunayPairFinder and StablePairFinder
out.sortByMZ();
#else
out.sortByQuality();
out.sortByMaps();
out.sortBySize();
#endif
return;
}