![]() |
OpenMS
|
A feature grouping algorithm using Wasserstein optimal transport. More...
#include <OpenMS/ANALYSIS/MAPMATCHING/FeatureGroupingAlgorithmWNet.h>
Public Member Functions | |
| FeatureGroupingAlgorithmWNet () | |
| Default constructor. | |
| ~FeatureGroupingAlgorithmWNet () override | |
| Destructor. | |
| void | group (const std::vector< FeatureMap > &maps, ConsensusMap &out) override |
| Applies the algorithm to feature maps. | |
| void | group (const std::vector< ConsensusMap > &maps, ConsensusMap &out) override |
| Applies the algorithm to consensus maps. | |
Public Member Functions inherited from FeatureGroupingAlgorithm | |
| FeatureGroupingAlgorithm () | |
| Default constructor. | |
| ~FeatureGroupingAlgorithm () override | |
| Destructor. | |
| void | transferSubelements (const std::vector< ConsensusMap > &maps, ConsensusMap &out) const |
| Transfers subelements (grouped features) from input consensus maps to the result consensus map. | |
Public Member Functions inherited from DefaultParamHandler | |
| DefaultParamHandler (const std::string &name) | |
| Constructor with name that is displayed in error messages. | |
| DefaultParamHandler (const DefaultParamHandler &rhs) | |
| Copy constructor. | |
| virtual | ~DefaultParamHandler () |
| Destructor. | |
| DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
| Assignment operator. | |
| virtual bool | operator== (const DefaultParamHandler &rhs) const |
| Equality operator. | |
| void | setParameters (const Param ¶m) |
| Sets the parameters. | |
| const Param & | getParameters () const |
| Non-mutable access to the parameters. | |
| const Param & | getDefaults () const |
| Non-mutable access to the default parameters. | |
| const std::string & | getName () const |
| Non-mutable access to the name. | |
| void | setName (const std::string &name) |
| Mutable access to the name. | |
| const std::vector< std::string > & | getSubsections () const |
| Non-mutable access to the registered subsections. | |
Private Member Functions | |
| FeatureGroupingAlgorithmWNet (const FeatureGroupingAlgorithmWNet &)=delete | |
| FeatureGroupingAlgorithmWNet & | operator= (const FeatureGroupingAlgorithmWNet &)=delete |
| FeatureGroupingAlgorithmWNet (FeatureGroupingAlgorithmWNet &&)=delete | |
| FeatureGroupingAlgorithmWNet & | operator= (FeatureGroupingAlgorithmWNet &&)=delete |
| template<typename MapType > | |
| void | group_ (const std::vector< MapType > &maps, ConsensusMap &out) |
Additional Inherited Members | |
Static Public Member Functions inherited from DefaultParamHandler | |
| static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const std::string &key_prefix="") |
| Writes all parameters to meta values. | |
Protected Member Functions inherited from FeatureGroupingAlgorithm | |
| template<class MapType > | |
| void | postprocess_ (const std::vector< MapType > &maps, ConsensusMap &out) |
Protected Member Functions inherited from DefaultParamHandler | |
| virtual void | updateMembers_ () |
| This method is used to update extra member variables at the end of the setParameters() method. | |
| void | defaultsToParam_ () |
| Updates the parameters after the defaults have been set in the constructor. | |
Protected Attributes inherited from DefaultParamHandler | |
| Param | param_ |
| Container for current parameters. | |
| Param | defaults_ |
| Container for default parameters. This member should be filled in the constructor of derived classes! | |
| std::vector< std::string > | subsections_ |
| Container for registered subsections. This member should be filled in the constructor of derived classes! | |
| std::string | error_name_ |
| Name that is displayed in error messages during the parameter checking. | |
| bool | check_defaults_ |
| If this member is set to false no checking if parameters in done;. | |
| bool | warn_empty_defaults_ |
| If this member is set to false no warning is emitted when defaults are empty;. | |
A feature grouping algorithm using Wasserstein optimal transport.
Groups corresponding features across multiple maps by solving a minimum-cost network flow problem. Each pair of maps is aligned independently using WNetAligner<2> (2D: m/z and RT), and pairwise matchings are merged into consensus groups via union-find.
Features are matched by minimizing the total transport cost between their (m/z, RT) positions, with unmatched features assigned to a "trash" node at a configurable cost. This produces a 1-to-1 consensus matching per pair.
Parameters of this class are:| Name | Type | Default | Restrictions | Description |
|---|---|---|---|---|
| distance_metric | string | LINF | L1, L2, LINF | Distance metric for comparing feature positions |
| max_rt_shift | float | 100.0 | min: 0.0 | Maximum allowed RT difference (in seconds) for matching features. |
| mz_unit | string | ppm | Da, ppm | Unit for the m/z tolerance. 'Da' uses max_mz_shift_da; 'ppm' uses max_mz_shift_ppm and log-transforms the m/z axis. |
| max_mz_shift_da | float | 0.3 | min: 0.0 | Maximum allowed m/z difference in Daltons. Used when mz_unit is 'Da'. |
| max_mz_shift_ppm | float | 10.0 | min: 0.0 | Maximum allowed m/z difference in ppm. Used when mz_unit is 'ppm'. |
| trash_cost | float | 0.0 | min: 0.0 | Cost of leaving a feature unmatched (in seconds). Set to 0 to auto-derive from max_rt_shift (a match at the boundary costs the same as no match). Increase to prefer matching over leaving features unmatched. |
| normalize_intensities | string | true | true, false | Normalize feature intensities per map before alignment so that total intensity is equal across maps. |
| decharge_mz | string | false | true, false | Convert observed m/z values to their singly-charged (z=1) equivalent before alignment. Features with charge z>1 are projected to [M+H]+ m/z, making features of the same compound but different charge states directly comparable. If a feature carries a 'dc_charge_adduct_mass' MetaValue (set by MetaboliteFeatureDeconvolution), the stored adduct mass is used; otherwise pure H+ adducts are assumed. Features with unknown charge (z=0) are left unchanged. |
Default constructor.
|
override |
Destructor.
|
privatedelete |
|
privatedelete |
|
overridevirtual |
Applies the algorithm to consensus maps.
| [in] | maps | Input consensus maps (at least two required). |
| [out] | out | Resulting consensus map with grouped features. |
| IllegalArgument | is thrown if less than two input maps are given. |
Reimplemented from FeatureGroupingAlgorithm.
|
overridevirtual |
Applies the algorithm to feature maps.
| [in] | maps | Input feature maps (at least two required). |
| [out] | out | Resulting consensus map with grouped features. |
| IllegalArgument | is thrown if less than two input maps are given. |
Implements FeatureGroupingAlgorithm.
|
private |
|
privatedelete |
|
privatedelete |