56 template <
typename SpectrumType>
61 clean_all_charge_states_ = (
Int)param_.getValue(
"clean_all_charge_states");
62 consider_NH3_loss_ = (
Int)param_.getValue(
"consider_NH3_loss");
63 consider_H2O_loss_ = (
Int)param_.getValue(
"consider_H2O_loss");
64 window_size_ = (double)param_.getValue(
"window_size");
65 reduce_by_factor_ = (
Int)param_.getValue(
"reduce_by_factor");
66 factor_ = (double)param_.getValue(
"factor");
67 set_to_zero_ = (
Int)param_.getValue(
"set_to_zero");
71 std::cerr <<
"Error: ParentPeakMower cannot be applied to MS level 1" << std::endl;
81 std::cerr <<
"ParentPeakMower: Warning, Precursor Position not set" << std::endl;
88 default_charge_ = (
Size)param_.getValue(
"default_charge");
89 std::cerr <<
"ParentPeakMower: Warning, Precursor charge not set, assuming default charge (" << default_charge_ <<
")" << std::endl;
90 pre_charge = default_charge_;
93 pre_pos *= pre_charge;
96 std::vector<DRange<1> > ranges;
97 for (
Size z = 1; z <= pre_charge; ++z)
99 if (clean_all_charge_states_ || z == pre_charge)
107 range =
DRange<1>(pre_z_pos - window_size_, pre_z_pos + window_size_);
108 ranges.push_back(range);
110 if (consider_NH3_loss_)
113 range =
DRange<1>(pos - window_size_, pos + window_size_);
114 ranges.push_back(range);
116 if (consider_H2O_loss_)
119 range =
DRange<1>(pos - window_size_, pos + window_size_);
120 ranges.push_back(range);
131 for (
Iterator it = spectrum.begin(); it != spectrum.end(); ++it)
133 for (std::vector<
DRange<1> >::const_iterator rit = ranges.begin(); rit != ranges.end(); ++rit)
135 if (rit->encloses(it->getPosition()))
137 if (reduce_by_factor_)
139 it->setIntensity(it->getIntensity() / factor_);
145 it->setIntensity(0.0);
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
ContainerType::iterator Iterator
Mutable iterator.
Definition: MSSpectrum.h:108
UInt getMSLevel() const
Returns the MS level.
ParentPeakMower gets rid of high peaks that could stem from unfragmented precursor ions.
Definition: ParentPeakMower.h:30
ParentPeakMower(const ParentPeakMower &source)
copy constructor
bool reduce_by_factor_
Definition: ParentPeakMower.h:169
double window_size_
Definition: ParentPeakMower.h:168
ParentPeakMower()
default constructor
bool consider_H2O_loss_
Definition: ParentPeakMower.h:167
void filterPeakSpectrum(PeakSpectrum &spectrum)
void filterPeakMap(PeakMap &exp)
bool consider_NH3_loss_
Definition: ParentPeakMower.h:166
ParentPeakMower & operator=(const ParentPeakMower &source)
assignment operator
void filterSpectrum(SpectrumType &spectrum)
Definition: ParentPeakMower.h:57
bool set_to_zero_
Definition: ParentPeakMower.h:171
double factor_
Definition: ParentPeakMower.h:170
~ParentPeakMower() override
destructor
Size default_charge_
Definition: ParentPeakMower.h:164
bool clean_all_charge_states_
Definition: ParentPeakMower.h:165
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
int Int
Signed integer type.
Definition: Types.h:76
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22