![]() |
OpenMS
|
Static helpers that convert between FeatureMap and ConsensusMap.
More...
#include <OpenMS/KERNEL/ConversionHelper.h>
Static Public Member Functions | |
| static void | convert (ConsensusMap const &input_map, const bool keep_uids, FeatureMap &output_map) |
Convert a ConsensusMap to a FeatureMap. | |
| static void | convert (UInt64 const input_map_index, FeatureMap const &input_map, ConsensusMap &output_map, Size n=-1) |
Convert a FeatureMap to a ConsensusMap. | |
Static helpers that convert between FeatureMap and ConsensusMap.
There is no conversion from a PeakMap: the handle of a consensus feature built from a peak could only refer to the peak's index, not to an element with a unique id. MapAlignmentAlgorithmPoseClustering selects the peaks it aligns itself.
Each overload replaces the contents of the destination and leaves it in a state where the standard range queries reflect the new contents without further bookkeeping by the caller. The container unique id of the destination is copied from the source or freshly drawn, depending on the overload.
The conversions are not symmetric: which fields are preserved (container / element unique ids, protein and unassigned peptide identifications) depends on the source and target container, so see each overload for the exact contract.
|
static |
Convert a ConsensusMap to a FeatureMap.
Every element of input_map is converted to a Feature in output_map (the BaseFeature portion is copied; positional and meta data are preserved). The document identifier and the protein / unassigned peptide identifications are preserved on the output.
| [in] | input_map | Source ConsensusMap. |
| [in] | keep_uids | If true, the container unique id and every element's unique id are preserved from input_map; otherwise they are replaced with fresh ones. |
| [out] | output_map | Resulting FeatureMap; previous contents are replaced. |
|
static |
Convert a FeatureMap to a ConsensusMap.
The first n features of input_map (in input order; no sorting is performed) are written to output_map as ConsensusFeature entries tagged with input_map_index. The output's container unique id is taken from input_map (an intentional design choice – callers that need a fresh id must overwrite it afterwards). The protein and unassigned peptide identifications are preserved on the output.
n is mainly useful after pre-sorting input_map (e.g. by intensity).size for input_map_index is set to input_map.size() – the full input size – even when n truncates the actual copy. Inspect the output container's size for the number of features that were actually written.| [in] | input_map_index | Index assigned to the input map in the resulting ConsensusMap column headers. |
| [in] | input_map | Source FeatureMap. |
| [out] | output_map | Resulting ConsensusMap; previous contents are replaced. |
| [in] | n | Maximum number of features to copy. The default (Size(-1)) keeps all features. |