OpenMS
MascotInfile Class Reference

Mascot input file adapter. More...

#include <OpenMS/FORMAT/MascotInfile.h>

Inheritance diagram for MascotInfile:
[legend]
Collaboration diagram for MascotInfile:
[legend]

Public Member Functions

 MascotInfile ()
 constructor More...
 
 ~MascotInfile () override
 constructor More...
 
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 More...
 
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 More...
 
template<typename MapType >
void load (const String &filename, MapType &exp)
 
const StringgetBoundary ()
 returns the boundary used for the MIME format More...
 
void setBoundary (const String &boundary)
 sets the boundary used for the MIME format.
By default a 22 character random string is used More...
 
const StringgetDB ()
 returns the DB to use More...
 
void setDB (const String &db)
 sets the DB to use (default: MSDB). See <mascot path>/config/mascot.dat in "Databases" section for possible settings More...
 
const StringgetSearchType ()
 returns the search type More...
 
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 Search), "PMF" (Peptide Mass Fingerprint) , "SQ" (Sequence Query) More...
 
const StringgetHits ()
 returns the number of hits to report back More...
 
void setHits (const String &hits)
 sets the number of hits to report back (default: 20) More...
 
const StringgetCleavage ()
 returns the enzyme used for cleavage More...
 
void setCleavage (const String &cleavage)
 sets the enzyme used for cleavage (default: Trypsin).
See <mascot path>/config/enzymes for possible settings. More...
 
const StringgetMassType ()
 returns the used mass type ("Monoisotopic" or "Average") More...
 
void setMassType (const String &mass_type)
 sets the used mass type "Monoisotopic" or "Average" (default: Monoisotopic) More...
 
const std::vector< String > & getModifications ()
 returns a vector containing the fixed modifications (default: none) More...
 
void setModifications (const std::vector< String > &mods)
 sets the fixed modifications (default: none).
See <mascot path>/config/mod_file for possible settings. More...
 
const std::vector< String > & getVariableModifications ()
 returns a vector containing the variable modifications (default: none) More...
 
void setVariableModifications (const std::vector< String > &mods)
 sets the fixed modifications (default: none).
See <mascot path>/config/mod_file for possible settings. More...
 
const StringgetInstrument ()
 returns the instrument type More...
 
void setInstrument (const String &instrument)
 sets the instrument type (Default: Default).
Possible instruments: ESI-QUAD-TOF, MALDI-TOF-PSD, ESI-TRAP, ESI-QUAD, ESI-FTICR, MALDI-TOF-TOF, ESI-4SECTOR, FTMS-ECD, MALDI-QUAD-TOF, MALDI-QIT-TOF More...
 
UInt getMissedCleavages () const
 returns the number of allowed missed cleavages More...
 
void setMissedCleavages (UInt missed_cleavages)
 sets the number of allowed missed cleavages (default: 1) More...
 
float getPrecursorMassTolerance () const
 returns the precursor mass tolerance More...
 
void setPrecursorMassTolerance (float precursor_mass_tolerance)
 sets the precursor mass tolerance in Da (default: 2.0) More...
 
float getPeakMassTolerance () const
 returns the peak mass tolerance in Da More...
 
void setPeakMassTolerance (float ion_mass_tolerance)
 sets the peak mass tolerance in Da (default: 1.0) More...
 
const StringgetTaxonomy ()
 returns the taxonomy More...
 
void setTaxonomy (const String &taxonomy)
 sets the taxonomy (default: All entries).
See <mascot path>/config/taxonomy for possible settings. More...
 
const StringgetFormVersion ()
 returns the Mascot form version More...
 
void setFormVersion (const String &form_version)
 sets the Mascot form version (default: 1.01) More...
 
const StringgetCharges ()
 returns the charges More...
 
void setCharges (std::vector< Int > &charges)
 sets the charges (default: 1+, 2+ and 3+) More...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
virtual ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
 
LogType getLogType () const
 Returns the type of progress log being used. More...
 
void setLogger (ProgressLoggerImpl *logger)
 Sets the logger to be used for progress logging. More...
 
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
 
void setProgress (SignedSize value) const
 Sets the current progress. More...
 
void endProgress (UInt64 bytes_processed=0) const
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 

Protected Member Functions

void writeParameterHeader_ (const String &name, FILE *fp, bool line_break=true)
 writes a parameter header More...
 
void writeHeader_ (FILE *fp)
 writes the full header More...
 
