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, const 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, 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)
 Execute the OpenSWATH workflow on a set of SwathMaps and transitions. More...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
 ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (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...
 

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 the corresponding peptides and transitions to transition_exp_used. 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 from all_transitions to output (e.g. those that match a peptide in the used_peptides vector) 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)
 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...
 

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...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

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

References LOG_DEBUG.

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 from all_transitions to output (e.g. those that match a peptide in the used_peptides vector)

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 
)
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 IMSDataConsumer< MapType >::consumeChromatogram(), ChromatogramExtractor::extractChromatograms(), OpenSwathWorkflow::ChromExtractParams::extraction_function, LightTargetedExperiment::getPeptides(), FeatureMap::getProteinIdentifications(), LightTargetedExperiment::getTransitions(), TransformationDescription::invert(), OpenSwathWorkflow::ChromExtractParams::min_upper_edge_dist, OpenSwathWorkflow::ChromExtractParams::mz_extraction_window, OpenSwathWorkflow::ChromExtractParams::ppm, ChromatogramExtractor::return_chromatogram(), OpenSwathWorkflow::ChromExtractParams::rt_extraction_window, OpenSwathHelper::selectSwathTransitions(), LightTargetedExperiment::transitions, OpenSwathTSVWriter::use_ms1_traces_, and OpenSwathTSVWriter::writeHeader().

TransformationDescription performRTNormalization ( const OpenMS::TargetedExperiment irt_transitions,
const 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,
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
debug_levelDebug level (writes out the RT normalization chromatograms if larger than 1)
mz_correction_functionIf correction in m/z is desired, which function should be used
irt_detection_paramParameter set for the detection of the iRTs (outlier detection, peptides per bin etc)

References LOG_DEBUG, MSExperiment< PeakT, ChromatogramPeakT >::setChromatograms(), and MzMLFile::store().

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

Wrapper function for prepare_coordinates that also correctly handles transformations.

References TransformationDescription::apply(), OpenSwathWorkflow::ChromExtractParams::extra_rt_extract, and OpenSwathWorkflow::ChromExtractParams::rt_extraction_window.

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 
)
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)
Note
: feature_finder_param are copied because they are changed here.

References OpenSwathDataAccessHelper::convertTargetedExp(), OpenSwathHelper::estimateRTRange(), TransformationDescription::fitModel(), LightTargetedExperiment::getPeptides(), SimpleOpenMSSpectraFactory::getSpectrumAccessOpenMSPtr(), Param::getValue(), LOG_DEBUG, MRMFeatureFinderScoring::pickExperiment(), MRMRTNormalizer::removeOutliersIterative(), MRMRTNormalizer::removeOutliersRANSAC(), TransformationDescription::setDataPoints(), DefaultParamHandler::setParameters(), MRMFeatureFinderScoring::setStrictFlag(), Param::setValue(), and OpenSwathHelper::simpleFindBestFeature().

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
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 the corresponding peptides and transitions to transition_exp_used.

Parameters
transition_exp_usedinput (all transitions for this swath)
transition_exp_usedoutput (contains 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)

References LightTargetedExperiment::peptides, LightTargetedExperiment::proteins, and LightTargetedExperiment::transitions.

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
bool use_ms1_traces_
private

Whether to use the MS1 traces.


OpenMS / TOPP release 2.0.0 Documentation generated on Tue Nov 1 2016 16:34:46 using doxygen 1.8.11