Utilities operating on containers inheriting from MetaInfoInterface.
More...
#include <OpenMS/METADATA/MetaInfoInterfaceUtils.h>
Utilities operating on containers inheriting from MetaInfoInterface.
◆ MetaInfoInterfaceUtils() [1/2]
hide c'tors to avoid instantiation of utils class
◆ MetaInfoInterfaceUtils() [2/2]
◆ findCommonMetaKeys()
static T_Out findCommonMetaKeys |
( |
const typename T_In::const_iterator & |
it_start, |
|
|
const typename T_In::const_iterator & |
it_end, |
|
|
float |
min_frequency, |
|
|
typename Detail::MetaKeyGetter< typename T_In::value_type > |
getter = Detail::MetaKeyGetter<typename T_In::value_type>() |
|
) |
| |
|
inlinestatic |
Find keys in a collection of MetaInfoInterface objects which reach a certain frequency threshold.
Searches the given iterator range for the keys of each element's MetaInfoInterface keys and returns those keys, which reach a certain frequency threshold. Common use cases are min_frequency
= 0 (i.e. take any key which occurs) and min_frequency
= 100 (i.e. take only keys which are common to all elements in the iterator range).
- Template Parameters
-
T_In | Input container (e.g. std::vector or alike), containing objects which implement the MetaInfoInterface (i.e. support 'getKeys()') |
T_Out | Output container of type T<String> (e.g. std::set<String>) |
- Parameters
-
it_start | Iterator pointing to the initial position to search. (note: this does not need to correspond to the beginning of the container) |
it_end | Iterator pointing to the end final position to search. |
min_frequency | Minimum required frequency (in percent). Must be between 0-100. Other values are corrected to the closest value allowed. |
getter | Helper class, which has a getKeys() member, which can extract the keys for a given MetaInfoInterface-object; see MetaKeyGetter |
- Returns
- Returns a vector/list/set of keys passing the frequency criterion.
◆ operator=()