|
OpenMS
2.5.0
|
Go to the documentation of this file.
94 TOPPBase(name, description, official)
101 const bool split_file,
103 const String& readoptions,
104 boost::shared_ptr<ExperimentalSettings > & exp_meta,
105 std::vector< OpenSwath::SwathMap > & swath_maps,
111 if (split_file || file_list.size() > 1)
114 swath_maps = swath_file.
loadSplit(file_list, tmp, exp_meta, readoptions);
121 swath_maps = swath_file.
loadMzML(file_list[0], tmp, exp_meta, readoptions, plugin_consumer);
125 swath_maps = swath_file.
loadMzXML(file_list[0], tmp, exp_meta, readoptions);
129 swath_maps = swath_file.
loadSqMass(file_list[0], exp_meta);
134 "Input file needs to have ending mzML or mzXML");
166 boost::shared_ptr<ExperimentalSettings >& exp_meta,
167 std::vector< OpenSwath::SwathMap >& swath_maps,
168 const bool split_file,
170 const String& readoptions,
171 const String& swath_windows_file,
172 const double min_upper_edge_dist,
174 const bool sort_swath_maps,
180 loadSwathFiles_(file_list, split_file, tmp, readoptions, exp_meta, swath_maps, plugin_consumer);
183 if (!swath_windows_file.empty())
188 for (
Size i = 0; i < swath_maps.size(); i++)
191 <<
" with lower " << swath_maps[i].lower
192 <<
" and upper " << swath_maps[i].upper
193 <<
" and " << swath_maps[i].sptr->getNrSpectra()
194 <<
" spectra." << std::endl;
198 std::vector<std::pair<double, double>> sw_windows;
199 for (
Size i = 0; i < swath_maps.size(); i++)
201 if (!swath_maps[i].ms1)
203 sw_windows.push_back(std::make_pair(swath_maps[i].lower, swath_maps[i].upper));
207 std::sort(sw_windows.begin(), sw_windows.end());
209 for (
Size i = 1; i < sw_windows.size(); i++)
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;
217 if (upper_map_start - lower_map_end > 0.01)
219 OPENMS_LOG_WARN <<
"Extraction will have a gap between " << lower_map_end <<
" and " << upper_map_start << std::endl;
222 OPENMS_LOG_ERROR <<
"Extraction windows have a gap. Will abort (override with -force)" << std::endl;
227 if (sonar) {
continue;}
229 if (lower_map_end - upper_map_start > 0.01)
231 OPENMS_LOG_WARN <<
"Extraction will overlap between " << lower_map_end <<
" and " << upper_map_start <<
"!\n"
232 <<
"This will lead to multiple extraction of the transitions in the overlapping region "
233 <<
"which will lead to duplicated output. It is very unlikely that you want this." <<
"\n"
234 <<
"Please fix this by providing an appropriate extraction file with -swath_windows_file" << std::endl;
237 OPENMS_LOG_ERROR <<
"Extraction windows overlap. Will abort (override with -force)" << std::endl;
259 const boost::shared_ptr<ExperimentalSettings>& exp_meta,
263 if (!out_chrom.empty())
268 bool full_meta =
false;
269 bool lossy_compression =
true;
270 *chromatogramConsumer =
new MSDataSqlConsumer(out_chrom, 500, full_meta, lossy_compression);
275 int expected_chromatograms = transition_exp.
transitions.size();
296 *chromatogramConsumer = chromConsumer;
315 const Param& tsv_reader_param)
344 OPENMS_LOG_ERROR <<
"Provide valid TraML, TSV or PQP transition file." << std::endl;
347 return transition_exp;
384 std::vector< OpenSwath::SwathMap > & swath_maps,
387 const Param& feature_finder_param,
389 const Param& irt_detection_param,
390 const Param& calibration_param,
393 bool load_into_memory,
394 const String& irt_trafo_out,
395 const String& irt_mzml_out)
399 if (!trafo_in.empty())
403 trafoxml.
load(trafo_in, trafo_rtnorm,
false);
405 model_params.
setValue(
"symmetric_regression",
"false");
407 model_params.
setValue(
"num_nodes", irt_detection_param.
getValue(
"b_spline:num_nodes"));
408 String model_type = irt_detection_param.
getValue(
"alignmentMethod");
409 trafo_rtnorm.
fitModel(model_type, model_params);
411 else if (!irt_tr_file.empty())
414 std::cout <<
"Will load iRT transitions and try to find iRT peptides" << std::endl;
425 min_rsq, min_coverage,
426 feature_finder_param,
427 cp_irt, irt_detection_param,
428 calibration_param, irt_mzml_out, debug_level, sonar,
431 if (!irt_trafo_out.empty())
PeakFileOptions & getOptions()
Get the peak file options.
std::map< String, MRMTransitionGroupType > TransitionGroupMapType
Definition: MRMFeatureFinderScoring.h:109
ChromatogramExtractor parameters.
Definition: OpenSwathWorkflow.h:82
static void convertTargetedExp(const OpenMS::TargetedExperiment &transition_exp_, OpenSwath::LightTargetedExperiment &transition_exp)
convert from the OpenMS TargetedExperiment to the LightTargetedExperiment
Management and storage of parameters / INI files.
Definition: Param.h:73
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:100
static FileTypes::Type getTypeByFileName(const String &filename)
Determines the file type from a file name.
void load(const String &filename, TransformationDescription &transformation, bool fit_model=true)
Loads the transformation from an TransformationXML file.
void setValue(const String &key, const DataValue &value, const String &description="", const StringList &tags=StringList())
Sets a value.
void store(const String &filename, const TargetedExperiment &id) const
Stores a map in a TraML file.
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:68
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
OpenSWATH Peptide Query Parameter (PQP) SQLite DB, see TransitionPQPFile.
Definition: FileTypes.h:104
Param const & getParam_() const
Return all parameters relevant to this TOPP tool.
void fitModel(const String &model_type, const Param ¶ms=Param())
Fits a model to the data.
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
A method or algorithm argument contains illegal values.
Definition: Exception.h:648
SpectraST MRM List.
Definition: FileTypes.h:102
Consumer class that writes MS data to disk using the mzML format.
Definition: MSDataWritingConsumer.h:240
void setExpectedSize(Size expectedSpectra, Size expectedChromatograms) override
Set expected size of spectra and chromatograms to be written.
void setNumpressConfigurationMassTime(MSNumpressCoder::NumpressConfig config)
Get numpress configuration options for m/z or rt dimension.
Size getNumberOfModifications() const
Returns the number of modifications read from the unimod.xml file.
#define OPENMS_LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:465
TOPPOpenSwathBase(String name, String description, bool official=true)
Definition: OpenSwathBase.h:93
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.
void setExperimentalSettings(const ExperimentalSettings &exp) override
Set experimental settings for the whole file.
void convertTargetedExperimentToPQP(const char *filename, OpenMS::TargetedExperiment &targeted_exp)
Write out a targeted experiment (TraML structure) into a PQP file.
Configuration class for MSNumpress.
Definition: MSNumpressCoder.h:87
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:146
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)
DataProcessing getProcessingInfo_(DataProcessing::ProcessingAction action) const
Returns the data processing information.
void store(const String &filename, const FeatureMap &feature_map)
stores the map feature_map in file with name filename.
Definition: TransitionExperiment.h:207
static bool isInstantiated()
Check whether ModificationsDB was instantiated before.
void load(const String &filename, TargetedExperiment &id)
Loads a map from a TraML file.
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.
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
Generic description of a coordinate transformation.
Definition: TransformationDescription.h:61
any TSV file, for example msInspect file or OpenSWATH transition file (see TransitionTSVFile)
Definition: FileTypes.h:87
Exception indicating that an invalid parameter was handed over to an algorithm.
Definition: Exception.h:347
void setNumpressConfigurationIntensity(MSNumpressCoder::NumpressConfig config)
Get numpress configuration options for intensity dimension.
double numpressErrorTolerance
Check error tolerance after encoding.
Definition: MSNumpressCoder.h:107
A container for features.
Definition: FeatureMap.h:95
Precondition failed exception.
Definition: Exception.h:166
MzML file (.mzML)
Definition: FileTypes.h:72
static String typeToName(Type type)
Returns the name/extension of the type.
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.
Generate assays from a TargetedExperiment.
Definition: MRMAssay.h:68
This class supports reading and writing of OpenSWATH transition lists.
Definition: TransitionTSVFile.h:144
static void getModelTypes(StringList &result)
Gets the possible types of models.
Base class for TOPP applications.
Definition: TOPPBase.h:144
Execute all steps for retention time and m/z calibration of SWATH-MS data.
Definition: OpenSwathWorkflow.h:235
void validateTargetedExperiment(const OpenMS::TargetedExperiment &targeted_exp)
Validate a TargetedExperiment (check that all ids are unique)
The MRMFeatureFinder finds and scores peaks of transitions that co-elute.
Definition: MRMFeatureFinderScoring.h:93
Definition: OpenSwathBase.h:87
MzXML file (.mzXML)
Definition: FileTypes.h:64
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
database which holds all residue modifications from UniMod
Definition: ModificationsDB.h:73
File adapter for HUPO PSI TraML files.
Definition: TraMLFile.h:63
const DataValue & getValue(const String &key) const
Returns a value of a parameter.
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:54
The interface of a consumer of spectra and chromatograms.
Definition: IMSDataConsumer.h:69
Quantitation.
Definition: DataProcessing.h:72
File adapter for Swath files.
Definition: SwathFile.h:67
Unknown file extension.
Definition: FileTypes.h:60
Size ensureUniqueId()
Assigns a valid unique id, but only if the present one is invalid. Returns 1 if the unique id was cha...
Definition: UniqueIdInterface.h:154
void endProgress() const
Ends the progress display.
double linear_fp_mass_acc
Desired mass accuracy for *linear* encoding.
Definition: MSNumpressCoder.h:130
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
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:313
Command line progress.
Definition: ProgressLogger.h:72
T round(T x)
Rounds the value.
Definition: MathFunctions.h:138
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.
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.
Consumer class that perform no operation.
Definition: MSDataWritingConsumer.h:258
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.
bool hasSuffix(const String &string) const
true if String ends with string, false otherwise
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, Interfaces::IMSDataConsumer *plugin_consumer=nullptr)
Load the DIA files into internal data structures.
Definition: OpenSwathBase.h:165
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:382
void setParameters(const Param ¶m)
Sets the parameters.
void setCompression(bool compress)
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.
#define OPENMS_LOG_DEBUG
Macro for general debugging information.
Definition: LogStream.h:470
static FileTypes::Type getType(const String &filename)
Tries to determine the file type (by name or content)
void detectingTransitions(OpenMS::TargetedExperiment &exp, int min_transitions, int max_transitions)
Select detecting fragment ions.
void pickExperiment(PeakMap &chromatograms, FeatureMap &output, TargetedExperiment &transition_exp, TransformationDescription trafo, PeakMap &swath_map)
Picker and prepare functions.
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
Param copy(const String &prefix, bool remove_prefix=false) const
Returns a new Param object containing all entries that start with prefix.
const Param & getDefaults() const
Non-mutable access to the default parameters.
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)
Type
Actual file types enum.
Definition: FileTypes.h:58
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...
void prepareChromOutput(Interfaces::IMSDataConsumer **chromatogramConsumer, const boost::shared_ptr< ExperimentalSettings > &exp_meta, const OpenSwath::LightTargetedExperiment &transition_exp, const String &out_chrom)
Prepare chromatogram output.
Definition: OpenSwathBase.h:258
PeakMap MapType
Definition: PeakPickerIterative.cpp:84
boost::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:89
File adapter for MzML files.
Definition: MzMLFile.h:55
TraML (HUPO PSI format) for transitions (.traML)
Definition: FileTypes.h:81
static OpenSwath::SpectrumAccessPtr getSpectrumAccessOpenMSPtr(boost::shared_ptr< OpenMS::PeakMap > exp)
Simple Factory method to get a SpectrumAccess Ptr from an MSExperiment.
ProgressLogger::LogType log_type_
Type of progress logging.
Definition: TOPPBase.h:898
String & toLower()
Converts the string to lowercase.
A more convenient string class.
Definition: String.h:58
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
Smoothing of the signal to reduce noise.
Definition: DataProcessing.h:63
std::vector< OpenSwath::SwathMap > loadSqMass(String file, boost::shared_ptr< ExperimentalSettings > &)
Loads a Swath run from a single sqMass file.
void setWriteIndex(bool write_index)
Whether to write an index at the end of the file (e.g. indexedmzML file format)
A data consumer that inserts MS data into a SQLite database.
Definition: MSDataSqlConsumer.h:60
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
const std::vector< ProteinIdentification > & getProteinIdentifications() const
non-mutable access to the protein identifications
virtual void addDataProcessing(DataProcessing d)
Optionally add a data processing method to each chromatogram and spectrum.
#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
void setCompression(const std::string &compression)
Set compression using a string mapping to enum NumpressCompression.
Definition: MSNumpressCoder.h:148
bool estimate_fixed_point
Whether to estimate the fixed point used for encoding (highly recommended)
Definition: MSNumpressCoder.h:122
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)
void setStrictFlag(bool f)
Set the flag for strict mapping.
Definition: MRMFeatureFinderScoring.h:193
Used to load and store TransformationXML files.
Definition: TransformationXMLFile.h:56
Facilitates file handling by file type recognition.
Definition: FileHandler.h:62
void convertTargetedExperimentToTSV(const char *filename, OpenMS::TargetedExperiment &targeted_exp)
Write out a targeted experiment (TraML structure) into a tsv file.
static Type nameToType(const String &name)
Converts a file type name into a Type.
std::vector< LightTransition > transitions
Definition: TransitionExperiment.h:216
This class supports reading and writing of PQP files.
Definition: TransitionPQPFile.h:219
void store(String filename, const TransformationDescription &transformation)
Stores the data in an TransformationXML file.
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.
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:64
SqLite format for mass and chromatograms, see SqMassFile.
Definition: FileTypes.h:103
bool split(const char splitter, std::vector< String > &substrings, bool quote_protect=false) const
Splits a string into substrings using splitter as delimiter.
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.
void startProgress(SignedSize begin, SignedSize end, const String &label) const
Initializes the progress display.