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

#include <OpenMS/FORMAT/XQuestResultXMLFile.h>

Inheritance diagram for XQuestResultXMLFile:
XMLFile

Public Member Functions

 XQuestResultXMLFile ()
 
 ~XQuestResultXMLFile ()
 
void load (const String &filename, std::vector< std::vector< PeptideIdentification > > &csms, std::vector< ProteinIdentification > &prot_ids, Size min_n_hits_per_spectrum=0, bool load_to_peptideHit=false)
 Load the content of the xquest.xml file into the provided data structures. More...
 
int getNumberOfHits () const
 Returns the total number of hits in the file. More...
 
double getMinScore () const
 Returns minimum score among the hits in the file. More...
 
double getMaxScore () const
 Returns maximum score among the hits in the file. More...
 
- Public Member Functions inherited from XMLFile
 XMLFile ()
 Default constructor. More...
 
 XMLFile (const String &schema_location, const String &version)
 Constructor that sets the schema location. More...
 
virtual ~XMLFile ()
 Destructor. More...
 
bool isValid (const String &filename, std::ostream &os)
 Checks if a file validates against the XML schema. More...
 
const StringgetVersion () const
 return the version of the schema More...
 

Static Public Member Functions

static void writeXQuestXML (String out_file, String base_name, const std::vector< PeptideIdentification > &peptide_ids, const std::vector< std::vector< OPXLDataStructs::CrossLinkSpectrumMatch > > &all_top_csms, const PeakMap &spectra, String precursor_mass_tolerance_unit, String fragment_mass_tolerance_unit, double precursor_mass_tolerance, double fragment_mass_tolerance, double fragment_mass_tolerance_xlinks, String cross_link_name, double cross_link_mass_light, DoubleList cross_link_mass_mono_link, String in_fasta, String in_decoy_fasta, StringList cross_link_residue1, StringList cross_link_residue2, double cross_link_mass_iso_shift, String enzyme_name, Size missed_cleavages)
 Writes xquest.xml output files containing XL-MS identification results. More...
 
static void writeXQuestXMLSpec (String out_file, String base_name, const OPXLDataStructs::PreprocessedPairSpectra &preprocessed_pair_spectra, const std::vector< std::pair< Size, Size > > &spectrum_pairs, const std::vector< std::vector< OPXLDataStructs::CrossLinkSpectrumMatch > > &all_top_csms, const PeakMap &spectra)
 Writes spec.xml output containing matching peaks between heavy and light spectra after comparing and filtering. More...
 
static void writeXQuestXMLSpec (String out_file, String base_name, const std::vector< std::vector< OPXLDataStructs::CrossLinkSpectrumMatch > > &all_top_csms, const PeakMap &spectra)
 Writes spec.xml output containing spectra for visualization. This version of the function is meant to be used for label-free linkers. More...
 

Static Private Member Functions

static String getxQuestBase64EncodedSpectrum_ (const PeakSpectrum &spec, String header)
 Transforms a PeakSpectrum into a base 64 encoded string, which is the format used in spec.xml for xQuest. More...
 
static void wrap_ (const String &input, Size width, String &output)
 A helper function, that takes one string containing one line and wraps it into several lines of a given width. More...
 

Private Attributes

int n_hits_
 
double min_score_
 
double max_score_
 

Additional Inherited Members

- Protected Member Functions inherited from XMLFile
void parse_ (const String &filename, XMLHandler *handler)
 Parses the XML file given by filename using the handler given by handler. More...
 
void save_ (const String &filename, XMLHandler *handler) const
 Stores the contents of the XML handler given by handler in the file given by filename. More...
 
void enforceEncoding_ (const String &encoding)
 
- Protected Attributes inherited from XMLFile
String schema_location_
 XML schema file location. More...
 
String schema_version_
 Version string. More...
 
String enforced_encoding_
 Encoding string that replaces the encoding (system dependent or specified in the XML). Disabled if empty. Used as a workaround for XTandem output xml. More...
 

Constructor & Destructor Documentation

◆ XQuestResultXMLFile()

◆ ~XQuestResultXMLFile()

Member Function Documentation

◆ getMaxScore()

double getMaxScore ( ) const

Returns maximum score among the hits in the file.

Returns
Maximum score among the hits in the file.

◆ getMinScore()

double getMinScore ( ) const

Returns minimum score among the hits in the file.

Returns
Minimum score among the hits in the file.

◆ getNumberOfHits()

int getNumberOfHits ( ) const

Returns the total number of hits in the file.

Returns
total number of hits in the file

◆ getxQuestBase64EncodedSpectrum_()

static String getxQuestBase64EncodedSpectrum_ ( const PeakSpectrum spec,
String  header 
)
staticprivate

Transforms a PeakSpectrum into a base 64 encoded string, which is the format used in spec.xml for xQuest.

Parameters
Thespectrum
Aheader for the spectrum, build using the base_name parameter for writeXQuestXMLSpec and the index of the spectrum.

