OpenMS
2.4.0
|
Simulates MS signals for a given set of peptides. More...
#include <OpenMS/SIMULATION/RawMSSignalSimulation.h>
Classes | |
struct | ContaminantInfo |
Public Member Functions | |
RawMSSignalSimulation & | operator= (const RawMSSignalSimulation &source) |
void | loadContaminants () |
void | generateRawSignals (SimTypes::FeatureMapSim &features, SimTypes::MSSimExperiment &experiment, SimTypes::MSSimExperiment &experiment_ct, SimTypes::FeatureMapSim &contaminants) |
fill experiment with signals and noise More... | |
Constructors and Destructors | |
RawMSSignalSimulation () | |
Default constructor. More... | |
RawMSSignalSimulation (SimTypes::MutableSimRandomNumberGeneratorPtr rng) | |
Constructor taking a random generator. More... | |
RawMSSignalSimulation (const RawMSSignalSimulation &source) | |
Copy constructor. More... | |
~RawMSSignalSimulation () override | |
Destructor. More... | |
Public Member Functions inherited from DefaultParamHandler | |
DefaultParamHandler (const String &name) | |
Constructor with name that is displayed in error messages. More... | |
DefaultParamHandler (const DefaultParamHandler &rhs) | |
Copy constructor. More... | |
virtual | ~DefaultParamHandler () |
Destructor. More... | |
virtual DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
Assignment operator. More... | |
virtual bool | operator== (const DefaultParamHandler &rhs) const |
Equality operator. More... | |
void | setParameters (const Param ¶m) |
Sets the parameters. More... | |
const Param & | getParameters () const |
Non-mutable access to the parameters. More... | |
const Param & | getDefaults () const |
Non-mutable access to the default parameters. More... | |
const String & | getName () const |
Non-mutable access to the name. More... | |
void | setName (const String &name) |
Mutable access to the name. More... | |
const std::vector< String > & | getSubsections () const |
Non-mutable access to the registered subsections. More... | |
Public Member Functions inherited from ProgressLogger | |
ProgressLogger () | |
Constructor. More... | |
~ProgressLogger () | |
Destructor. More... | |
ProgressLogger (const ProgressLogger &other) | |
Copy constructor. More... | |
ProgressLogger & | operator= (const ProgressLogger &other) |
Assignment Operator. More... | |
void | setLogType (LogType type) const |
Sets the progress log that should be used. The default type is NONE! More... | |
LogType | getLogType () const |
Returns the type of progress log being used. More... | |
void | startProgress (SignedSize begin, SignedSize end, const String &label) const |
Initializes the progress display. More... | |
void | setProgress (SignedSize value) const |
Sets the current progress. More... | |
void | endProgress () const |
Ends the progress display. More... | |
void | nextProgress () const |
increment progress by 1 (according to range begin-end) More... | |
Protected Types | |
enum | IONIZATIONMETHOD { IM_ESI = 0, IM_MALDI = 1, IM_ALL = 2 } |
enum | PROFILESHAPE { RT_RECTANGULAR, RT_GAUSSIAN } |
enum | RESOLUTIONMODEL { RES_CONSTANT, RES_LINEAR, RES_SQRT } |
Protected Member Functions | |
void | updateMembers_ () override |
Synchronize members with param class. More... | |
void | setDefaultParams_ () |
Set default parameters. More... | |
void | add1DSignal_ (Feature &feature, SimTypes::MSSimExperiment &experiment, SimTypes::MSSimExperiment &experiment_ct) |
Add a 1D signal for a single feature. More... | |
void | add2DSignal_ (Feature &feature, SimTypes::MSSimExperiment &experiment, SimTypes::MSSimExperiment &experiment_ct) |
Add a 2D signal for a single feature. More... | |
void | samplePeptideModel1D_ (const IsotopeModel &iso, const SimTypes::SimCoordinateType mz_start, const SimTypes::SimCoordinateType mz_end, SimTypes::MSSimExperiment &experiment, SimTypes::MSSimExperiment &experiment_ct, Feature &activeFeature) |
Samples signals for the given 1D model. More... | |
void | samplePeptideModel2D_ (const ProductModel< 2 > &pm, const SimTypes::SimCoordinateType mz_start, const SimTypes::SimCoordinateType mz_end, SimTypes::SimCoordinateType rt_start, SimTypes::SimCoordinateType rt_end, SimTypes::MSSimExperiment &experiment, SimTypes::MSSimExperiment &experiment_ct, Feature &activeFeature) |
Samples signals for the given 2D model. More... | |
void | chooseElutionProfile_ (EGHModel *const elutionmodel, Feature &feature, const double scale, const double rt_sampling_rate, const SimTypes::MSSimExperiment &experiment) |
Add the correct Elution profile to the passed ProductModel. More... | |
void | createContaminants_ (SimTypes::FeatureMapSim &contaminants, SimTypes::MSSimExperiment &exp, SimTypes::MSSimExperiment &exp_ct) |
build contaminant feature map More... | |
void | addShotNoise_ (SimTypes::MSSimExperiment &experiment, SimTypes::SimCoordinateType minimal_mz_measurement_limit, SimTypes::SimCoordinateType maximal_mz_measurement_limit) |
Add shot noise to the experiment. More... | |
void | addWhiteNoise_ (SimTypes::MSSimExperiment &experiment) |
Add white noise to the experiment. More... | |
void | addDetectorNoise_ (SimTypes::MSSimExperiment &experiment) |
Add detector noise to the experiment. More... | |
void | addBaseLine_ (SimTypes::MSSimExperiment &experiment, SimTypes::SimCoordinateType minimal_mz_measurement_limit) |
Add a base line to the experiment. More... | |
void | getSamplingGrid_ (std::vector< SimTypes::SimCoordinateType > &grid, const SimTypes::SimCoordinateType mz_min, const SimTypes::SimCoordinateType mz_max, const Int step_Da) |
get the mz grid where all m/z values will be mapped to More... | |
void | compressSignals_ (SimTypes::MSSimExperiment &experiment) |
Compress signals in a single RT scan (to merge signals which were sampled overlapping) More... | |
SimTypes::SimIntensityType | getFeatureScaledIntensity_ (const SimTypes::SimIntensityType feature_intensity, const SimTypes::SimIntensityType natural_scaling_factor) |
Computes a rescaled feature intensity based on the set parameters for feature intensity scaling and the passed parameter natural_scaling_factor . More... | |
double | getResolution_ (const double query_mz, const double resolution, const RESOLUTIONMODEL model) const |
Compute resolution at a given m/z given a base resolution and how it degrades with increasing m/z. More... | |
double | getPeakWidth_ (const double mz, const bool is_gaussian) const |
compute the peak's SD (Gaussian) at a given m/z (internally the resolution model is used) More... | |
Protected Member Functions inherited from DefaultParamHandler | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
Protected Attributes | |
Int | sampling_points_per_FWHM_ |
number of points sampled per peak's FWHM More... | |
SimTypes::SimCoordinateType | mz_error_mean_ |
Mean of peak m/z error. More... | |
SimTypes::SimCoordinateType | mz_error_stddev_ |
Standard deviation of peak m/z error. More... | |
SimTypes::SimIntensityType | intensity_scale_ |
Scaling factor of peak intensities. More... | |
SimTypes::SimIntensityType | intensity_scale_stddev_ |
Standard deviation of peak intensity scaling. More... | |
RESOLUTIONMODEL | res_model_ |
model of how resolution behaves with increasing m/z More... | |
double | res_base_ |
base resolution at 400 Th More... | |
std::vector< SimTypes::SimCoordinateType > | grid_ |
m/z sampling grid for all signals More... | |
SimTypes::MutableSimRandomNumberGeneratorPtr | rnd_gen_ |
Random number generator. More... | |
std::vector< ContaminantInfo > | contaminants_ |
std::vector< std::vector< double > > | threaded_random_numbers_ |
std::vector< Size > | threaded_random_numbers_index_ |
bool | contaminants_loaded_ |
Protected Attributes inherited from DefaultParamHandler | |
Param | param_ |
Container for current parameters. More... | |
Param | defaults_ |
Container for default parameters. This member should be filled in the constructor of derived classes! More... | |
std::vector< String > | subsections_ |
Container for registered subsections. This member should be filled in the constructor of derived classes! More... | |
String | error_name_ |
Name that is displayed in error messages during the parameter checking. More... | |
bool | check_defaults_ |
If this member is set to false no checking if parameters in done;. More... | |
bool | warn_empty_defaults_ |
If this member is set to false no warning is emitted when defaults are empty;. More... | |
Protected Attributes inherited from ProgressLogger | |
LogType | type_ |
time_t | last_invoke_ |
ProgressLoggerImpl * | current_logger_ |
Static Protected Attributes | |
static const Size | THREADED_RANDOM_NUMBER_POOL_SIZE_ = 500 |
Static Protected Attributes inherited from ProgressLogger | |
static int | recursion_depth_ |
Additional Inherited Members | |
Public Types inherited from ProgressLogger | |
enum | LogType { CMD, GUI, NONE } |
Possible log types. More... | |
Static Protected Member Functions inherited from ProgressLogger | |
static String | logTypeToFactoryName_ (LogType type) |
Return the name of the factory product used for this log type. More... | |
Simulates MS signals for a given set of peptides.
Simulates MS signals for a given set of peptides, with charge annotation, given detectabilities, predicted retention times and charge values.
Parameters of this class are:Name | Type | Default | Restrictions | Description |
---|---|---|---|---|
enabled | string | true | true, false | Enable RAW signal simulation? (select 'false' if you only need feature-maps) |
ionization_type | string | ESI | MALDI, ESI | Type of Ionization (MALDI or ESI) |
peak_shape | string | Gaussian | Gaussian, Lorentzian | Peak Shape used around each isotope peak (be aware that the area under the curve is constant for both types, but the maximal height will differ (~ 2:3 = Lorentz:Gaussian) due to the wider base of the Lorentzian. |
resolution:value | int | 50000 | Instrument resolution at 400 Th. | |
resolution:type | string | linear | constant, linear, sqrt | How does resolution change with increasing m/z?! QTOFs usually show 'constant' behavior, FTs have linear degradation, and on Orbitraps the resolution decreases with square root of mass. |
baseline:scaling | float | 0 | min: 0 | Scale of baseline. Set to 0 to disable simulation of baseline. |
baseline:shape | float | 0.5 | min: 0 | The baseline is modeled by an exponential probability density function (pdf) with f(x) = shape*e^(- shape*x) |
mz:sampling_points | int | 3 | min: 2 | Number of raw data points per FWHM of the peak. |
contaminants:file | string | examples/simulation/contaminants.csv | Contaminants file with sum formula and absolute RT interval. See 'OpenMS/examples/simulation/contaminants.txt' for details. | |
variation:mz:error_stddev | float | 0 | Standard deviation for m/z errors. Set to 0 to disable simulation of m/z errors. | |
variation:mz:error_mean | float | 0 | Average systematic m/z error (Da) | |
variation:intensity:scale | float | 100 | min: 0 | Constant scale factor of the feature intensity. Set to 1.0 to get the real intensity values provided in the FASTA file. |
variation:intensity:scale_stddev | float | 0 | min: 0 | Standard deviation of peak intensity (relative to the scaled peak height). Set to 0 to get simple rescaled intensities. |
noise:shot:rate | float | 0 | min: 0 | Poisson rate of shot noise per unit m/z. Set this to 0 to disable simulation of shot noise. |
noise:shot:intensity-mean | float | 1 | Shot noise intensity mean (exponentially distributed with given mean). | |
noise:white:mean | float | 0 | Mean value of white noise being added to each measured signal. | |
noise:white:stddev | float | 0 | Standard deviation of white noise being added to each measured signal. | |
noise:detector:mean | float | 0 | Mean value of the detector noise being added to the complete measurement. | |
noise:detector:stddev | float | 0 | Standard deviation of the detector noise being added to the complete measurement. |
|
protected |
|
protected |
|
protected |
Default constructor.
|
explicit |
Constructor taking a random generator.
RawMSSignalSimulation | ( | const RawMSSignalSimulation & | source | ) |
Copy constructor.
|
override |
Destructor.
|
protected |
Add a 1D signal for a single feature.
feature | The feature which should be simulated |
experiment | The experiment to which the simulated signals should be added |
experiment_ct | Ground truth for picked peaks |
|
protected |
Add a 2D signal for a single feature.
feature | The feature which should be simulated |
experiment | The experiment to which the simulated signals should be added |
experiment_ct | Ground truth for picked peaks |
|
protected |
Add a base line to the experiment.
|
protected |
Add detector noise to the experiment.
|
protected |
Add shot noise to the experiment.
|
protected |
Add white noise to the experiment.
|
protected |
Add the correct Elution profile to the passed ProductModel.
|
protected |
Compress signals in a single RT scan (to merge signals which were sampled overlapping)
|
protected |
build contaminant feature map
void generateRawSignals | ( | SimTypes::FeatureMapSim & | features, |
SimTypes::MSSimExperiment & | experiment, | ||
SimTypes::MSSimExperiment & | experiment_ct, | ||
SimTypes::FeatureMapSim & | contaminants | ||
) |
fill experiment with signals and noise
|
protected |
Computes a rescaled feature intensity based on the set parameters for feature intensity scaling and the passed parameter natural_scaling_factor
.
feature_intensity | Intensity of the current feature. |
natural_scaling_factor | Additional scaling factor used by some of the sampling models. |
compute the peak's SD (Gaussian) at a given m/z (internally the resolution model is used)
|
protected |
Compute resolution at a given m/z given a base resolution and how it degrades with increasing m/z.
query_mz | The m/z value where the resolution should be estimated |
resolution | The resolution at 400 Th |
model | The model describing how resolution behaves, i.e.
|
|
protected |
get the mz grid where all m/z values will be mapped to
void loadContaminants | ( | ) |
load the contaminants from contaminants:file param You do not have to call this function before calling generateRawSignals(), but it might be useful to check if the contaminant file is valid
RawMSSignalSimulation& operator= | ( | const RawMSSignalSimulation & | source | ) |
|
protected |
Samples signals for the given 1D model.
iso | The isotope model from which the signals will be sampled |
mz_start | Start coordinate (in m/z dimension) of the region where the signals will be sampled |
mz_end | End coordinate (in m/z dimension) of the region where the signals will be sampled |
experiment | Experiment to which the sampled signals will be added |
experiment_ct | Experiment to which the centroided Ground Truth sampled signals will be added |
activeFeature | The current feature that is simulated |
|
protected |
Samples signals for the given 2D model.
pm | The product model from which the signals will be sampled |
mz_start | Start coordinate (in m/z dimension) of the region where the signals will be sampled |
mz_end | End coordinate (in m/z dimension) of the region where the signals will be sampled |
rt_start | Start coordinate (in rt dimension) of the region where the signals will be sampled |
rt_end | End coordinate (in rt dimension) of the region where the signals will be sampled |
experiment | Experiment to which the sampled signals will be added |
experiment_ct | Experiment to which the centroided Ground Truth sampled signals will be added |
activeFeature | The current feature that is simulated |
|
protected |
Set default parameters.
|
overrideprotectedvirtual |
Synchronize members with param class.
Reimplemented from DefaultParamHandler.
|
protected |
|
protected |
|
protected |
m/z sampling grid for all signals
|
protected |
Scaling factor of peak intensities.
|
protected |
Standard deviation of peak intensity scaling.
|
protected |
Mean of peak m/z error.
|
protected |
Standard deviation of peak m/z error.
|
protected |
base resolution at 400 Th
|
protected |
model of how resolution behaves with increasing m/z
|
protected |
Random number generator.
|
protected |
number of points sampled per peak's FWHM
|
staticprotected |
|
protected |
threaded_random_numbers
keeps a set of random numbers for each thread simulating a feature.
|
protected |
Indicates which random numbers each thread has used already and if the random number pool should be rebuild.