OpenMS
|
Quality Control function for OpenSwath. More...
#include <OpenMS/ANALYSIS/OPENSWATH/SwathQC.h>
Public Types | |
typedef std::map< int, int > | ChargeDistribution |
Public Member Functions | |
SwathQC ()=delete | |
default C'tor (forbidden) More... | |
SwathQC (const size_t cd_spectra, const double decon_ms1_mz_tol) | |
CTor with arguments. More... | |
std::function< void(const OpenMS::ExperimentalSettings &es)> | getExpSettingsFunc () |
Returns a lambda function, which captures internal members and can be used in MSDataTransformingConsumer::setExperimentalSettingsFunc() More... | |
std::function< void(const OpenMS::MSSpectrum &)> | getSpectraProcessingFunc () |
void | storeJSON (const OpenMS::String &filename) |
Save all internally collected data to a JSON file. More... | |
const ChargeDistribution & | getChargeDistribution () const |
returns the charge distribution which was internally computed by applying getSpectraProcessingFunc() externally More... | |
void | setNrMS1Spectra (size_t nr) |
Explicitly set the number of expected MS1 spectra (for sampling charge distribution) More... | |
Static Public Member Functions | |
static ChargeDistribution | getChargeDistribution (const std::vector< SwathMap > &swath_maps, const size_t nr_samples, const double mz_tol) |
Sample the spectra in all MS1 Swath maps and determine all charge states. More... | |
Static Protected Member Functions | |
static bool | isSubsampledSpectrum_ (const size_t total_spec_count, const size_t subsample_count, const size_t idx) |
Given a total spectrum count and a number of spectra to inspect, is the current index a candidate? More... | |
Private Attributes | |
ChargeDistribution | cd_ |
internal ChargeDistribution which is augmented upon calling the corresponding member functions More... | |
size_t | nr_ms1_spectra_ |
number of MS1 spectra expected More... | |
size_t | cd_spectra_ |
number of spectra to inspect for charge distribution More... | |
double | decon_ms1_mz_tol_ |
m/z tolerance for isotope deconvolution More... | |
size_t | ms1_spectra_seen_ |
keeps track of number of spectra passed to getSpectraProcessingFunc() More... | |
Quality Control function for OpenSwath.
The class is meant to collect information as a plugin of type IMSDataConsumer. You can (if the relevant data is already available and you do not mind the overhead), call static functions, which will do the same.
typedef std::map<int,int> ChargeDistribution |
|
delete |
default C'tor (forbidden)
SwathQC | ( | const size_t | cd_spectra, |
const double | decon_ms1_mz_tol | ||
) |
CTor with arguments.
cd_spectra | Number of MS spectra to inspect for charge distribution estimation |
decon_ms1_mz_tol | m/z tolerance for isotope deconvolution |
const ChargeDistribution& getChargeDistribution | ( | ) | const |
returns the charge distribution which was internally computed by applying getSpectraProcessingFunc() externally
|
static |
Sample the spectra in all MS1 Swath maps and determine all charge states.
Conveniently wraps internal functions and applies them to a whole set of data. However, it might be more speed efficient to sample the spectra as they are loaded using member functions.
From all swath maps in swath_maps
which are ms_level == 1 we extract nr_samples
spectra (subsampling), determine the charge states of all isotopic envelopes and return their total counts using getSpectraProcessingFunc().
[in] | swath_maps | Swath maps of mixed ms-level |
[in] | nr_samples | Number of spectra to sample per Swath map. To sample all spectra, set to -1 |
[in] | mz_tol | Error tolerance in Th in which an isotopic peak is expected (assuming C12-C13 distance) |
Exception::Postcondition | if Deisotoper did not return charge data |
std::function<void(const OpenMS::ExperimentalSettings& es)> getExpSettingsFunc | ( | ) |
Returns a lambda function, which captures internal members and can be used in MSDataTransformingConsumer::setExperimentalSettingsFunc()
If es
contains a metavalue 'nr_ms1_spectra' it will be used to set the internal number of expected MS1 spectra
std::function<void (const OpenMS::MSSpectrum&)> getSpectraProcessingFunc | ( | ) |
returns a lambda function, which captures internal members and can be used in MSDataTransformingConsumer::setExperimentalSettingsFunc() PeakPicking is performed internally if the data is estimated to be profile data. Uses the Deisotoper class for charge determination and updates the internal charge count.
|
staticprotected |
Given a total spectrum count and a number of spectra to inspect, is the current index a candidate?
Allows to uniformly sample a range of spectra. E.g. given 10 spectra exist, and we want to subsample 4 of them, the answer of this function for every requested index from 0..9 is:
If the total number of spectra is unknown, pass 0 as first argument, which will return true for every query, i.e. sample everything.
[in] | total_spec_count | Total number of spectra expected |
[in] | subsample_count | Number of spectra which should be sampled from total_spec_count |
[in] | idx | Index of the spectrum under question |
void setNrMS1Spectra | ( | size_t | nr | ) |
Explicitly set the number of expected MS1 spectra (for sampling charge distribution)
Computing the charge distribution using getSpectraProcessingFunc() requires knowing the total number of MS1 spectra. Either use getExpSettingsFunc() externally, or use this method to set it explicitly (depending on workflow). If nr
is set to 0, all spectra passed into getSpectraProcessingFunc() will be inspected for their charge distribution.
void storeJSON | ( | const OpenMS::String & | filename | ) |
Save all internally collected data to a JSON file.
|
private |
internal ChargeDistribution which is augmented upon calling the corresponding member functions
|
private |
number of spectra to inspect for charge distribution
|
private |
m/z tolerance for isotope deconvolution
|
private |
keeps track of number of spectra passed to getSpectraProcessingFunc()
|
private |
number of MS1 spectra expected