35 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_FEATUREFINDERALGORITHMSH_H 
   36 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_FEATUREFINDERALGORITHMSH_H 
   41 #include "boost/shared_ptr.hpp" 
  101   template <
class PeakType, 
class FeatureType>
 
  118       this->
defaults_.
setValue(
"centroiding:active", 
"false", 
"MS1 data centroid data");
 
  123       this->
defaults_.
setValue(
"ms1:max_inter_scan_distance", 0, 
"MS1 max inter scan distance");        
 
  126       this->
defaults_.
setValue(
"ms1:tr_resolution", 0.01, 
"MS1 LC retention time resolution");         
 
  129       this->
defaults_.
setValue(
"ms1:intensity_threshold", 1000.0, 
"FT peak detect MS1 intensity min threshold");
 
  132       this->
defaults_.
setValue(
"ms1:max_inter_scan_rt_distance", 0.1, 
"MS1 max inter scan distance");        
 
  135       this->
defaults_.
setValue(
"ms1:min_nb_cluster_members", 4, 
"FT peak detect MS1 min nb peak members");
 
  138       this->
defaults_.
setValue(
"ms1:detectable_isotope_factor", 0.05, 
"Detectable isotope factor");
 
  144       this->
defaults_.
setValue(
"centroiding:window_width", 5, 
"Centroid window width");
 
  147       this->
defaults_.
setValue(
"centroiding:absolute_isotope_mass_precision", 0.01, 
"Absolute isotope mass precision (Da)");
 
  150       this->
defaults_.
setValue(
"centroiding:relative_isotope_mass_precision", 10.0, 
"Relative isotope mass precision");
 
  153       this->
defaults_.
setValue(
"centroiding:minimal_peak_height", 0.0, 
"Minimal peak height");
 
  156       this->
defaults_.
setValue(
"centroiding:min_ms_signal_intensity", 50.0, 
"Minimal Centroid MS Signal Intensity");
 
  159       this->
defaults_.
setValue(
"ms1:retention_time_tolerance", 0.5, 
"MS1 retention time tolerance (minutes)");
 
  165       this->
defaults_.
setValue(
"ms1_feature_merger:active", 
"true", 
"Activation of MS1 feature merging post processing");
 
  168       this->
defaults_.
setValue(
"ms1_feature_merger:tr_resolution", 0.01, 
"MS1 LC retention time resolution");
 
  171       this->
defaults_.
setValue(
"ms1_feature_merger:initial_apex_tr_tolerance", 5.0, 
"Initial Apex Tr tolerance");
 
  174       this->
defaults_.
setValue(
"ms1_feature_merger:feature_merging_tr_tolerance", 1.0, 
"MS1 feature Tr merging tolerance");
 
  177       this->
defaults_.
setValue(
"ms1_feature_merger:intensity_variation_percentage", 25.0, 
"Percentage of intensity variation between LC border peaks");
 
  181       this->
defaults_.
setValue(
"ms1_feature_merger:ppm_tolerance_for_mz_clustering", 10.0, 
"PPM value for the m/z clustering of merging candidates");
 
  185       this->
defaults_.
setValue(
"ms1_feature_selection_options:start_elution_window", 0.0, 
"start elution window (minutes)");
 
  188       this->
defaults_.
setValue(
"ms1_feature_selection_options:end_elution_window", 180.0, 
"end elution window (minutes)");
 
  191       this->
defaults_.
setValue(
"ms1_feature_selection_options:mz_range_min", 0.0, 
"MS1 feature mz range min");
 
  194       this->
defaults_.
setValue(
"ms1_feature_selection_options:mz_range_max", 2000.0, 
"MS1 feature mz range max");
 
  197       this->
defaults_.
setValue(
"ms1_feature_selection_options:chrg_range_min", 1, 
"MS1 feature CHRG range min");
 
  200       this->
defaults_.
setValue(
"ms1_feature_selection_options:chrg_range_max", 5, 
"MS1 feature CHRG range max");
 
  210       while (!isdigit(native_id[start_idx]) && start_idx < native_id.length())
 
  214       if (start_idx == native_id.length())
 
  216         std::cout << 
"Native id could not be determined: " << native_id;
 
  220       Size end_idx = start_idx;
 
  221       while (isdigit(native_id[end_idx]))
 
  226       return native_id.
substr(start_idx, end_idx - start_idx).
toInt();
 
  231       std::cout << 
"SuperHirn feature extraction...\n";
 
  238       unsigned int scanId = 0;
 
  245       bool orderByNativeIds = 
false;
 
  248       for (
unsigned int s = 0; s < 
map_.
size(); s++)
 
  251         double rt = spectrum.
getRT();
 
  253         if (orderByNativeIds)
 
  258             std::cout << 
"Order by native ids not working, turning it off.\n";
 
  259             orderByNativeIds = 
