OpenMS
Loading...
Searching...
No Matches
XTandemInfile Class Reference

XTandem input file. More...

#include <OpenMS/FORMAT/XTandemInfile.h>

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

Public Types

enum  ErrorUnit { DALTONS = 0 , PPM }
 error unit, either Da or ppm More...
 
enum  MassType { MONOISOTOPIC = 0 , AVERAGE }
 Mass type of the precursor, either monoisotopic or average. More...
 

Public Member Functions

 XTandemInfile ()
 constructor
 
 ~XTandemInfile () override
 constructor
 
void setFragmentMassTolerance (double tolerance)
 setter for the fragment mass tolerance
 
double getFragmentMassTolerance () const
 returns the fragment mass tolerance
 
void setPrecursorMassTolerancePlus (double tol)
 sets the precursor mass tolerance (plus only)
 
double getPrecursorMassTolerancePlus () const
 returns the precursor mass tolerance (plus only)
 
void setPrecursorMassToleranceMinus (double tol)
 set the precursor mass tolerance (minus only)
 
double getPrecursorMassToleranceMinus () const
 returns the precursor mass tolerance (minus only)
 
void setPrecursorErrorType (MassType mono_isotopic)
 sets the precursor mass type
 
MassType getPrecursorErrorType () const
 returns the precursor mass type
 
void setFragmentMassErrorUnit (ErrorUnit unit)
 sets the fragment mass error unit (Da, ppm)
 
ErrorUnit getFragmentMassErrorUnit () const
 returns the fragment mass error unit (Da, ppm)
 
void setPrecursorMassErrorUnit (ErrorUnit unit)
 sets the precursor mass error unit (Da, ppm)
 
ErrorUnit getPrecursorMassErrorUnit () const
 returns the precursor mass error unit (Da, ppm)
 
void setNumberOfThreads (UInt threads)
 sets the number of threads used during the identifications
 
UInt getNumberOfThreads () const
 returns the number of threads
 
void setModifications (const ModificationDefinitionsSet &mods)
 sets the modifications using a modification definitions set
 
const ModificationDefinitionsSetgetModifications () const
 returns the modifications set, using a modification definitions set
 
void setOutputFilename (const std::string &output)
 sets the output filename
 
const std::string & getOutputFilename () const
 returns the output filename
 
void setInputFilename (const std::string &input_file)
 sets the input filename
 
const std::string & getInputFilename () const
 returns the input filename
 
void setTaxonomyFilename (const std::string &filename)
 set the filename of the taxonomy file
 
const std::string & getTaxonomyFilename () const
 returns the filename of the taxonomy file
 
void setDefaultParametersFilename (const std::string &filename)
 sets the default parameters file
 
const std::string & getDefaultParametersFilename () const
 returns the default parameters file
 
void setTaxon (const std::string &taxon)
 sets the taxon used in the taxonomy file
 
const std::string & getTaxon () const
 returns the taxon used in the taxonomy file
 
void setMaxPrecursorCharge (Int max_charge)
 sets the max precursor charge
 
Int getMaxPrecursorCharge () const
 returns the max precursor charge
 
void setNumberOfMissedCleavages (UInt missed_cleavages)
 sets the number of missed cleavages allowed
 
UInt getNumberOfMissedCleavages () const
 returns the number of missed cleavages allowed
 
void setOutputResults (const std::string &result)
 sets the output result type ("all", "valid" or "stochastic")
 
std::string getOutputResults () const
 returns the output result type ("all", "valid" or "stochastic")
 
void setMaxValidEValue (double value)
 sets the max valid E-value allowed in the list
 
double getMaxValidEValue () const
 returns the max valid E-value allowed in the list
 
void setSemiCleavage (const bool semi_cleavage)
 set state of semi cleavage
 
void setAllowIsotopeError (const bool allow_isotope_error)
 set if misassignment of precursor to first and second 13C isotopic peak should also be considered
 
bool getNoiseSuppression () const
 get state of noise suppression
 
void setNoiseSuppression (const bool noise_suppression)
 set state of noise suppression
 
void setCleavageSite (const std::string &cleavage_site)
 set the cleavage site with a X! Tandem conform regex
 
const std::string & getCleavageSite () const
 returns the cleavage site regex
 
void write (const std::string &filename, bool ignore_member_parameters=false, bool force_default_mods=false)
 Writes the X! Tandem input file to the given filename.
 
