Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
OpenSwathWorkflow Class Reference

Class to execute an OpenSwath Workflow. More...

Inheritance diagram for OpenSwathWorkflow:
ProgressLogger

Classes

struct  ChromExtractParams
 ChromatogramExtractor parameters. More...
 

Public Member Functions

 OpenSwathWorkflow (bool use_ms1_traces)
 
TransformationDescription performRTNormalization (const OpenMS::TargetedExperiment &irt_transitions, std::vector< OpenSwath::SwathMap > &swath_maps, double min_rsq, double min_coverage, const Param &feature_finder_param, const ChromExtractParams &cp_irt, const Param &irt_detection_param, const String &mz_correction_function, Size debug_level)
 Compute the alignment against a set of RT-normalization peptides. More...
 
void performExtraction (const std::vector< OpenSwath::SwathMap > &swath_maps, const TransformationDescription trafo, const ChromExtractParams &cp, const Param &feature_finder_param, const OpenSwath::LightTargetedExperiment &transition_exp, FeatureMap &out_featureFile, bool store_features, OpenSwathTSVWriter &tsv_writer, Interfaces::IMSDataConsumer<> *chromConsumer, int batchSize, bool load_into_memory)
 Execute the OpenSWATH workflow on a set of SwathMaps and transitions. More...
 

Private Member Functions

void selectPeptidesForBatch_ (const OpenSwath::LightTargetedExperiment &transition_exp_used_all, OpenSwath::LightTargetedExperiment &transition_exp_used, int batch_size, size_t j)
 Select which peptides to analyze in the next batch (and copy to output) More...
 
void copyBatchTransitions_ (const std::vector< OpenSwath::LightPeptide > &used_peptides, const std::vector< OpenSwath::LightTransition > &all_transitions, std::vector< OpenSwath::LightTransition > &output)
 Copy the required transitions to output. More...
 
void simpleExtractChromatograms (const std::vector< OpenSwath::SwathMap > &swath_maps, const OpenMS::TargetedExperiment &irt_transitions, std::vector< OpenMS::MSChromatogram<> > &chromatograms, const ChromExtractParams &cp)
 Simple method to extract chromatograms (for the RT-normalization peptides) More...
 
TransformationDescription RTNormalization (TargetedExperiment transition_exp_, std::vector< OpenMS::MSChromatogram<> > chromatograms, double min_rsq, double min_coverage, Param feature_finder_param, const Param &irt_detection_param, std::vector< OpenSwath::SwathMap > &swath_maps, const String &mz_correction_function)
 Perform RT normalization using the MRMFeatureFinderScoring. More...
 
bool computeBinnedCoverage (const std::pair< double, double > &rtRange, const std::vector< std::pair< double, double > > &pairs, int nrBins, int minPeptidesPerBin, int minBinsFilled)
 
void scoreAllChromatograms (const OpenSwath::SpectrumAccessPtr input, const OpenSwath::SpectrumAccessPtr swath_map, OpenSwath::LightTargetedExperiment &transition_exp, const Param &feature_finder_param, TransformationDescription trafo, const double rt_extraction_window, FeatureMap &output, OpenSwathTSVWriter &tsv_writer, std::map< std::string, OpenSwath::ChromatogramPtr > &ms1_chromatograms)
 
void prepare_coordinates_wrap (std::vector< OpenSwath::ChromatogramPtr > &chrom_list, std::vector< ChromatogramExtractorAlgorithm::ExtractionCoordinates > &coordinates, OpenSwath::LightTargetedExperiment &transition_exp_used, const bool ms1, const TransformationDescription trafo_inverse, const ChromExtractParams &cp) const
 Wrapper function for prepare_coordinates that also correctly handles transformations. More...
 
void prepare_coordinates (std::vector< OpenSwath::ChromatogramPtr > &output_chromatograms, std::vector< ChromatogramExtractorAlgorithm::ExtractionCoordinates > &coordinates, OpenSwath::LightTargetedExperiment &transition_exp_used, const double rt_extraction_window, const bool ms1) const
 
void selectChrom_ (const MSChromatogram< ChromatogramPeak > &chromatogram_old, MSSpectrum< ChromatogramPeak > &chromatogram, double rt_extraction_window, double center_rt)
 

Private Attributes

OpenSwath::SpectrumAccessPtr ms1_map_
 Spectrum Access to the MS1 map (note that this is *not* threadsafe!) More...
 
bool use_ms1_traces_
 Whether to use the MS1 traces. More...
 

Detailed Description

Class to execute an OpenSwath Workflow.

performExtraction will perform the OpenSWATH analysis. Optionally, an RT transformation (mapping peptides to normalized space) can be obtained beforehand using performRTNormalization.

Constructor & Destructor Documentation

OpenSwathWorkflow ( bool  use_ms1_traces)
inlineexplicit