◆ load()

void load ( const String filename,
std::vector< std::vector< PeptideIdentification > > &  csms,
std::vector< ProteinIdentification > &  prot_ids,
Size  min_n_hits_per_spectrum = 0,
bool  load_to_peptideHit = false 
)

Load the content of the xquest.xml file into the provided data structures.

Parameters
filenameFilename of the file which is to be loaded.
csmsWhere the spectra with identifications of the input file will be loaded to.
prot_idsWhere the protein identification of the input file will be loaded to.
min_n_hits_per_spectrumHow many minimum hits a spectrum must contain to be loaded to csms.
load_to_peptideHitWhether the data will be loaded as meta values also into the peptide hits, instead just into the PeptideIdentification

◆ wrap_()

static void wrap_ ( const String input,
Size  width,
String output 
)
staticprivate

A helper function, that takes one string containing one line and wraps it into several lines of a given width.

Parameters
Thestring as one line
Thepreferred line width
Stringin which the output is written

◆ writeXQuestXML()

static void writeXQuestXML ( String  out_file,
String  base_name,
const std::vector< PeptideIdentification > &  peptide_ids,
const std::vector< std::vector< OPXLDataStructs::CrossLinkSpectrumMatch > > &  all_top_csms,
const PeakMap spectra,
String  precursor_mass_tolerance_unit,
String  fragment_mass_tolerance_unit,
double  precursor_mass_tolerance,
double  fragment_mass_tolerance,
double  fragment_mass_tolerance_xlinks,
String  cross_link_name,
double  cross_link_mass_light,
DoubleList  cross_link_mass_mono_link,
String  in_fasta,
String  in_decoy_fasta,
StringList  cross_link_residue1,
StringList  cross_link_residue2,
double  cross_link_mass_iso_shift,
String  enzyme_name,
Size  missed_cleavages 
)
static

Writes xquest.xml output files containing XL-MS identification results.

Parameters
Pathand filename for the output file
Thebase_name should be the name of the input spectra file without the file ending. Used as part of an identifier string for the spectra.
ThePeptideIdentifications from a XL-MS search
CrossLinkSpectrumMatches,fromwhich the IDs were generated.
Thespectra, that were searched as a PeakMap
Theunit of the precursor mass tolerance ("Da" or "ppm")
Theunit of the fragment mass tolerance ("Da" or "ppm")
Theprecursor mass tolerance
Thefragment mass tolerance for common ions
Thefragment mass tolerance for cross-linked ions
Thename of the cross-link reagent
Themass of the cross-link reagent when linking two peptides
Listof possible masses for the cross-link, if it is attached to a peptide on one side
Pathand filename of the target protein database
Pathand filename of the decoy protein database
Residues,thatthe first side of the cross-linker can react with
Residues,thatthe second side of the cross-linker can react with
Thedifference of mass between the two types of cross-linkers, if labeled linkers were used. Should be 0 for label-free linkers.
Nameof the Enzyme used for digestion
Numberof allowed missed cleavages

◆ writeXQuestXMLSpec() [1/2]

static void writeXQuestXMLSpec ( String  out_file,
String  base_name,
const OPXLDataStructs::PreprocessedPairSpectra preprocessed_pair_spectra,
const std::vector< std::pair< Size, Size > > &  spectrum_pairs,
const std::vector< std::vector< OPXLDataStructs::CrossLinkSpectrumMatch > > &  all_top_csms,
const PeakMap spectra 
)
static

Writes spec.xml output containing matching peaks between heavy and light spectra after comparing and filtering.

Parameters
Pathand filename for the output file
Thebase_name should be the name of the input spectra file without the file ending. Used as part of an identifier string for the spectra.
Thepreprocessed spectra after comparing and filtering
Indicesof spectrum pairs in the input map
CrossLinkSpectrumMatches,fromwhich the IDs were generated. Only spectra with matches are written out.
Thespectra, that were searched as a PeakMap. The indices in spectrum_pairs correspond to spectra in this map.

◆ writeXQuestXMLSpec() [2/2]

static void writeXQuestXMLSpec ( String  out_file,
String  base_name,
const std::vector< std::vector< OPXLDataStructs::CrossLinkSpectrumMatch > > &  all_top_csms,
const PeakMap spectra 
)
static

Writes spec.xml output containing spectra for visualization. This version of the function is meant to be used for label-free linkers.

Parameters
Pathand filename for the output file
Thebase_name should be the name of the input spectra file without the file ending. Used as part of an identifier string for the spectra.
CrossLinkSpectrumMatches,fromwhich the IDs were generated. Only spectra with matches are written out.
Thespectra, that were searched as a PeakMap.

Member Data Documentation

◆ max_score_

double max_score_
private

◆ min_score_

double min_score_
private

◆ n_hits_

int n_hits_
private

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:14 using doxygen 1.8.13