- Public Member Functions inherited from XMLFile
 XMLFile ()
 Construct an XMLFile without schema info; schema_location_ remains unset, so isValid cannot be used until derived-class logic initializes schema_location_ before calling isValid.
 
 XMLFile (const std::string &schema_location, const std::string &version)
 Construct with a schema location for later isValid calls.
 
virtual ~XMLFile ()
 Virtual destructor — defaulted; allows safe deletion through a base-class pointer.
 
bool isValid (const std::string &filename, std::ostream &os)
 Check if filename validates against the bound XML schema.
 
const std::string & getVersion () const
 Return the schema version string passed to the parameterised constructor; empty for default-constructed instances.
 

Protected Member Functions

 XTandemInfile (const XTandemInfile &rhs)
 
XTandemInfileoperator= (const XTandemInfile &rhs)
 
void writeTo_ (std::ostream &os, bool ignore_member_parameters)
 
void writeNote_ (std::ostream &os, const std::string &label, const std::string &value)
 
void writeNote_ (std::ostream &os, const std::string &label, const char *value)
 
void writeNote_ (std::ostream &os, const std::string &label, bool value)
 
std::string convertModificationSet_ (const std::set< ModificationDefinition > &mods, std::map< std::string, double > &affected_origins) const
 Converts the given set of Modifications into a format compatible to X!Tandem.
 
- Protected Member Functions inherited from XMLFile
void parse_ (const std::string &filename, XMLHandler *handler)
 Parse the XML file at filename through handler.
 
void parseBuffer_ (const std::string &buffer, XMLHandler *handler)
 Parse an in-memory XML buffer through handler.
 
void save_ (const std::string &filename, XMLHandler *handler) const
 Stores the contents of the XML handler given by handler in the file given by filename.
 
void enforceEncoding_ (const std::string &encoding)
 Set or clear the XML-encoding override applied to subsequent parse_ / parseBuffer_ calls.
 

Protected Attributes

double fragment_mass_tolerance_
 
double precursor_mass_tolerance_plus_
 
double precursor_mass_tolerance_minus_
 
ErrorUnit fragment_mass_error_unit_
 
ErrorUnit precursor_mass_error_unit_
 
MassType fragment_mass_type_
 
MassType precursor_mass_type_
 
UInt max_precursor_charge_
 
double precursor_lower_mz_
 
double fragment_lower_mz_
 
UInt number_of_threads_
 
UInt batch_size_
 
ModificationDefinitionsSet modifications_
 
std::string input_filename_
 
std::string output_filename_
 
std::string taxonomy_file_
 
std::string taxon_
 
std::string cleavage_site_
 
bool semi_cleavage_
 semi cleavage
 
bool allow_isotope_error_
 
UInt number_of_missed_cleavages_
 
std::string default_parameters_file_
 
std::string output_results_
 
double max_valid_evalue_
 
bool force_default_mods_
 
- Protected Attributes inherited from XMLFile
std::string schema_location_
 Path of the XML schema for validation; empty when the default constructor was used (isValid then throws NotImplemented).
 
std::string schema_version_
 Schema version string returned by getVersion.
 
std::string enforced_encoding_
 Optional XML encoding override applied to the InputSource in parse_ and parseBuffer_; empty disables the override. Used as a workaround for XTandem output XML which carries an encoding the parser otherwise stumbles on.
 

Detailed Description

XTandem input file.

This class is able to load/write a X!Tandem configuration file.

These files store parameters within 'note' tags, e.g.,

  <note type="input" label="spectrum, fragment monoisotopic mass error">0.4</note>
  <note type="input" label="output, proteins">yes</note>

Member Enumeration Documentation

◆ ErrorUnit

enum ErrorUnit

error unit, either Da or ppm

Enumerator
DALTONS 
PPM 

◆ MassType

enum MassType

Mass type of the precursor, either monoisotopic or average.

Enumerator
MONOISOTOPIC 
AVERAGE 

Constructor & Destructor Documentation

◆ XTandemInfile() [1/2]

constructor

◆ ~XTandemInfile()

~XTandemInfile ( )
override

constructor

◆ XTandemInfile() [2/2]

XTandemInfile ( const XTandemInfile rhs)
protected

Member Function Documentation

◆ convertModificationSet_()