Member Function Documentation

bool computeBinnedCoverage ( const std::pair< double, double > &  rtRange,
const std::vector< std::pair< double, double > > &  pairs,
int  nrBins,
int  minPeptidesPerBin,
int  minBinsFilled 
)
inlineprivate

Function to compute the coverage of the iRT peptides across the gradient Cmp with RTNormalizer

Referenced by OpenSwathWorkflow::RTNormalization().

void copyBatchTransitions_ ( const std::vector< OpenSwath::LightPeptide > &  used_peptides,
const std::vector< OpenSwath::LightTransition > &  all_transitions,
std::vector< OpenSwath::LightTransition > &  output 
)
inlineprivate

Copy the required transitions to output.

Copy all transitions matching to one of the peptides in the selected peptide vector from all_transitions to the output.

Parameters
used_peptidesWhich peptides to be used
all_transitionsTransitions vector from which to select transitions
outputOutput vector containing matching transitions (taken from all_transitions)

Referenced by OpenSwathWorkflow::selectPeptidesForBatch_().

void performExtraction ( const std::vector< OpenSwath::SwathMap > &  swath_maps,
const TransformationDescription  trafo,
const ChromExtractParams cp,
const Param &  feature_finder_param,
const OpenSwath::LightTargetedExperiment &  transition_exp,
FeatureMap &  out_featureFile,
bool  store_features,
OpenSwathTSVWriter tsv_writer,
Interfaces::IMSDataConsumer<> *  chromConsumer,
int  batchSize,
bool  load_into_memory 
)
inline

Execute the OpenSWATH workflow on a set of SwathMaps and transitions.

Executes the following operations on the given input:

1. OpenSwathHelper::selectSwathTransitions 2. ChromatogramExtractor prepare, extract 3. scoreAllChromatograms 4. Write out chromatograms and found features

