55 template <
typename MapType>
64 std::ifstream is(filename.c_str());
65 std::vector<std::pair<double, double> > spec;
67 double pre_mz(0), pre_int(0), rt(-1);
69 while (getNextSpectrum_(is, spec, charge, pre_mz, pre_int, rt, title))
72 for (std::vector<std::pair<double, double> >::const_iterator it = spec.begin(); it != spec.end(); ++it)
77 spectrum.push_back(p);
247 bool getNextSpectrum_(std::istream & is, std::vector<std::pair<double, double> > & spectrum,
UInt & charge,
double & precursor_mz,
double & precursor_int,
double & rt,
String & title);
File not found exception.
Definition: Exception.h:474
static bool exists(const String &file)
Method used to test if a file exists.
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
void addSpectrum(const MSSpectrum &spectrum)
adds a spectrum to the list
void reset()
Clear all internal data (spectra, ranges, metadata)
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
void setMSLevel(UInt ms_level)
Sets the MS level.
void setRT(double rt)
Sets the absolute retention time (in seconds)
Mascot input file adapter.
Definition: MascotInfile.h:34
std::vector< String > mods_
fixed Modifications
Definition: MascotInfile.h:202
const String & getHits()
returns the number of hits to report back
String instrument_
the used instrument
Definition: MascotInfile.h:208
void setSearchType(const String &search_type)
sets the search type (default: MIS). So far only MIS is supported! Valid types are "MIS" (MS/MS Ion S...
const String & getMassType()
returns the used mass type ("Monoisotopic" or "Average")
const String & getSearchType()
returns the search type
const std::vector< String > & getModifications()
returns a vector containing the fixed modifications (default: none)
String taxonomy_
taxonomy
Definition: MascotInfile.h:220
void setModifications(const std::vector< String > &mods)
sets the fixed modifications (default: none). See <mascot path>/config/mod_file for possible setting...
const String & getInstrument()
returns the instrument type
void setMissedCleavages(UInt missed_cleavages)
sets the number of allowed missed cleavages (default: 1)
void setCharges(std::vector< Int > &charges)
sets the charges (default: 1+, 2+ and 3+)
void writeSpectrum_(FILE *fp, const String &filename, const PeakSpectrum &peaks)
writes the spectrum
String form_version_
form version
Definition: MascotInfile.h:223
float getPrecursorMassTolerance() const
returns the precursor mass tolerance
String search_title_
the search title of the mascot search
Definition: MascotInfile.h:184
float precursor_mass_tolerance_
precursor mass tolerance in Da
Definition: MascotInfile.h:214
String db_
the DB to search in
Definition: MascotInfile.h:187
String boundary_
the boundary used for the MIME format
Definition: MascotInfile.h:226
String mass_type_
Monoisotopic/average mass.
Definition: MascotInfile.h:199
const String & getBoundary()
returns the boundary used for the MIME format
void writeMSExperiment_(FILE *fp, const String &filename, const PeakMap &experiment)
writes the MSExperiment
const std::vector< String > & getVariableModifications()
returns a vector containing the variable modifications (default: none)
void setCleavage(const String &cleavage)
sets the enzyme used for cleavage (default: Trypsin). See <mascot path>/config/enzymes for possible ...
const String & getCleavage()
returns the enzyme used for cleavage
const String & getCharges()
returns the charges
String cleavage_
Enzyme used for cleavage.
Definition: MascotInfile.h:196
UInt missed_cleavages_
number of missed cleavages
Definition: MascotInfile.h:211
void setVariableModifications(const std::vector< String > &mods)
sets the fixed modifications (default: none). See <mascot path>/config/mod_file for possible setting...
void writeHeader_(FILE *fp)
writes the full header
String hits_
number of hits to report
Definition: MascotInfile.h:193
void setPeakMassTolerance(float ion_mass_tolerance)
sets the peak mass tolerance in Da (default: 1.0)
bool getNextSpectrum_(std::istream &is, std::vector< std::pair< double, double > > &spectrum, UInt &charge, double &precursor_mz, double &precursor_int, double &rt, String &title)
void load(const String &filename, MapType &exp)
Definition: MascotInfile.h:56
const String & getTaxonomy()
returns the taxonomy
void setBoundary(const String &boundary)
sets the boundary used for the MIME format. By default a 22 character random string is used
std::vector< String > variable_mods_
variable Modifications
Definition: MascotInfile.h:205
void setTaxonomy(const String &taxonomy)
sets the taxonomy (default: All entries). See <mascot path>/config/taxonomy for possible settings.
void store(const String &filename, const PeakMap &experiment, String search_title)
stores the experiment data in a MascotInfile that can be used as input for MASCOT shell execution
double retention_time_
the retention time
Definition: MascotInfile.h:229
float ion_mass_tolerance_
m/z tolerance of ions in Da
Definition: MascotInfile.h:217
void store(const String &filename, const PeakSpectrum &spec, double mz, double retention_time, String search_title)
stores the peak list in a MascotInfile that can be used as input for MASCOT shell execution
void setFormVersion(const String &form_version)
sets the Mascot form version (default: 1.01)
String search_type_
search type: MIS, SQ or PMF
Definition: MascotInfile.h:190
void setPrecursorMassTolerance(float precursor_mass_tolerance)
sets the precursor mass tolerance in Da (default: 2.0)
void setMassType(const String &mass_type)
sets the used mass type "Monoisotopic" or "Average" (default: Monoisotopic)
void setDB(const String &db)
sets the DB to use (default: MSDB). See <mascot path>/config/mascot.dat in "Databases" section for po...
const String & getFormVersion()
returns the Mascot form version
const String & getDB()
returns the DB to use
void writeParameterHeader_(const String &name, FILE *fp, bool line_break=true)
writes a parameter header
float getPeakMassTolerance() const
returns the peak mass tolerance in Da
UInt getMissedCleavages() const
returns the number of allowed missed cleavages
void setHits(const String &hits)
sets the number of hits to report back (default: 20)
double mz_
parent mass
Definition: MascotInfile.h:178
MascotInfile()
constructor
void setInstrument(const String &instrument)
sets the instrument type (Default: Default). Possible instruments: ESI-QUAD-TOF, MALDI-TOF-PSD,...
String charges_
charge states to use
Definition: MascotInfile.h:181
~MascotInfile() override
constructor
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:28
void setIntensity(IntensityType intensity)
Mutable access to the data point intensity (height)
Definition: Peak1D.h:84
void setPosition(PositionType const &position)
Mutable access to the position.
Definition: Peak1D.h:123
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:27
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
A more convenient string class.
Definition: String.h:34
unsigned int UInt
Unsigned integer type.
Definition: Types.h:64
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19