std::string convertModificationSet_ ( const std::set< ModificationDefinition > &  mods,
std::map< std::string, double > &  affected_origins 
) const
protected

Converts the given set of Modifications into a format compatible to X!Tandem.

The set affected_origins can be used to avoid duplicate modifications, which are not supported in X! Tandem. Currently, a warning message is printed. Also, if a fixed mod is already given, a corresponding variable mods needs to have its delta mass reduced by the fixed modifications mass. This is also done automatically here.

Parameters
[in]modsThe modifications to convert
[in]affected_originsSet of origins, which were used previously. Will be augmented with the current mods.
Returns
An X! Tandem compatible string representation.

◆ getCleavageSite()

const std::string & getCleavageSite ( ) const

returns the cleavage site regex

◆ getDefaultParametersFilename()

const std::string & getDefaultParametersFilename ( ) const

returns the default parameters file

◆ getFragmentMassErrorUnit()

ErrorUnit getFragmentMassErrorUnit ( ) const

returns the fragment mass error unit (Da, ppm)

◆ getFragmentMassTolerance()

double getFragmentMassTolerance ( ) const

returns the fragment mass tolerance

◆ getInputFilename()

const std::string & getInputFilename ( ) const

returns the input filename

◆ getMaxPrecursorCharge()

Int getMaxPrecursorCharge ( ) const

returns the max precursor charge

◆ getMaxValidEValue()

double getMaxValidEValue ( ) const

returns the max valid E-value allowed in the list

◆ getModifications()

const ModificationDefinitionsSet & getModifications ( ) const

returns the modifications set, using a modification definitions set

◆ getNoiseSuppression()

bool getNoiseSuppression ( ) const

get state of noise suppression

◆ getNumberOfMissedCleavages()

UInt getNumberOfMissedCleavages ( ) const

returns the number of missed cleavages allowed

◆ getNumberOfThreads()

UInt getNumberOfThreads ( ) const

returns the number of threads

◆ getOutputFilename()

const std::string & getOutputFilename ( ) const

returns the output filename

◆ getOutputResults()

std::string getOutputResults ( ) const

returns the output result type ("all", "valid" or "stochastic")

◆ getPrecursorErrorType()

MassType getPrecursorErrorType ( ) const

returns the precursor mass type

◆ getPrecursorMassErrorUnit()

ErrorUnit getPrecursorMassErrorUnit ( ) const

returns the precursor mass error unit (Da, ppm)

◆ getPrecursorMassToleranceMinus()

double getPrecursorMassToleranceMinus ( ) const

returns the precursor mass tolerance (minus only)

◆ getPrecursorMassTolerancePlus()

double getPrecursorMassTolerancePlus ( ) const

returns the precursor mass tolerance (plus only)

◆ getTaxon()

const std::string & getTaxon ( ) const

returns the taxon used in the taxonomy file

◆ getTaxonomyFilename()

const std::string & getTaxonomyFilename ( ) const

returns the filename of the taxonomy file

◆ operator=()

XTandemInfile & operator= ( const XTandemInfile rhs)
protected

◆ setAllowIsotopeError()

void setAllowIsotopeError ( const bool  allow_isotope_error)

set if misassignment of precursor to first and second 13C isotopic peak should also be considered

◆ setCleavageSite()

void setCleavageSite ( const std::string &  cleavage_site)

set the cleavage site with a X! Tandem conform regex

◆ setDefaultParametersFilename()

void setDefaultParametersFilename ( const std::string &  filename)

sets the default parameters file

◆ setFragmentMassErrorUnit()

void setFragmentMassErrorUnit ( ErrorUnit  unit)

sets the fragment mass error unit (Da, ppm)

◆ setFragmentMassTolerance()

void setFragmentMassTolerance ( double  tolerance)

setter for the fragment mass tolerance

◆ setInputFilename()

void setInputFilename ( const std::string &  input_file)

sets the input filename

◆ setMaxPrecursorCharge()

void setMaxPrecursorCharge ( Int  max_charge)

sets the max precursor charge

◆ setMaxValidEValue()

void setMaxValidEValue ( double  value)

sets the max valid E-value allowed in the list

◆ setModifications()

void setModifications ( const ModificationDefinitionsSet mods)

sets the modifications using a modification definitions set

◆ setNoiseSuppression()

void setNoiseSuppression ( const bool  noise_suppression)

set state of noise suppression