false;
 
  268         std::vector<double> vmzvals;
 
  269         std::vector<double> vintvals;
 
  271         for (
Size p = 0; p < spectrum.size(); ++p)
 
  273           vmzvals.push_back(spectrum[p].getMZ());
 
  274           vintvals.push_back(spectrum[p].getIntensity());
 
  278         boost::shared_ptr<RawData> data_ptr(
new RawData(vmzvals, vintvals));
 
  280         MyMap map_ptr(rt / 60, data_ptr);
 
  282         unsigned int scanIndex = scanId - 1;
 
  283         datavec[scanIndex] = map_ptr;
 
  289       std::vector<Feature> thefeatures = ctrl.
extractPeaks(datavec);
 
  291       for (
unsigned int i = 0; i < thefeatures.size(); ++i)
 
std::vector< Feature > extractPeaks(Vec datavec)
std::pair< double, boost::shared_ptr< RawData > > MyMap
A facade for various Superhirn FeatureFinder classes. Use FeatureFinderAlgorithmSH instead...
Definition: FeatureFinderAlgorithmSHCtrl.h:52
FeatureMapType * features_
Output data pointer. 
Definition: FeatureFinderAlgorithm.h:144
Param defaults_
Container for default parameters. This member should be filled in the constructor of derived classes!...
Definition: DefaultParamHandler.h:155
void setValue(const String &key, const DataValue &value, const String &description="", const StringList &tags=StringList())
Sets a value. 
A more convenient string class. 
Definition: String.h:56
virtual void run()
Main method that implements the actual algorithm. 
Definition: FeatureFinderAlgorithmSH.h:229
A 2-dimensional raw data point or peak. 
Definition: Peak2D.h:55
Size size() const 
Definition: MSExperiment.h:117
Param param_
Container for current parameters. 
Definition: DefaultParamHandler.h:148
void initParams(Param param)
A container for features. 
Definition: FeatureMap.h:111
Abstract base class for FeatureFinder algorithms. 
Definition: FeatureFinderAlgorithm.h:74
void resize(Size s)
Definition: MSExperiment.h:122
FeatureFinderAlgorithm< PeakType, FeatureType >::FeatureMapType FeatureMapType
Definition: FeatureFinderAlgorithmSH.h:109
The purpose of this struct is to provide definitions of classes and typedefs which are used throughou...
Definition: FeatureFinderDefs.h:51
MapType::SpectrumType SpectrumType
Definition: FeatureFinderAlgorithmSH.h:110
unsigned int getNativeScanId(String native_id)
Definition: FeatureFinderAlgorithmSH.h:206
MapType map_
Definition: FeatureFinderAlgorithmSH.h:306
Int toInt() const 
Conversion to int. 
FeatureFinderAlgorithm< PeakType, FeatureType >::MapType MapType
Definition: FeatureFinderAlgorithmSH.h:108
static StringList create(const String &list, const char splitter= ',')
Returns a list that is created by splitting the given (comma-separated) string (String are not trimme...
The Superhirn FeatureFinderAlgorithm. 
Definition: FeatureFinderAlgorithmSH.h:102
Exception indicating that an invalid parameter was handed over to an algorithm. 
Definition: Exception.h:348
void setValidStrings(const String &key, const std::vector< String > &strings)
Sets the valid strings for the parameter key. 
Representation of a mass spectrometry experiment. 
Definition: MSExperiment.h:68
static FeatureFinderAlgorithm< Peak1D, Feature > * create()
Definition: FeatureFinderAlgorithmSH.h:295
void setMinInt(const String &key, Int min)
Sets the minimum value for the integer or integer list parameter key. 
std::vector< MyMap > Vec
Definition: FeatureFinderAlgorithmSHCtrl.h:53
size_t Size
Size type e.g. used as variable which can hold result of size() 
Definition: Types.h:144
bool check_defaults_
If this member is set to false no checking if parameters in done;. 
Definition: DefaultParamHandler.h:174
String substr(size_t pos=0, size_t n=npos) const 
Wrapper for the STL substr() method. Returns a String object with its contents initialized to a subst...
static IntList create(const String &list)
Returns a list that is created by splitting the given comma-separated string (String are not trimmed!...
Definition: FeatureFinderAlgorithmSHCtrl.h:55
FeatureFinderAlgorithmSH()
Definition: FeatureFinderAlgorithmSH.h:114
DoubleReal getRT() const 
Definition: MSSpectrum.h:215
const String & getNativeID() const 
returns the native identifier for the spectrum, used by the acquisition software. ...
void setMinFloat(const String &key, DoubleReal min)
Sets the minimum value for the floating point or floating point list parameter key. 
static const String getProductName()
Definition: FeatureFinderAlgorithmSH.h:300
void setMaxFloat(const String &key, DoubleReal max)
Sets the maximum value for the floating point or floating point list parameter key.