![]() |
OpenMS
|
Static helpers that convert between the three OpenMS container types (PeakMap, FeatureMap, ConsensusMap).
More...
#include <OpenMS/KERNEL/ConversionHelper.h>
Static Public Member Functions | |
| static void | convert (UInt64 const input_map_index, PeakMap &input_map, ConsensusMap &output_map, Size n=-1) |
Copy the most intense peaks of a PeakMap into a ConsensusMap. | |
| 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 the three OpenMS container types (PeakMap, FeatureMap, ConsensusMap).
Each overload replaces the contents of the destination, gives it a container-level unique id, and leaves it in a state where the standard range queries reflect the new contents without further bookkeeping by the caller.
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); it exists for symmetry with the PeakMap overload above.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. |
|
static |
Copy the most intense peaks of a PeakMap into a ConsensusMap.
The output's previous contents are dropped and it is given a fresh container unique id (PeakMap has no container-level unique id, so one is generated). The n peaks with the highest intensity are written to the output as ConsensusFeature entries tagged with input_map_index; their order in the output is by descending intensity. The column header size for input_map_index reflects the number of peaks written.
| [in] | input_map_index | Index assigned to the input map in the resulting ConsensusMap column headers. |
| [in,out] | input_map | Source peaks; its range queries are left consistent with its contents as a side effect. |
| [out] | output_map | Resulting ConsensusMap; previous contents are replaced. |
| [in] | n | Maximum number of peaks to copy. The default (Size(-1)) keeps all peaks. |