78 std::vector< OpenSwath::ChromatogramPtr >& output,
79 const std::vector<ExtractionCoordinates>& extraction_coordinates,
80 double mz_extraction_window,
82 const std::string& filter)
85 extraction_coordinates, mz_extraction_window, ppm, -1, filter);
107 std::vector< OpenSwath::ChromatogramPtr >& output,
108 const std::vector<ExtractionCoordinates>& extraction_coordinates,
109 double mz_extraction_window,
111 double im_extraction_window,
112 const std::string& filter)
115 extraction_coordinates, mz_extraction_window, ppm, im_extraction_window, filter);
143 std::vector< ExtractionCoordinates > & coordinates,
145 const double rt_extraction_window,
146 const bool ms1 =
false,
147 const int ms1_isotopes = 0);
163 template <
typename TransitionExpT>
165 const std::vector< ChromatogramExtractor::ExtractionCoordinates > & coordinates,
166 TransitionExpT& transition_exp_used,
168 std::vector<OpenMS::MSChromatogram > & output_chromatograms,
170 double im_extraction_width = 0.0)
172 typedef std::map<std::string, const typename TransitionExpT::Transition* > TransitionMapType;
173 TransitionMapType trans_map;
174 for (
Size i = 0; i < transition_exp_used.getTransitions().size(); i++)
176 trans_map[transition_exp_used.getTransitions()[i].getNativeID()] = &transition_exp_used.getTransitions()[i];
179 for (
Size i = 0; i < chromatograms.size(); i++)
186 OpenSwathDataAccessHelper::convertToOpenMSChromatogram(chromptr, chrom);
201 std::string transition_group_id = OpenSwathHelper::computeTransitionGroupId(coord.
id);
202 if (!transition_group_id.empty())
205 std::string r = extract_id_(transition_exp_used, transition_group_id, prec_charge);
212 typename TransitionExpT::Transition transition = (*trans_map[coord.
id]);
214 prec.
setMZ(transition.getPrecursorMZ());
223 prod.
setMZ(transition.getProductMZ());
225 chrom.
setChromatogramType(ChromatogramSettings::ChromatogramType::SELECTED_REACTION_MONITORING_CHROMATOGRAM);
229 if (!transition.getPeptideRef().empty())
232 std::string r = extract_id_(transition_exp_used, transition.getPeptideRef(), prec_charge);
239 std::string r = extract_id_(transition_exp_used, transition.getCompoundRef(), prec_charge);
245 if (coord.
ion_mobility >= 0 && im_extraction_width > 0.0)
263 output_chromatograms.push_back(chrom);
276 template <
typename TransitionExpT>
277 static std::string
extract_id_(TransitionExpT& transition_exp_used,
const std::string&
id,
int& prec_charge);
293 template <
class SpectrumSettingsT,
class ChromatogramT>
295 std::vector<ChromatogramT>& chromatograms,
307 if (settings.getPrecursors().size() > 0)
315 for (
Size pep_idx = 0; pep_idx < transition_exp.
getPeptides().size(); pep_idx++)
318 if (pep->
id == pepref)
325 for (
Size comp_idx = 0; comp_idx < transition_exp.
getCompounds().size(); comp_idx++)
328 if (comp->
id == compref)
336 chrom.setPrecursor(prec);
341 chrom.setProduct(prod);
344 chrom.setInstrumentSettings(settings.getInstrumentSettings());
345 chrom.setAcquisitionInfo(settings.getAcquisitionInfo());
346 chrom.setSourceFile(settings.getSourceFile());
348 for (
Size j = 0; j < settings.getDataProcessing().size(); ++j)
350 settings.getDataProcessing()[j]->setMetaValue(
"performed_on_spectra",
"true");
351 chrom.getDataProcessing().push_back(settings.getDataProcessing()[j]);
356 chrom.setChromatogramType(ChromatogramSettings::ChromatogramType::SELECTED_REACTION_MONITORING_CHROMATOGRAM);
357 chromatograms.push_back(chrom);
366 double rt_extraction_window);
373 double rt_extraction_window);
382 const std::string&
id,
386 prec_charge = comp.
charge;
404 const std::string&
id,
414 const std::string&
id,
426 if (c.hasCharge()) {prec_charge = c.getChargeState();}
void setPrecursor(const Precursor &precursor)
sets the precursors
void setProduct(const Product &product)
sets the products
std::vector< DataProcessingPtr > & getDataProcessing()
returns a mutable reference to the description of the applied processing
void setInstrumentSettings(const InstrumentSettings &instrument_settings)
sets the instrument settings of the current spectrum
void setSourceFile(const SourceFile &source_file)
sets the source file
void setChromatogramType(ChromatogramType type)
sets the chromatogram type
void setAcquisitionInfo(const AcquisitionInfo &acquisition_info)
sets the acquisition info
void setNativeID(const std::string &native_id)
sets the native identifier for the spectrum, used by the acquisition software.
The representation of a chromatogram.
Definition MSChromatogram.h:30
void setMZ(CoordinateType mz)
Mutable access to m/z.
Definition Peak1D.h:95
Precursor meta information.
Definition Precursor.h:37
void setIsolationWindowUpperOffset(double bound)
sets the upper offset from the target m/z
void setDriftTime(double drift_time)
sets the ion mobility drift time in milliseconds
void setDriftTimeWindowUpperOffset(double drift_time)
sets the upper offset from the target ion mobility
void setDriftTimeWindowLowerOffset(double drift_time)
sets the lower offset from the target ion mobility
void setIsolationWindowLowerOffset(double bound)
sets the lower offset from the target m/z
void setCharge(Int charge)
Mutable access to the charge.
Product meta information.
Definition Product.h:26
void setMZ(double mz)
sets the target m/z
Base class for all classes that want to report their progress.
Definition ProgressLogger.h:27
This class stores a SRM/MRM transition.
Definition ReactionMonitoringTransition.h:34
double getPrecursorMZ() const
get the precursor mz (Q1 value)
double getProductMZ() const
const std::string & getPeptideRef() const
const std::string & getCompoundRef() const
const std::string & getNativeID() const
Representation of 1D spectrum settings.
Definition SpectrumSettings.h:43
std::vector< DataProcessingPtr > & getDataProcessing()
returns a mutable reference to the description of the applied processing
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
const InstrumentSettings & getInstrumentSettings() const
returns a const reference to the instrument settings of the current spectrum
const SourceFile & getSourceFile() const
returns a const reference to the source file
const AcquisitionInfo & getAcquisitionInfo() const
returns a const reference to the acquisition info
Represents a compound (small molecule)
Definition TargetedExperimentHelper.h:298
int getChargeState() const
Return the peptide or compound charge state.
Definition TargetedExperimentHelper.h:218
bool hasCharge() const
Whether peptide or compound has set charge state.
Definition TargetedExperimentHelper.h:212
std::string id
Definition TargetedExperimentHelper.h:281
Represents a peptide (amino acid sequence)
Definition TargetedExperimentHelper.h:335
std::string sequence
Definition TargetedExperimentHelper.h:395
A description of a targeted experiment containing precursor and production ions.
Definition TargetedExperiment.h:40
bool hasPeptide(const std::string &ref) const
const Compound & getCompoundByRef(const std::string &ref) const
bool hasCompound(const std::string &ref) const
const std::vector< ReactionMonitoringTransition > & getTransitions() const
returns the transition list
const std::vector< Compound > & getCompounds() const
const std::vector< Peptide > & getPeptides() const
const Peptide & getPeptideByRef(const std::string &ref) const
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::string ChromatogramExtractor::extract_id_< OpenSwath::LightTargetedExperiment >(OpenSwath::LightTargetedExperiment &transition_exp_used, const std::string &id, int &prec_charge)
Definition ChromatogramExtractor.h:381
std::shared_ptr< Chromatogram > ChromatogramPtr
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:153
std::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:131
Definition TransitionExperiment.h:269
std::string sequence
Definition TransitionExperiment.h:292
std::string compound_name
Definition TransitionExperiment.h:301
int charge
Definition TransitionExperiment.h:291
Definition TransitionExperiment.h:369
const LightCompound & getCompoundByRef(const std::string &ref)
Definition TransitionExperiment.h:416