![]() |
OpenMS
2.4.0
|
Read/write Mascot generic files (MGF). More...
#include <OpenMS/FORMAT/MascotGenericFile.h>
Public Member Functions | |
| MascotGenericFile () | |
| constructor More... | |
| ~MascotGenericFile () override | |
| destructor More... | |
| void | updateMembers_ () override |
| 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, String > | getHTTPPeakListEnclosure (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... | |
| ProgressLogger & | operator= (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... | |
| void | nextProgress () const |
| increment progress by 1 (according to range begin-end) 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 DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
| Assignment operator. More... | |
| virtual bool | operator== (const DefaultParamHandler &rhs) const |
| Equality operator. More... | |
| void | setParameters (const Param ¶m) |
| Sets the parameters. More... | |
| const Param & | getParameters () const |
| Non-mutable access to the parameters. More... | |
| const Param & | getDefaults () const |
| Non-mutable access to the default parameters. More... | |
| const String & | getName () 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, const String &native_id_type_accession) |
| 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, String > | mod_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_ |
| ProgressLoggerImpl * | current_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< String > | subsections_ |
| 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_ |
Read/write Mascot generic files (MGF).
For details of the format, see http://www.matrixscience.com/help/data_file_help.html#GEN.
constructor
|
override |
destructor
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.
|
inlineprotected |
reads a spectrum block, the section between 'BEGIN IONS' and 'END IONS' of a MGF file
References SpectrumSettings::getPrecursors(), String::hasPrefix(), String::hasSubstring(), MetaInfoInterface::metaValueExists(), String::remove(), MetaInfoInterface::removeMetaValue(), Peak1D::setIntensity(), MetaInfoInterface::setMetaValue(), SpectrumSettings::setNativeID(), Peak1D::setPosition(), MSSpectrum::setRT(), String::simplify(), String::split(), String::substitute(), String::substr(), String::toDouble(), String::toInt(), and String::trim().
loads a Mascot Generic File into a PeakMap
| filename | file name which the map should be read from |
| exp | the map which is filled with the data from the given file |
| FileNotFound | is thrown if the given file could not be found |
References MSExperiment::addSpectrum(), File::exists(), SpectrumSettings::getPrecursors(), MSExperiment::reset(), and MSSpectrum::setMSLevel().
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)
|
overridevirtual |
docu in base class
Reimplemented from DefaultParamHandler.
|
protected |
writes the full header
|
protected |
write a list of (fixed or variable) modifications
|
protected |
writes the MSExperiment
|
protected |
writes a parameter header
|
protected |
writes the spectrum
mapping of modifications with specificity groups, that have to be treated specially (e.g. "Deamidated (NQ)")
|
protected |
use a compact format for storing (no zero-intensity peaks, limited number of decimal places)?
1.8.16