Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MascotGenericFile Class Reference

Mascot input file adapter. More...

#include <OpenMS/FORMAT/MascotGenericFile.h>

Inheritance diagram for MascotGenericFile:
ProgressLogger DefaultParamHandler

Public Member Functions

 MascotGenericFile ()
 constructor More...
 
virtual ~MascotGenericFile ()
 destructor More...
 
virtual void updateMembers_ ()
 docu in base class More...
 
void store (const String &filename, const PeakMap &experiment, bool compact=false)
 stores the experiment data in a MascotGenericFile that can be used as input for MASCOT shell execution (optionally a compact format is used: no zero-intensity peaks, limited number of decimal places) More...
 
void store (std::ostream &os, const String &filename, const PeakMap &experiment, bool compact=false)
 store the experiment data in a MascotGenericFile; the output is written to the given stream, the filename will be noted in the file (optionally a compact format is used: no zero-intensity peaks, limited number of decimal places) More...
 
template<typename MapType >
void load (const String &filename, MapType &exp)
 loads a Mascot Generic File into a PeakMap More...
 
std::pair< String, StringgetHTTPPeakListEnclosure (const String &filename) const
 enclosing Strings of the peak list body for HTTP submission More...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
 ~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 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 () const
 Ends the progress display. More...
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
virtual DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 

Protected Member Functions

void writeParameterHeader_ (const String &name, std::ostream &os)
 writes a parameter header More...
 
void writeModifications_ (const std::vector< String > &mods, std::ostream &os, bool variable_mods=false)
 write a list of (fixed or variable) modifications More...
 
void writeHeader_ (std::ostream &os)
 writes the full header More...
 
void writeSpectrum_ (std::ostream &os, const PeakSpectrum &spec, const String &filename)
 writes the spectrum More...
 
void writeMSExperiment_ (std::ostream &os, const String &filename, const PeakMap &experiment)
 writes the MSExperiment More...
 
template<typename SpectrumType >
bool getNextSpectrum_ (std::ifstream &is, SpectrumType &spectrum, Size &line_number, const Size &spectrum_number)
 reads a spectrum block, the section between 'BEGIN IONS' and 'END IONS' of a MGF file More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

bool store_compact_
 use a compact format for storing (no zero-intensity peaks, limited number of decimal places)? More...
 
std::map< String, Stringmod_group_map_
 mapping of modifications with specificity groups, that have to be treated specially (e.g. "Deamidated (NQ)") More...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Additional Inherited Members

- Public Types inherited from ProgressLogger
enum  LogType { CMD, GUI, NONE }
 Possible log types. More...
 
- Static Protected Member Functions inherited from ProgressLogger
static String logTypeToFactoryName_ (LogType type)
 Return the name of the factory product used for this log type. More...
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

Mascot input file adapter.

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

Loading a file supports multi-threading, since conversion from string to double is expensive and takes long using a single thread.

Constructor & Destructor Documentation

constructor

virtual ~MascotGenericFile ( )
virtual

destructor

Member Function Documentation

std::pair<String, String> getHTTPPeakListEnclosure ( const String filename) const

enclosing Strings of the peak list body for HTTP submission

Can be used to embed custom content into HTTP submission (when writing only the MGF header in HTTP format and then adding the peaks (in whatever format, e.g. mzXML) enclosed in this body. The filename can later be found in the Mascot response.

bool getNextSpectrum_ ( std::ifstream &  is,
SpectrumType &  spectrum,
Size line_number,
const Size spectrum_number 
)
inlineprotected

reads a spectrum block, the section between 'BEGIN IONS' and 'END IONS' of a MGF file

References String::hasPrefix(), String::hasSubstring(), String::remove(), String::split(), String::substitute(), String::substr(), String::toDouble(), String::toInt(), and String::trim().

void load ( const String filename,
MapType exp 
)
inline

loads a Mascot Generic File into a PeakMap

Parameters
filenamefile name which the map should be read from
expthe map which is filled with the data from the given file
Exceptions
FileNotFoundis thrown if the given file could not be found

References MSExperiment< PeakT, ChromatogramPeakT >::addSpectrum(), File::exists(), SpectrumSettings::getPrecursors(), MSExperiment< PeakT, ChromatogramPeakT >::reset(), and MSSpectrum< PeakT >::setMSLevel().

Referenced by FileHandler::loadExperiment().

void store ( const String filename,
const PeakMap experiment,
bool  compact = false 
)

stores the experiment data in a MascotGenericFile that can be used as input for MASCOT shell execution (optionally a compact format is used: no zero-intensity peaks, limited number of decimal places)

void store ( std::ostream &  os,
const String filename,
const PeakMap experiment,
bool  compact = false 
)

store the experiment data in a MascotGenericFile; the output is written to the given stream, the filename will be noted in the file (optionally a compact format is used: no zero-intensity peaks, limited number of decimal places)

virtual void updateMembers_ ( )
virtual

docu in base class

Reimplemented from DefaultParamHandler.

void writeHeader_ ( std::ostream &  os)
protected

writes the full header

void writeModifications_ ( const std::vector< String > &  mods,
std::ostream &  os,
bool  variable_mods = false 
)
protected

write a list of (fixed or variable) modifications

void writeMSExperiment_ ( std::ostream &  os,
const String filename,
const PeakMap experiment 
)
protected

writes the MSExperiment

void writeParameterHeader_ ( const String name,
std::ostream &  os 
)
protected

writes a parameter header

void writeSpectrum_ ( std::ostream &  os,
const PeakSpectrum spec,
const String filename 
)
protected

writes the spectrum

Member Data Documentation

std::map<String, String> mod_group_map_
protected

mapping of modifications with specificity groups, that have to be treated specially (e.g. "Deamidated (NQ)")

bool store_compact_
protected

use a compact format for storing (no zero-intensity peaks, limited number of decimal places)?


OpenMS / TOPP release 2.0.0 Documentation generated on Tue Nov 1 2016 16:34:46 using doxygen 1.8.11