void writeSpectrum_ (FILE *fp, const String &filename, const PeakSpectrum &peaks)
 writes the spectrum More...
 
void writeMSExperiment_ (FILE *fp, const String &filename, const PeakMap &experiment)
 writes the MSExperiment More...
 
bool getNextSpectrum_ (std::istream &is, std::vector< std::pair< double, double > > &spectrum, UInt &charge, double &precursor_mz, double &precursor_int, double &rt, String &title)
 

Protected Attributes

double mz_
 parent mass More...
 
String charges_
 charge states to use More...
 
String search_title_
 the search title of the mascot search More...
 
String db_
 the DB to search in More...
 
String search_type_
 search type: MIS, SQ or PMF More...
 
String hits_
 number of hits to report More...
 
String cleavage_
 Enzyme used for cleavage. More...
 
String mass_type_
 Monoisotopic/average mass. More...
 
std::vector< Stringmods_
 fixed Modifications More...
 
std::vector< Stringvariable_mods_
 variable Modifications More...
 
String instrument_
 the used instrument More...
 
UInt missed_cleavages_
 number of missed cleavages More...
 
float precursor_mass_tolerance_
 precursor mass tolerance in Da More...
 
float ion_mass_tolerance_
 m/z tolerance of ions in Da More...
 
String taxonomy_
 taxonomy More...
 
String form_version_
 form version More...
 
String boundary_
 the boundary used for the MIME format More...
 
double retention_time_
 the retention time More...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 

Additional Inherited Members

- Public Types inherited from ProgressLogger
enum  LogType { CMD , GUI , NONE }
 Possible log types. More...
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

Mascot input file adapter.

Deprecated:
Use MascotGenericFile.h instead, which uses DefaultParamHandler, is more up to date and avoids weird behaviors of this class (especially in terms of MIME boundaries when writing MGF. This class is currently only used by MascotAdapter.cpp.

Creates a file that can be used for Mascot search from a peak list or a whole experiment.

Constructor & Destructor Documentation

◆ MascotInfile()

constructor

◆ ~MascotInfile()

~MascotInfile ( )
override

constructor

Member Function Documentation

◆ getBoundary()

const String& getBoundary ( )

returns the boundary used for the MIME format

◆ getCharges()

const String& getCharges ( )

returns the charges

◆ getCleavage()

const String& getCleavage ( )

returns the enzyme used for cleavage

◆ getDB()

const String& getDB ( )

returns the DB to use

◆ getFormVersion()

const String& getFormVersion ( )

returns the Mascot form version

◆ getHits()

const String& getHits ( )

returns the number of hits to report back

◆ getInstrument()

const String& getInstrument ( )

returns the instrument type

◆ getMassType()

const String& getMassType ( )

returns the used mass type ("Monoisotopic" or "Average")

◆ getMissedCleavages()

UInt getMissedCleavages ( ) const

returns the number of allowed missed cleavages

◆ getModifications()

const std::vector<String>& getModifications ( )

returns a vector containing the fixed modifications (default: none)

◆ getNextSpectrum_()

bool getNextSpectrum_ ( std::istream &  is,
std::vector< std::pair< double, double > > &  spectrum,
UInt charge,
double &  precursor_mz,
double &  precursor_int,
double &  rt,
String title 
)
protected

◆ getPeakMassTolerance()

float getPeakMassTolerance ( ) const

returns the peak mass tolerance in Da

◆ getPrecursorMassTolerance()

float getPrecursorMassTolerance ( ) const

returns the precursor mass tolerance

◆ getSearchType()

const String& getSearchType ( )

returns the search type

◆ getTaxonomy()

const String& getTaxonomy ( )

returns the taxonomy

◆ getVariableModifications()

const std::vector<String>& getVariableModifications ( )

returns a vector containing the variable modifications (default: none)

◆ load()

void load ( const String filename,
MapType exp 
)
inline

loads a Mascot Generic File into a PeakMap

@param filename file name which the map should be read from
@param exp the map which is filled with the data from the given file
@throw FileNotFound is thrown if the given file could not be found

References MSExperiment::addSpectrum(), File::exists(), SpectrumSettings::getPrecursors(), MSExperiment::reset(), Peak1D::setIntensity(), MetaInfoInterface::setMetaValue(), MSSpectrum::setMSLevel(), Peak1D::setPosition(), and MSSpectrum::setRT().

◆ setBoundary()

void setBoundary ( const String boundary)

sets the boundary used for the MIME format.
By default a 22 character random string is used

◆ setCharges()

void setCharges ( std::vector< Int > &  charges)

sets the charges (default: 1+, 2+ and 3+)

◆ setCleavage()

void setCleavage ( const String cleavage)

sets the enzyme used for cleavage (default: Trypsin).
See <mascot path>/config/enzymes for possible settings.

◆ setDB()

void setDB ( const String db)

sets the DB to use (default: MSDB). See <mascot path>/config/mascot.dat in "Databases" section for possible settings

◆ setFormVersion()

void setFormVersion ( const String form_version)

sets the Mascot form version (default: 1.01)

◆ setHits()

void setHits ( const String hits)

sets the number of hits to report back (default: 20)

◆ setInstrument()

void setInstrument ( const String instrument)

sets the instrument type (Default: Default).
Possible instruments: ESI-QUAD-TOF, MALDI-TOF-PSD, ESI-TRAP, ESI-QUAD, ESI-FTICR, MALDI-TOF-TOF, ESI-4SECTOR, FTMS-ECD, MALDI-QUAD-TOF, MALDI-QIT-TOF

◆ setMassType()

void setMassType ( const String mass_type)

sets the used mass type "Monoisotopic" or "Average" (default: Monoisotopic)

◆ setMissedCleavages()

void setMissedCleavages ( UInt  missed_cleavages)

sets the number of allowed missed cleavages (default: 1)

◆ setModifications()

void setModifications ( const std::vector< String > &  mods)

sets the fixed modifications (default: none).
See <mascot path>/config/mod_file for possible settings.

◆ setPeakMassTolerance()

void setPeakMassTolerance ( float  ion_mass_tolerance)

sets the peak mass tolerance in Da (default: 1.0)

◆ setPrecursorMassTolerance()

void setPrecursorMassTolerance ( float  precursor_mass_tolerance)

sets the precursor mass tolerance in Da (default: 2.0)

◆ setSearchType()

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 Search), "PMF" (Peptide Mass Fingerprint) , "SQ" (Sequence Query)

