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