OpenMS  3.0.0
OpenSwathBase.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2022.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Hannes Roest$
32 // $Authors: Hannes Roest$
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 // Consumers
40 
41 // Files
45 #include <OpenMS/FORMAT/MzMLFile.h>
54 
55 // Kernel and implementations
61 
62 // Helpers
66 
67 // Algorithms
73 
75 
76 #include <cassert>
77 #include <limits>
78 
80 
81 namespace OpenMS
82 {
83 
85  public TOPPBase
86 {
87 
88 public:
89 
90  TOPPOpenSwathBase(String name, String description, bool official = true) :
91  TOPPBase(name, description, official)
92  {
93  }
94 
95 private:
96 
97  void loadSwathFiles_(const StringList& file_list,
98  const bool split_file,
99  const String& tmp,
100  const String& readoptions,
101  boost::shared_ptr<ExperimentalSettings > & exp_meta,
102  std::vector< OpenSwath::SwathMap > & swath_maps,
103  Interfaces::IMSDataConsumer* plugin_consumer)
104  {
105  SwathFile swath_file;
106  swath_file.setLogType(log_type_);
107 
108  if (split_file || file_list.size() > 1)
109  {
110  // TODO cannot use data reduction here any more ...
111  swath_maps = swath_file.loadSplit(file_list, tmp, exp_meta, readoptions);
112  }
113  else
114  {
115  FileTypes::Type in_file_type = FileHandler::getTypeByFileName(file_list[0]);
116  if (in_file_type == FileTypes::MZML)
117  {
118  swath_maps = swath_file.loadMzML(file_list[0], tmp, exp_meta, readoptions, plugin_consumer);
119  }
120  else if (in_file_type == FileTypes::MZXML)
121  {
122  swath_maps = swath_file.loadMzXML(file_list[0], tmp, exp_meta, readoptions);
123  }
124  else if (in_file_type == FileTypes::SQMASS)
125  {
126  swath_maps = swath_file.loadSqMass(file_list[0], exp_meta);
127  }
128  else
129  {
130  throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
131  "Input file needs to have ending mzML or mzXML");
132  }
133  }
134  }
135 
136 protected:
137 
162  bool loadSwathFiles(const StringList& file_list,
163  boost::shared_ptr<ExperimentalSettings >& exp_meta,
164  std::vector< OpenSwath::SwathMap >& swath_maps,
165  const bool split_file,
166  const String& tmp,
167  const String& readoptions,
168  const String& swath_windows_file,
169  const double min_upper_edge_dist,
170  const bool force,
171  const bool sort_swath_maps,
172  const bool sonar,
173  const bool prm,
174  const bool pasef,
175  Interfaces::IMSDataConsumer* plugin_consumer = nullptr)
176  {
177  // (i) Load files
178  loadSwathFiles_(file_list, split_file, tmp, readoptions, exp_meta, swath_maps, plugin_consumer);
179 
180  // (ii) Allow the user to specify the SWATH windows
181  if (!swath_windows_file.empty())
182  {
183  SwathWindowLoader::annotateSwathMapsFromFile(swath_windows_file, swath_maps, sort_swath_maps, force);
184  }
185 
186  for (Size i = 0; i < swath_maps.size(); i++)
187  {
188  OPENMS_LOG_DEBUG << "Found swath map " << i
189  << " with lower " << swath_maps[i].lower
190  << " and upper " << swath_maps[i].upper
191  << " and im Lower bounds of " << swath_maps[i].imLower
192  << " and im Upper bounds of " << swath_maps[i].imUpper
193  << " and " << swath_maps[i].sptr->getNrSpectra()
194  << " spectra." << std::endl;
195  }
196 
197  // (iii) Sanity check: there should be no overlap between the windows:
198  std::vector<std::pair<double, double>> sw_windows;
199  for (Size i = 0; i < swath_maps.size(); i++)
200  {
201  if (!swath_maps[i].ms1)
202  {
203  sw_windows.push_back(std::make_pair(swath_maps[i].lower, swath_maps[i].upper));
204  }
205  }
206  // sort by lower bound (first entry in pair)
207  std::sort(sw_windows.begin(), sw_windows.end());
208 
209  for (Size i = 1; i < sw_windows.size(); i++)
210  {
211  double lower_map_end = sw_windows[i-1].second - min_upper_edge_dist;
212  double upper_map_start = sw_windows[i].first;
213  OPENMS_LOG_DEBUG << "Extraction will go up to " << lower_map_end << " and continue at " << upper_map_start << std::endl;
214 
215  if (prm) {continue;} // skip next step as expect them to overlap and have gaps...
216 
217  if (upper_map_start - lower_map_end > 0.01)
218  {
219  OPENMS_LOG_WARN << "Extraction will have a gap between " << lower_map_end << " and " << upper_map_start << std::endl;
220  if (!force)
221  {
222  OPENMS_LOG_ERROR << "Extraction windows have a gap. Will abort (override with -force)" << std::endl;
223  return false;
224  }
225  }
226 
227  if (sonar) {continue;} // skip next step as expect them to overlap ...
228 
229  if (pasef) {continue;} // skip this step, expect there to be overlap ...
230 
231  if (lower_map_end - upper_map_start > 0.01)
232  {
233  OPENMS_LOG_WARN << "Extraction will overlap between " << lower_map_end << " and " << upper_map_start << "!\n"
234  << "This will lead to multiple extraction of the transitions in the overlapping region "
235  << "which will lead to duplicated output. It is very unlikely that you want this." << "\n"
236  << "Please fix this by providing an appropriate extraction file with -swath_windows_file" << "\n"
237  << "Did you mean to set the -sonar or -pasef Flag?" << std::endl;
238  if (!force)
239  {
240  OPENMS_LOG_ERROR << "Extraction windows overlap. Will abort (override with -force)" << std::endl;
241  return false;
242  }
243  }
244  }
245  return true;
246  }
247 
261  void prepareChromOutput(Interfaces::IMSDataConsumer ** chromatogramConsumer,
262  const boost::shared_ptr<ExperimentalSettings>& exp_meta,
263  const OpenSwath::LightTargetedExperiment& transition_exp,
264  const String& out_chrom,
265  const UInt64 run_id)
266  {
267  if (!out_chrom.empty())
268  {
269  String tmp = out_chrom;
270  if (tmp.toLower().hasSuffix(".sqmass"))
271  {
272  bool full_meta = false; // can lead to very large files in memory
273  bool lossy_compression = true;
274  *chromatogramConsumer = new MSDataSqlConsumer(out_chrom, run_id, 500, full_meta, lossy_compression);
275  }
276  else
277  {
278  PlainMSDataWritingConsumer * chromConsumer = new PlainMSDataWritingConsumer(out_chrom);
279  int expected_chromatograms = transition_exp.transitions.size();
280  chromConsumer->setExpectedSize(0, expected_chromatograms);
281  chromConsumer->setExperimentalSettings(*exp_meta);
282  chromConsumer->getOptions().setWriteIndex(true); // ensure that we write the index
284 
285  // prepare data structures for lossy compression
287  MSNumpressCoder::NumpressConfig npconfig_int;
288  npconfig_mz.estimate_fixed_point = true; // critical
289  npconfig_int.estimate_fixed_point = true; // critical
290  npconfig_mz.numpressErrorTolerance = -1.0; // skip check, faster
291  npconfig_int.numpressErrorTolerance = -1.0; // skip check, faster
292  npconfig_mz.setCompression("linear");
293  npconfig_int.setCompression("slof");
294  npconfig_mz.linear_fp_mass_acc = 0.05; // set the desired RT accuracy in seconds
295 
296  chromConsumer->getOptions().setNumpressConfigurationMassTime(npconfig_mz);
297  chromConsumer->getOptions().setNumpressConfigurationIntensity(npconfig_int);
298  chromConsumer->getOptions().setCompression(true);
299 
300  *chromatogramConsumer = chromConsumer;
301  }
302  }
303  else
304  {
305  *chromatogramConsumer = new NoopMSDataWritingConsumer("");
306  }
307  }
308 
318  const String& tr_file,
319  const Param& tsv_reader_param)
320  {
321  OpenSwath::LightTargetedExperiment transition_exp;
322  ProgressLogger progresslogger;
323  progresslogger.setLogType(log_type_);
324  if (tr_type == FileTypes::TRAML)
325  {
326  progresslogger.startProgress(0, 1, "Load TraML file");
327  TargetedExperiment targeted_exp;
328  TraMLFile().load(tr_file, targeted_exp);
329  OpenSwathDataAccessHelper::convertTargetedExp(targeted_exp, transition_exp);
330  progresslogger.endProgress();
331  }
332  else if (tr_type == FileTypes::PQP)
333  {
334  progresslogger.startProgress(0, 1, "Load PQP file");
335  TransitionPQPFile().convertPQPToTargetedExperiment(tr_file.c_str(), transition_exp);
336  progresslogger.endProgress();
337  }
338  else if (tr_type == FileTypes::TSV)
339  {
340  progresslogger.startProgress(0, 1, "Load TSV file");
341  TransitionTSVFile tsv_reader;
342  tsv_reader.setParameters(tsv_reader_param);
343  tsv_reader.convertTSVToTargetedExperiment(tr_file.c_str(), tr_type, transition_exp);
344  progresslogger.endProgress();
345  }
346  else
347  {
348  OPENMS_LOG_ERROR << "Provide valid TraML, TSV or PQP transition file." << std::endl;
349  throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Need to provide valid input file.");
350  }
351  return transition_exp;
352  }
353 
387  String irt_tr_file,
388  std::vector< OpenSwath::SwathMap > & swath_maps,
389  double min_rsq,
390  double min_coverage,
391  const Param& feature_finder_param,
392  const ChromExtractParams& cp_irt,
393  const Param& irt_detection_param,
394  const Param& calibration_param,
395  Size debug_level,
396  bool sonar,
397  bool load_into_memory,
398  const String& irt_trafo_out,
399  const String& irt_mzml_out)
400  {
401  TransformationDescription trafo_rtnorm;
402 
403  if (!trafo_in.empty())
404  {
405  // get read RT normalization file
406  TransformationXMLFile trafoxml;
407  trafoxml.load(trafo_in, trafo_rtnorm, false);
408  Param model_params = getParam_().copy("model:", true);
409  model_params.setValue("symmetric_regression", "false");
410  model_params.setValue("span", irt_detection_param.getValue("lowess:span"));
411  model_params.setValue("num_nodes", irt_detection_param.getValue("b_spline:num_nodes"));
412  String model_type = irt_detection_param.getValue("alignmentMethod").toString();
413  trafo_rtnorm.fitModel(model_type, model_params);
414  }
415  else if (!irt_tr_file.empty())
416  {
417  // Loading iRT file
418  std::cout << "Will load iRT transitions and try to find iRT peptides" << std::endl;
419  TraMLFile traml;
420  FileTypes::Type tr_type = FileHandler::getType(irt_tr_file);
421  Param tsv_reader_param = TransitionTSVFile().getDefaults();
422  OpenSwath::LightTargetedExperiment irt_transitions = loadTransitionList(tr_type, irt_tr_file, tsv_reader_param);
423 
424  // perform extraction
426  wf.setLogType(log_type_);
427  TransformationDescription im_trafo;
428  trafo_rtnorm = wf.performRTNormalization(irt_transitions, swath_maps, im_trafo,
429  min_rsq, min_coverage,
430  feature_finder_param,
431  cp_irt, irt_detection_param,
432  calibration_param, irt_mzml_out, debug_level, sonar,
433  load_into_memory);
434 
435  if (!irt_trafo_out.empty())
436  {
437  TransformationXMLFile().store(irt_trafo_out, trafo_rtnorm);
438  }
439  }
440  return trafo_rtnorm;
441  }
442 
443 
444 };
445 
446 }
447 
449 
450 
LogStream.h
OpenMS::TransitionTSVFile::validateTargetedExperiment
void validateTargetedExperiment(const OpenMS::TargetedExperiment &targeted_exp)
Validate a TargetedExperiment (check that all ids are unique)
OpenMS::UniqueIdInterface::ensureUniqueId
Size ensureUniqueId()
Assigns a valid unique id, but only if the present one is invalid. Returns 1 if the unique id was cha...
OpenMS::TransitionTSVFile
This class supports reading and writing of OpenSWATH transition lists.
Definition: TransitionTSVFile.h:144
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:147
OpenMS::TransitionPQPFile
This class supports reading and writing of PQP files.
Definition: TransitionPQPFile.h:215
OpenMS::FileTypes::SQMASS
SqLite format for mass and chromatograms, see SqMassFile.
Definition: FileTypes.h:101
FileHandler.h
FileTypes.h
OpenMS::SwathFile::loadSplit
std::vector< OpenSwath::SwathMap > loadSplit(StringList file_list, String tmp, boost::shared_ptr< ExperimentalSettings > &exp_meta, String readoptions="normal")
Loads a Swath run from a list of split mzML files.
OpenMS::TOPPBase::log_type_
ProgressLogger::LogType log_type_
Type of progress logging.
Definition: TOPPBase.h:934
OpenMS::TraMLFile::store
void store(const String &filename, const TargetedExperiment &id) const
Stores a map in a TraML file.
MapType
PeakMap MapType
Definition: PeakPickerIterative.cpp:84
Size
OpenMS::MSNumpressCoder::NumpressConfig::linear_fp_mass_acc
double linear_fp_mass_acc
Desired mass accuracy for *linear* encoding.
Definition: MSNumpressCoder.h:131
OpenMS::UInt64
OPENMS_UINT64_TYPE UInt64
Unsigned integer type (64bit)
Definition: Types.h:77
OpenMS::MSNumpressCoder::NumpressConfig::setCompression
void setCompression(const std::string &compression)
Set compression using a string mapping to enum NumpressCompression.
Definition: MSNumpressCoder.h:149
OpenMS::Param::setValue
void setValue(const std::string &key, const ParamValue &value, const std::string &description="", const std::vector< std::string > &tags=std::vector< std::string >())
Sets a value.
OpenMS::Exception::IllegalArgument
A method or algorithm argument contains illegal values.
Definition: Exception.h:648
OpenMS::ModificationsDB::initializeModificationsDB
static ModificationsDB * initializeModificationsDB(OpenMS::String unimod_file="CHEMISTRY/unimod.xml", OpenMS::String psimod_file="CHEMISTRY/PSI-MOD.obo", OpenMS::String xlmod_file="CHEMISTRY/XLMOD.obo")
Initializes the modification DB with non-default modification files (can only be done once)
TransitionTSVFile.h
OpenSwathWorkflow.h
SwathMap.h
OpenMS::Interfaces::IMSDataConsumer
The interface of a consumer of spectra and chromatograms.
Definition: IMSDataConsumer.h:69
OpenMS::FileHandler::getTypeByFileName
static FileTypes::Type getTypeByFileName(const String &filename)
Determines the file type from a file name.
OpenMS::MRMFeatureFinderScoring
The MRMFeatureFinder finds and scores peaks of transitions that co-elute.
Definition: MRMFeatureFinderScoring.h:89
SwathMapMassCorrection.h
OpenMS::FileTypes::MRM
SpectraST MRM List.
Definition: FileTypes.h:100
OpenMS::FileTypes::MZML
MzML file (.mzML)
Definition: FileTypes.h:70
OpenMS::FileTypes::MZXML
MzXML file (.mzXML)
Definition: FileTypes.h:62
OpenMS::OpenSwathCalibrationWorkflow::performRTNormalization
TransformationDescription performRTNormalization(const OpenSwath::LightTargetedExperiment &irt_transitions, std::vector< OpenSwath::SwathMap > &swath_maps, TransformationDescription &im_trafo, double min_rsq, double min_coverage, const Param &feature_finder_param, const ChromExtractParams &cp_irt, const Param &irt_detection_param, const Param &calibration_param, const String &irt_mzml_out, Size debug_level, bool sonar=false, bool load_into_memory=false)
Perform RT and m/z correction of the input data using RT-normalization peptides.
OpenMS::MSNumpressCoder::NumpressConfig::estimate_fixed_point
bool estimate_fixed_point
Whether to estimate the fixed point used for encoding (highly recommended)
Definition: MSNumpressCoder.h:123
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:57
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::TOPPOpenSwathBase::TOPPOpenSwathBase
TOPPOpenSwathBase(String name, String description, bool official=true)
Definition: OpenSwathBase.h:90
OpenMS::Exception::Precondition
Precondition failed exception.
Definition: Exception.h:157
MSDataSqlConsumer.h
OpenMS::TOPPOpenSwathBase::loadSwathFiles
bool loadSwathFiles(const StringList &file_list, boost::shared_ptr< ExperimentalSettings > &exp_meta, std::vector< OpenSwath::SwathMap > &swath_maps, const bool split_file, const String &tmp, const String &readoptions, const String &swath_windows_file, const double min_upper_edge_dist, const bool force, const bool sort_swath_maps, const bool sonar, const bool prm, const bool pasef, Interfaces::IMSDataConsumer *plugin_consumer=nullptr)
Load the DIA files into internal data structures.
Definition: OpenSwathBase.h:162
MzMLFile.h
Int
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
SimpleOpenMSSpectraAccessFactory.h
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
FeatureXMLFile.h
OpenMS::ListUtils::contains
static bool contains(const std::vector< T > &container, const E &elem)
Checks whether the element elem is contained in the given container.
Definition: ListUtils.h:162
OpenMS::PeakFileOptions::setNumpressConfigurationMassTime
void setNumpressConfigurationMassTime(MSNumpressCoder::NumpressConfig config)
Get numpress configuration options for m/z or rt dimension.
OpenMS::OpenSwathHelper::checkSwathMapAndSelectTransitions
static bool checkSwathMapAndSelectTransitions(const OpenMS::PeakMap &exp, const TargetedExperimentT &targeted_exp, TargetedExperimentT &selected_transitions, double min_upper_edge_dist)
Check the map and select transition in one function.
Definition: OpenSwathHelper.h:160
OpenMS::MRMAssay::reannotateTransitions
void reannotateTransitions(OpenMS::TargetedExperiment &exp, double precursor_mz_threshold, double product_mz_threshold, const std::vector< String > &fragment_types, const std::vector< size_t > &fragment_charges, bool enable_specific_losses, bool enable_unspecific_losses, int round_decPow=-4)
Annotates and filters transitions in a TargetedExperiment.
OpenMS::TraMLFile::load
void load(const String &filename, TargetedExperiment &id)
Loads a map from a TraML file.
OpenMS::TOPPOpenSwathBase
Definition: OpenSwathBase.h:84
OpenMS::FileTypes::TSV
any TSV file, for example msInspect file or OpenSWATH transition file (see TransitionTSVFile)
Definition: FileTypes.h:86
OpenMS::NoopMSDataWritingConsumer
Consumer class that perform no operation.
Definition: MSDataWritingConsumer.h:258
OpenMS::TransitionTSVFile::convertTargetedExperimentToTSV
void convertTargetedExperimentToTSV(const char *filename, OpenMS::TargetedExperiment &targeted_exp)
Write out a targeted experiment (TraML structure) into a tsv file.
OpenMS::Internal::MzMLHandler::getOptions
PeakFileOptions & getOptions()
Get the peak file options.
OpenMS::ModificationsDB
database which holds all residue modifications from UniMod
Definition: ModificationsDB.h:75
OpenMS::ProgressLogger::startProgress
void startProgress(SignedSize begin, SignedSize end, const String &label) const
Initializes the progress display.
ChromatogramExtractor.h
OpenMS::ChromExtractParams
ChromatogramExtractor parameters.
Definition: OpenSwathWorkflow.h:82
SpectrumAccessOpenMS.h
OpenMS::FileTypes::UNKNOWN
Unknown file extension.
Definition: FileTypes.h:58
OPENMS_LOG_WARN
#define OPENMS_LOG_WARN
Macro if a warning, a piece of information which should be read by the user, should be logged.
Definition: LogStream.h:460
OpenSwath::LightTargetedExperiment
Definition: TransitionExperiment.h:218
OpenMS::MRMAssay::uisTransitions
void uisTransitions(OpenMS::TargetedExperiment &exp, const std::vector< String > &fragment_types, const std::vector< size_t > &fragment_charges, bool enable_specific_losses, bool enable_unspecific_losses, bool enable_ms2_precursors, double mz_threshold, const std::vector< std::pair< double, double > > &swathes, int round_decPow=-4, size_t max_num_alternative_localizations=20, int shuffle_seed=-1, bool disable_decoy_transitions=false)
Annotate UIS / site-specific transitions.
OpenMS::ProteinIdentification
Representation of a protein identification run.
Definition: ProteinIdentification.h:70
OpenMS::ProgressLogger::endProgress
void endProgress() const
Ends the progress display.
OpenMS::MSDataWritingConsumer::setExperimentalSettings
void setExperimentalSettings(const ExperimentalSettings &exp) override
Set experimental settings for the whole file.
OpenMS::MSNumpressCoder::NumpressConfig::numpressErrorTolerance
double numpressErrorTolerance
Check error tolerance after encoding.
Definition: MSNumpressCoder.h:108
OpenMS::TOPPOpenSwathBase::loadSwathFiles_
void loadSwathFiles_(const StringList &file_list, const bool split_file, const String &tmp, const String &readoptions, boost::shared_ptr< ExperimentalSettings > &exp_meta, std::vector< OpenSwath::SwathMap > &swath_maps, Interfaces::IMSDataConsumer *plugin_consumer)
Definition: OpenSwathBase.h:97
ListUtils.h
OpenMS::MRMFeatureFinderScoring::TransitionGroupMapType
std::map< String, MRMTransitionGroupType > TransitionGroupMapType
Definition: MRMFeatureFinderScoring.h:105
OpenMS::SwathWindowLoader::readSwathWindows
static void readSwathWindows(const std::string &filename, std::vector< double > &swath_prec_lower, std::vector< double > &swath_prec_upper)
Reading a tab delimited file specifying the SWATH windows.
OpenMS::TransformationDescription::fitModel
void fitModel(const String &model_type, const Param &params=Param())
Fits a model to the data.
OpenMS::OpenSwathDataAccessHelper::convertTargetedExp
static void convertTargetedExp(const OpenMS::TargetedExperiment &transition_exp_, OpenSwath::LightTargetedExperiment &transition_exp)
convert from the OpenMS TargetedExperiment to the LightTargetedExperiment
OpenMS::Exception::InvalidParameter
Exception indicating that an invalid parameter was handed over to an algorithm.
Definition: Exception.h:339
SwathWindowLoader.h
OpenSwathHelper.h
OpenMS::MRMFeatureFinderScoring::pickExperiment
void pickExperiment(const PeakMap &chromatograms, FeatureMap &output, const TargetedExperiment &transition_exp, const TransformationDescription &trafo, const PeakMap &swath_map)
Picker and prepare functions.
SwathFile.h
OpenMS::ModificationsDB::isInstantiated
static bool isInstantiated()
Check whether ModificationsDB was instantiated before.
SpectrumAccessOpenMSInMemory.h
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::TraMLFile
File adapter for HUPO PSI TraML files.
Definition: TraMLFile.h:63
OpenMS::PeakFileOptions::setNumpressConfigurationIntensity
void setNumpressConfigurationIntensity(MSNumpressCoder::NumpressConfig config)
Get numpress configuration options for intensity dimension.
MRMAssay.h
Exception.h
MRMRTNormalizer.h
OpenMS::ProgressLogger
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:52
ProgressLogger.h
OpenMS::MzMLFile::load
void load(const String &filename, PeakMap &map)
Loads a map from a MzML file. Spectra and chromatograms are sorted by default (this can be disabled u...
MRMFeatureFinderScoring.h
TransformationXMLFile.h
OpenMS::MSDataSqlConsumer
A data consumer that inserts MS data into a SQLite database.
Definition: MSDataSqlConsumer.h:60
OpenMS::TransformationDescription::getModelTypes
static void getModelTypes(StringList &result)
Gets the possible types of models.
OpenMS::FileHandler
Facilitates file handling by file type recognition.
Definition: FileHandler.h:66
OpenMS::MRMFeatureFinderScoring::setStrictFlag
void setStrictFlag(bool f)
Set the flag for strict mapping.
Definition: MRMFeatureFinderScoring.h:193
OpenMS::FileTypes::Type
Type
Actual file types enum.
Definition: FileTypes.h:56
MathFunctions.h
SpectrumAccessTransforming.h
OPENMS_LOG_DEBUG
#define OPENMS_LOG_DEBUG
Macro for general debugging information.
Definition: LogStream.h:470
OpenMS::MRMAssay::detectingTransitions
void detectingTransitions(OpenMS::TargetedExperiment &exp, int min_transitions, int max_transitions)
Select detecting fragment ions.
OpenMS::FileHandler::getType
static FileTypes::Type getType(const String &filename)
Tries to determine the file type (by name or content)
OpenMS::Math::round
T round(T x)
Rounds the value.
Definition: MathFunctions.h:166
OpenMS::TOPPBase::getParam_
Param const & getParam_() const
Return all parameters relevant to this TOPP tool.
OpenMS::String::split
bool split(const char splitter, std::vector< String > &substrings, bool quote_protect=false) const
Splits a string into substrings using splitter as delimiter.
OpenMS::DefaultParamHandler::setParameters
void setParameters(const Param &param)
Sets the parameters.
OpenMS::DefaultParamHandler::getDefaults
const Param & getDefaults() const
Non-mutable access to the default parameters.
OpenMS::String::hasSuffix
bool hasSuffix(const String &string) const
true if String ends with string, false otherwise
OpenMS::SimpleOpenMSSpectraFactory::getSpectrumAccessOpenMSPtr
static OpenSwath::SpectrumAccessPtr getSpectrumAccessOpenMSPtr(boost::shared_ptr< OpenMS::PeakMap > exp)
Simple Factory method to get a SpectrumAccess Ptr from an MSExperiment.
OpenMS::OpenSwathCalibrationWorkflow
Execute all steps for retention time and m/z calibration of SWATH-MS data.
Definition: OpenSwathWorkflow.h:254
OpenMS::TransitionPQPFile::convertPQPToTargetedExperiment
void convertPQPToTargetedExperiment(const char *filename, OpenMS::TargetedExperiment &targeted_exp, bool legacy_traml_id=false)
Read in a PQP file and construct a targeted experiment (TraML structure)
OpenSwath::LightTargetedExperiment::transitions
std::vector< LightTransition > transitions
Definition: TransitionExperiment.h:227
OpenMS::TOPPBase::getProcessingInfo_
DataProcessing getProcessingInfo_(DataProcessing::ProcessingAction action) const
Returns the data processing information.
OpenMS::StringList
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
OpenMS::FeatureXMLFile::store
void store(const String &filename, const FeatureMap &feature_map)
stores the map feature_map in file with name filename.
OpenMS::TransitionTSVFile::convertTSVToTargetedExperiment
void convertTSVToTargetedExperiment(const char *filename, FileTypes::Type filetype, OpenMS::TargetedExperiment &targeted_exp)
Read in a tsv/mrm file and construct a targeted experiment (TraML structure)
OpenMS::TOPPOpenSwathBase::performCalibration
TransformationDescription performCalibration(String trafo_in, String irt_tr_file, 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 Param &calibration_param, Size debug_level, bool sonar, bool load_into_memory, const String &irt_trafo_out, const String &irt_mzml_out)
Perform retention time and m/z calibration.
Definition: OpenSwathBase.h:386
ModificationsDB.h
OpenMS::MRMAssay::restrictTransitions
void restrictTransitions(OpenMS::TargetedExperiment &exp, double lower_mz_limit, double upper_mz_limit, const std::vector< std::pair< double, double > > &swathes)
Restrict and filter transitions in a TargetedExperiment.
OpenMS::ParamValue::toString
std::string toString(bool full_precision=true) const
Convert ParamValue to string.
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:71
OpenMS::DataProcessing::SMOOTHING
Smoothing of the signal to reduce noise.
Definition: DataProcessing.h:63
MSExperiment.h
DataAccessHelper.h
OpenMS::SignedSize
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
OpenMS::MSDataWritingConsumer::setExpectedSize
void setExpectedSize(Size expectedSpectra, Size expectedChromatograms) override
Set expected size of spectra and chromatograms to be written.
OpenMS::TOPPOpenSwathBase::loadTransitionList
OpenSwath::LightTargetedExperiment loadTransitionList(const FileTypes::Type &tr_type, const String &tr_file, const Param &tsv_reader_param)
Loads transition list from TraML / TSV or PQP.
Definition: OpenSwathBase.h:317
OpenMS::TransformationXMLFile::load
void load(const String &filename, TransformationDescription &transformation, bool fit_model=true)
Loads the transformation from an TransformationXML file.
OPENMS_LOG_ERROR
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
OpenMS::FeatureMap
A container for features.
Definition: FeatureMap.h:98
OpenMS::FileTypes::PQP
OpenSWATH Peptide Query Parameter (PQP) SQLite DB, see TransitionPQPFile.
Definition: FileTypes.h:102
OpenMS::TransformationXMLFile
Used to load and store TransformationXML files.
Definition: TransformationXMLFile.h:56
AASequence.h
OpenMS::MSDataWritingConsumer::addDataProcessing
virtual void addDataProcessing(DataProcessing d)
Optionally add a data processing method to each chromatogram and spectrum.
OpenMS::Feature
An LC-MS feature.
Definition: Feature.h:70
OpenMS::PlainMSDataWritingConsumer
Consumer class that writes MS data to disk using the mzML format.
Definition: MSDataWritingConsumer.h:240
OpenMS::Param::copy
Param copy(const std::string &prefix, bool remove_prefix=false) const
Returns a new Param object containing all entries that start with prefix.
OpenSwath::SpectrumAccessPtr
boost::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:87
OpenMS::FeatureXMLFile
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:62
OpenMS::SwathFile::loadMzML
std::vector< OpenSwath::SwathMap > loadMzML(const String &file, const String &tmp, boost::shared_ptr< ExperimentalSettings > &exp_meta, const String &readoptions="normal", Interfaces::IMSDataConsumer *plugin_consumer=nullptr)
Loads a Swath run from a single mzML file.
OpenMS::DataProcessing::QUANTITATION
Quantitation.
Definition: DataProcessing.h:72
OpenMS::PeakFileOptions::setCompression
void setCompression(bool compress)
MRMTransitionGroupPicker.h
OpenMS::SwathFile
File adapter for Swath files.
Definition: SwathFile.h:67
OpenMS::FileTypes::nameToType
static Type nameToType(const String &name)
OpenSwathOSWWriter.h
OpenMS::MSNumpressCoder::NumpressConfig
Configuration class for MSNumpress.
Definition: MSNumpressCoder.h:88
OpenMS::TransitionPQPFile::convertTargetedExperimentToPQP
void convertTargetedExperimentToPQP(const char *filename, OpenMS::TargetedExperiment &targeted_exp)
Write out a targeted experiment (TraML structure) into a PQP file.
OpenMS::FileTypes::TRAML
TraML (HUPO PSI format) for transitions (.traML)
Definition: FileTypes.h:80
OpenMS::SwathFile::loadMzXML
std::vector< OpenSwath::SwathMap > loadMzXML(String file, String tmp, boost::shared_ptr< ExperimentalSettings > &exp_meta, String readoptions="normal")
Loads a Swath run from a single mzXML file.
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:69
OpenMS::ModificationsDB::getNumberOfModifications
Size getNumberOfModifications() const
Returns the number of modifications read from the unimod.xml file.
OpenMS::TransformationXMLFile::store
void store(String filename, const TransformationDescription &transformation)
Stores the data in an TransformationXML file.
OpenMS::TargetedExperiment
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:64
OPENMS_LOG_INFO
#define OPENMS_LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:465
TransitionPQPFile.h
OpenMS::SwathWindowLoader::annotateSwathMapsFromFile
static void annotateSwathMapsFromFile(const std::string &filename, std::vector< OpenSwath::SwathMap > &swath_maps, bool do_sort, bool force)
Annotate a Swath map using a Swath window file specifying the individual windows.
OpenMS::PeakFileOptions::setWriteIndex
void setWriteIndex(bool write_index)
Whether to write an index at the end of the file (e.g. indexedmzML file format)
OpenMS::MRMAssay
Generate assays from a TargetedExperiment.
Definition: MRMAssay.h:66
OpenMS::TOPPOpenSwathBase::prepareChromOutput
void prepareChromOutput(Interfaces::IMSDataConsumer **chromatogramConsumer, const boost::shared_ptr< ExperimentalSettings > &exp_meta, const OpenSwath::LightTargetedExperiment &transition_exp, const String &out_chrom, const UInt64 run_id)
Prepare chromatogram output.
Definition: OpenSwathBase.h:261
MSDataWritingConsumer.h
OpenMS::SwathFile::loadSqMass
std::vector< OpenSwath::SwathMap > loadSqMass(String file, boost::shared_ptr< ExperimentalSettings > &)
Loads a Swath run from a single sqMass file.
OpenMS::Param::getValue
const ParamValue & getValue(const std::string &key) const
Returns a value of a parameter.
OpenSwathTSVWriter.h
TraMLFile.h
OpenMS::TransformationDescription
Generic description of a coordinate transformation.
Definition: TransformationDescription.h:62
OpenMS::ProgressLogger::setLogType
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
TOPPBase.h
OpenMS::FeatureMap::getProteinIdentifications
const std::vector< ProteinIdentification > & getProteinIdentifications() const
OpenMS::FileTypes::typeToName
static String typeToName(Type type)
Returns the name/extension of the type.
OpenMS::String::toLower
String & toLower()
Converts the string to lowercase.
OpenMS::ProgressLogger::CMD
Command line progress.
Definition: ProgressLogger.h:70