Parameters
swath_mapsThe raw data (swath maps)
trafoTransformation description (translating this runs' RT to normalized RT space)
cpParameter set for the chromatogram extraction
feature_finder_paramParameter set for the feature finding in chromatographic dimension
transition_expThe set of assays to be extracted and scored
out_featureFileOutput feature map to store identified features
store_featuresWhether features should be appended to the output feature map
tsv_writerTSV Writer object to store identified features in csv format
chromConsumerChromatogram consumer object to store the extracted chromatograms
batchSizeSize of the batches which should be extracted and scored

References OpenSwathWorkflow::ChromExtractParams::extraction_function, OpenSwathWorkflow::ChromExtractParams::min_upper_edge_dist, OpenSwathWorkflow::ms1_map_, OpenSwathWorkflow::ChromExtractParams::mz_extraction_window, OpenSwathWorkflow::ChromExtractParams::ppm, OpenSwathWorkflow::prepare_coordinates_wrap(), OpenSwathWorkflow::ChromExtractParams::rt_extraction_window, OpenSwathWorkflow::scoreAllChromatograms(), OpenSwathWorkflow::selectPeptidesForBatch_(), OpenSwathWorkflow::use_ms1_traces_, and OpenSwathTSVWriter::writeHeader().

TransformationDescription performRTNormalization ( const OpenMS::TargetedExperiment &  irt_transitions,
std::vector< OpenSwath::SwathMap > &  swath_maps,
double  min_rsq,
double  min_coverage,
const Param &  feature_finder_param,
const ChromExtractParams cp_irt,
const Param &  irt_detection_param,
const String &  mz_correction_function,
Size  debug_level 
)
inline

Compute the alignment against a set of RT-normalization peptides.

This function extracts the RT normalization chromatograms (simpleExtractChromatograms) and then uses the chromatograms to find features (in RTNormalization).

Parameters
irt_transitionsA set of transitions used for the RT normalization peptides
swath_mapsThe raw data (swath maps)
min_rsqMinimal R^2 value that is expected for the RT regression
min_coverageMinimal coverage of the chromatographic space that needs to be achieved
feature_finder_paramParameter set for the feature finding in chromatographic dimension
cp_irtParameter set for the chromatogram extraction
irt_detection_paramParameter set for the detection of the iRTs (outlier detection, peptides per bin etc)
mz_correction_functionIf correction in m/z is desired, which function should be used
debug_levelDebug level (writes out the RT normalization chromatograms if larger than 1)

References OpenSwathWorkflow::RTNormalization(), and OpenSwathWorkflow::simpleExtractChromatograms().

void prepare_coordinates ( std::vector< OpenSwath::ChromatogramPtr > &  output_chromatograms,
std::vector< ChromatogramExtractorAlgorithm::ExtractionCoordinates > &  coordinates,
OpenSwath::LightTargetedExperiment &  transition_exp_used,
const double  rt_extraction_window,
const bool  ms1 
) const
inlineprivate
void prepare_coordinates_wrap ( std::vector< OpenSwath::ChromatogramPtr > &  chrom_list,
std::vector< ChromatogramExtractorAlgorithm::ExtractionCoordinates > &  coordinates,
OpenSwath::LightTargetedExperiment &  transition_exp_used,
const bool  ms1,
const TransformationDescription  trafo_inverse,
const ChromExtractParams cp 
) const
inlineprivate
TransformationDescription RTNormalization ( TargetedExperiment  transition_exp_,
std::vector< OpenMS::MSChromatogram<> >  chromatograms,
double  min_rsq,
double  min_coverage,
Param  feature_finder_param,
const Param &  irt_detection_param,
std::vector< OpenSwath::SwathMap > &  swath_maps,
const String &  mz_correction_function 
)
inlineprivate

Perform RT normalization using the MRMFeatureFinderScoring.

Parameters
transition_exp_The transitions for the normalization peptides
chromatogramsThe extracted chromatograms
min_rsqMinimal R^2 value that is expected for the RT regression
min_coverageMinimal coverage of the chromatographic space that needs to be achieved
feature_finder_paramParameter set for the feature finding in chromatographic dimension
irt_detection_paramParameter set for the detection of the iRTs (outlier detection, peptides per bin etc)
swath_mapsThe raw data for the m/z correction
mz_correction_functionIf correction in m/z is desired, which function should be used
Note
: feature_finder_param are copied because they are changed here.

References OpenSwathWorkflow::computeBinnedCoverage().

Referenced by OpenSwathWorkflow::performRTNormalization().

void scoreAllChromatograms ( const OpenSwath::SpectrumAccessPtr  input,
const OpenSwath::SpectrumAccessPtr  swath_map,
OpenSwath::LightTargetedExperiment &  transition_exp,
const Param &  feature_finder_param,
TransformationDescription  trafo,
const double  rt_extraction_window,
FeatureMap &  output,
OpenSwathTSVWriter tsv_writer,
std::map< std::string, OpenSwath::ChromatogramPtr > &  ms1_chromatograms 
)
inlineprivate

Helper function to score a set of chromatograms Will iterate over all assays contained in transition_exp and for each assay fetch the corresponding chromatograms and find peakgroups.

References OpenSwathTSVWriter::isActive(), OpenSwathWorkflow::ms1_map_, OpenSwathTSVWriter::prepareLine(), OpenSwathWorkflow::selectChrom_(), OpenSwathWorkflow::use_ms1_traces_, and OpenSwathTSVWriter::writeLines().

Referenced by OpenSwathWorkflow::performExtraction().

void selectChrom_ ( const MSChromatogram< ChromatogramPeak > &  chromatogram_old,
MSSpectrum< ChromatogramPeak > &  chromatogram,
double  rt_extraction_window,
double  center_rt 
)
inlineprivate
void selectPeptidesForBatch_ ( const OpenSwath::LightTargetedExperiment &  transition_exp_used_all,
OpenSwath::LightTargetedExperiment &  transition_exp_used,
int  batch_size,
size_t  j 
)
inlineprivate

Select which peptides to analyze in the next batch (and copy to output)

This function will select which peptides to analyze in the next batch j and will copy the the corresponding peptides and transitions into the output structure. The output will contain batch_size peptides.

Parameters
transition_exp_used_allinput (all transitions for this swath)
transition_exp_usedoutput (will contain only transitions for the next batch)
batch_sizehow many peptides per batch
jbatch number (peptides from j*batch_size to j*batch_size+batch_size will be copied)
Note
The proteins will be copied completely without checking for a match

References OpenSwathWorkflow::copyBatchTransitions_().

Referenced by OpenSwathWorkflow::performExtraction().

void simpleExtractChromatograms ( const std::vector< OpenSwath::SwathMap > &  swath_maps,
const OpenMS::TargetedExperiment &  irt_transitions,
std::vector< OpenMS::MSChromatogram<> > &  chromatograms,
const ChromExtractParams cp 
)
inlineprivate

Member Data Documentation

OpenSwath::SpectrumAccessPtr ms1_map_
private

Spectrum Access to the MS1 map (note that this is *not* threadsafe!)

Note
This pointer is not threadsafe, please use the lightClone() function to create a copy for each thread
This pointer may be NULL if use_ms1_traces_ is set to false

Referenced by OpenSwathWorkflow::performExtraction(), and OpenSwathWorkflow::scoreAllChromatograms().

bool use_ms1_traces_
private

Whether to use the MS1 traces.

Referenced by OpenSwathWorkflow::performExtraction(), and OpenSwathWorkflow::scoreAllChromatograms().


OpenMS / TOPP release 2.0.0 Documentation generated on Wed Jan 27 2016 17:11:54 using doxygen 1.8.10