◆ setNumberOfMissedCleavages()

void setNumberOfMissedCleavages ( UInt  missed_cleavages)

sets the number of missed cleavages allowed

◆ setNumberOfThreads()

void setNumberOfThreads ( UInt  threads)

sets the number of threads used during the identifications

◆ setOutputFilename()

void setOutputFilename ( const std::string &  output)

sets the output filename

◆ setOutputResults()

void setOutputResults ( const std::string &  result)

sets the output result type ("all", "valid" or "stochastic")

◆ setPrecursorErrorType()

void setPrecursorErrorType ( MassType  mono_isotopic)

sets the precursor mass type

◆ setPrecursorMassErrorUnit()

void setPrecursorMassErrorUnit ( ErrorUnit  unit)

sets the precursor mass error unit (Da, ppm)

◆ setPrecursorMassToleranceMinus()

void setPrecursorMassToleranceMinus ( double  tol)

set the precursor mass tolerance (minus only)

◆ setPrecursorMassTolerancePlus()

void setPrecursorMassTolerancePlus ( double  tol)

sets the precursor mass tolerance (plus only)

◆ setSemiCleavage()

void setSemiCleavage ( const bool  semi_cleavage)

set state of semi cleavage

◆ setTaxon()

void setTaxon ( const std::string &  taxon)

sets the taxon used in the taxonomy file

◆ setTaxonomyFilename()

void setTaxonomyFilename ( const std::string &  filename)

set the filename of the taxonomy file

◆ write()

void write ( const std::string &  filename,
bool  ignore_member_parameters = false,
bool  force_default_mods = false 
)

Writes the X! Tandem input file to the given filename.

If ignore_member_parameters is true, only a very limited number of tags fed by member variables (i.e. in, out, database/taxonomy) is written.

Parameters
[out]filenamethe name of the file which is written
[in]ignore_member_parametersDo not write tags for class members
[in]force_default_modsForce writing of mods covered by special parameters
Exceptions
UnableToCreateFileis thrown if the given file could not be created

◆ writeNote_() [1/3]

void writeNote_ ( std::ostream &  os,
const std::string &  label,
bool  value 
)
protected

◆ writeNote_() [2/3]

void writeNote_ ( std::ostream &  os,
const std::string &  label,
const char *  value 
)
protected

◆ writeNote_() [3/3]

void writeNote_ ( std::ostream &  os,
const std::string &  label,
const std::string &  value 
)
protected

◆ writeTo_()

void writeTo_ ( std::ostream &  os,
bool  ignore_member_parameters 
)
protected

Member Data Documentation

◆ allow_isotope_error_

bool allow_isotope_error_
protected

◆ batch_size_

UInt batch_size_
protected

◆ cleavage_site_

std::string cleavage_site_
protected

◆ default_parameters_file_

std::string default_parameters_file_
protected

◆ force_default_mods_

bool force_default_mods_
protected

◆ fragment_lower_mz_

double fragment_lower_mz_
protected

◆ fragment_mass_error_unit_

ErrorUnit fragment_mass_error_unit_
protected

◆ fragment_mass_tolerance_

double fragment_mass_tolerance_
protected

◆ fragment_mass_type_

MassType fragment_mass_type_
protected

◆ input_filename_

std::string input_filename_
protected

◆ max_precursor_charge_

UInt max_precursor_charge_
protected

◆ max_valid_evalue_

double max_valid_evalue_
protected

◆ modifications_

ModificationDefinitionsSet modifications_
protected

◆ number_of_missed_cleavages_

UInt number_of_missed_cleavages_
protected

◆ number_of_threads_

UInt number_of_threads_
protected

◆ output_filename_

std::string output_filename_
protected

◆ output_results_

std::string output_results_
protected

◆ precursor_lower_mz_

double precursor_lower_mz_
protected

◆ precursor_mass_error_unit_

ErrorUnit precursor_mass_error_unit_
protected

◆ precursor_mass_tolerance_minus_

double precursor_mass_tolerance_minus_
protected

◆ precursor_mass_tolerance_plus_

double precursor_mass_tolerance_plus_
protected

◆ precursor_mass_type_

MassType precursor_mass_type_
protected

◆ semi_cleavage_

bool semi_cleavage_
protected

semi cleavage

◆ taxon_

std::string taxon_
protected

◆ taxonomy_file_

std::string taxonomy_file_
protected