OpenMS  2.7.0
Public Member Functions | List of all members
MetaInfoInterfaceUtils Class Reference

Utilities operating on containers inheriting from MetaInfoInterface. More...

#include <OpenMS/METADATA/MetaInfoInterfaceUtils.h>

Public Member Functions

 MetaInfoInterfaceUtils ()=delete
 hide c'tors to avoid instantiation of utils class More...
 
 MetaInfoInterfaceUtils (const MetaInfoInterfaceUtils &)=delete
 
MetaInfoInterfaceUtilsoperator= (MetaInfoInterfaceUtils &)=delete
 

Static Public Member Functions

Methods to find key sets
template<typename T_In , typename T_Out >
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 >())
 Find keys in a collection of MetaInfoInterface objects which reach a certain frequency threshold. More...
 

Detailed Description

Utilities operating on containers inheriting from MetaInfoInterface.

Constructor & Destructor Documentation

◆ MetaInfoInterfaceUtils() [1/2]

hide c'tors to avoid instantiation of utils class

◆ MetaInfoInterfaceUtils() [2/2]

Member Function Documentation

◆ 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_InInput container (e.g. std::vector or alike), containing objects which implement the MetaInfoInterface (i.e. support 'getKeys()')
T_OutOutput container of type T<String> (e.g. std::set<String>)
Parameters
startIterator pointing to the initial position to search. (note: this does not need to correspond to the beginning of the container)
endIterator pointing to the end final position to search.
min_frequencyMinimum required frequency (in percent). Must be between 0-100. Other values are corrected to the closest value allowed.
Returns
Returns a vector/list/set of keys passing the frequency criterion.

◆ operator=()