◆ setTaxonomy()

void setTaxonomy ( const String taxonomy)

sets the taxonomy (default: All entries).
See <mascot path>/config/taxonomy for possible settings.

◆ setVariableModifications()

void setVariableModifications ( const std::vector< String > &  mods)

sets the fixed modifications (default: none).
See <mascot path>/config/mod_file for possible settings.

◆ store() [1/2]

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

◆ store() [2/2]

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

◆ writeHeader_()

void writeHeader_ ( FILE *  fp)
protected

writes the full header

◆ writeMSExperiment_()

void writeMSExperiment_ ( FILE *  fp,
const String filename,
const PeakMap experiment 
)
protected

writes the MSExperiment

◆ writeParameterHeader_()

void writeParameterHeader_ ( const String name,
FILE *  fp,
bool  line_break = true 
)
protected

writes a parameter header

◆ writeSpectrum_()

void writeSpectrum_ ( FILE *  fp,
const String filename,
const PeakSpectrum peaks 
)
protected

writes the spectrum

Member Data Documentation

◆ boundary_

String boundary_
protected

the boundary used for the MIME format

◆ charges_

String charges_
protected

charge states to use

◆ cleavage_

String cleavage_
protected

Enzyme used for cleavage.

◆ db_

String db_
protected

the DB to search in

◆ form_version_

String form_version_
protected

form version

◆ hits_

String hits_
protected

number of hits to report

◆ instrument_

String instrument_
protected

the used instrument

◆ ion_mass_tolerance_

float ion_mass_tolerance_
protected

m/z tolerance of ions in Da

◆ mass_type_

String mass_type_
protected

Monoisotopic/average mass.

◆ missed_cleavages_

UInt missed_cleavages_
protected

number of missed cleavages

◆ mods_

std::vector<String> mods_
protected

fixed Modifications

◆ mz_

double mz_
protected

parent mass

◆ precursor_mass_tolerance_

float precursor_mass_tolerance_
protected

precursor mass tolerance in Da

◆ retention_time_

double retention_time_
protected

the retention time

◆ search_title_

String search_title_
protected

the search title of the mascot search

◆ search_type_

String search_type_
protected

search type: MIS, SQ or PMF

◆ taxonomy_

String taxonomy_
protected

taxonomy

◆ variable_mods_

std::vector<String> variable_mods_
protected

variable Modifications