OpenMS
SiriusMSFile Class Reference

#include <OpenMS/ANALYSIS/ID/SiriusMSConverter.h>

Classes

class  AccessionInfo
 < class to store information about accessions More...
 
class  CompoundInfo
 

Static Public Member Functions

static void store (const MSExperiment &spectra, std::ofstream &os, const FeatureMapping::FeatureToMs2Indices &feature_mapping, const bool &feature_only, const int &isotope_pattern_iterations, const bool no_masstrace_info_isotope_pattern, std::vector< SiriusMSFile::CompoundInfo > &v_cmpinfo, const size_t &file_index)
 Internal structure used in SiriusExport that is used for the conversion of a MzMlFile to an internal format. More...
 
static void saveFeatureCompoundInfoAsTSV (const std::vector< SiriusMSFile::CompoundInfo > &v_cmpinfo, const std::string &filename)
 Store CompoundInfo objects in tsv file format. More...
 

Static Protected Member Functions

static void writeMsFile_ (std::ofstream &os, const MSExperiment &spectra, const std::vector< size_t > &ms2_spectra_index, const SiriusMSFile::AccessionInfo &ainfo, const StringList &adducts, const std::vector< String > &v_description, const std::vector< String > &v_sumformula, const std::vector< std::pair< double, double >> &f_isotopes, int &feature_charge, uint64_t &feature_id, const double &feature_rt, const double &feature_mz, bool &writecompound, const bool &no_masstrace_info_isotope_pattern, const int &isotope_pattern_iterations, int &count_skipped_spectra, int &count_assume_mono, int &count_no_ms1, std::vector< SiriusMSFile::CompoundInfo > &v_cmpinfo, const size_t &file_index)
 Internal structure to write the .ms file (called in store function) More...
 
static Int getHighestIntensityPeakInMZRange_ (double test_mz, const MSSpectrum &spectrum, double tolerance, bool ppm)
 Find highest intensity peak near target mz to test if within a margin of error. More...
 
static std::vector< Peak1DextractPrecursorIsotopePattern_ (const double &precursor_mz, const MSSpectrum &precursor_spectrum, int &iterations, const int &charge)
 Extract precursor isotope pattern if no feature information is available based on C12C13 distance. More...
 

Class Documentation

◆ OpenMS::SiriusMSFile::AccessionInfo

class OpenMS::SiriusMSFile::AccessionInfo

< class to store information about accessions

class to store the compound information needed for the mapping of compound and fragment annotated spectrum

Collaboration diagram for SiriusMSFile::AccessionInfo:
[legend]
Class Members
String native_id_accession nativeID accession for mztab-m
String native_id_type nativeID type for mztab-m
String sf_accession sourcefile accessions for mztab-m
String sf_filename sourcefile name for mztab-m
String sf_path sourcefile path for mztab-m
String sf_type sourcefile type for mztab-m

◆ OpenMS::SiriusMSFile::CompoundInfo

class OpenMS::SiriusMSFile::CompoundInfo
Collaboration diagram for SiriusMSFile::CompoundInfo:
[legend]
Class Members
int charge precursor/feature charge
String cmp query_id used compound in .ms file
String des description/name of the compound
String fid annotated feature_id (if available)
int file_index source file index >
double fmz annotated mass of a feature (if available)
String formula sumformula of the compound
String ionization adduct information
vector< String > m_ids native ids and identifier for multiple possible identification via AMS ("|" separator)
String m_ids_id concatenated list of native ids and identifier for multiple possible identification via AMS ("|" separator) used for mapping of compounds and the annotated spectrum.
vector< String > native_ids native ids of the associated spectra
String native_ids_id concatenated list of the associated spectra
double pint_mono parent/precursor intensity of the compound
double pmass parent/precursor mass of the compound
double rt retention time of the compound
vector< String > scan_indices index of the associated spectra
String source_file sourcefile for mztab-m
String source_format format of the sourcefile for mztab-m
String specref_format spectra ref format for mztab-m
vector< String > specrefs spectra reference for mztab-m

Member Function Documentation

◆ extractPrecursorIsotopePattern_()

static std::vector<Peak1D> extractPrecursorIsotopePattern_ ( const double &  precursor_mz,
const MSSpectrum precursor_spectrum,
int &  iterations,
const int &  charge 
)
staticprotected

Extract precursor isotope pattern if no feature information is available based on C12C13 distance.

Parameters
precursor_mzPrecursor mass-to-charge
precursor_spectrumPrecursor spectrum
iterationsNumber of isotopes, which are tried to be extracted
chargeCharge of the precursor

◆ getHighestIntensityPeakInMZRange_()

static Int getHighestIntensityPeakInMZRange_ ( double  test_mz,
const MSSpectrum spectrum,
double  tolerance,
bool  ppm 
)
staticprotected

Find highest intensity peak near target mz to test if within a margin of error.

Parameters
test_mzMass-to-charge to test
spectrumSpectrum to test
toleranceTolerance window (e.g. 10)
ppmUnit of tolerance window either ppm or Da

◆ saveFeatureCompoundInfoAsTSV()

static void saveFeatureCompoundInfoAsTSV ( const std::vector< SiriusMSFile::CompoundInfo > &  v_cmpinfo,
const std::string &  filename 
)
static

Store CompoundInfo objects in tsv file format.

Parameters
v_cmpinfoVector with CompoundInfo objects
filenameFilename for tsv file

◆ writeMsFile_()

static void writeMsFile_ ( std::ofstream &  os,
const MSExperiment spectra,
const std::vector< size_t > &  ms2_spectra_index,
const SiriusMSFile::AccessionInfo ainfo,
const StringList adducts,
const std::vector< String > &  v_description,
const std::vector< String > &  v_sumformula,
const std::vector< std::pair< double, double >> &  f_isotopes,
int &  feature_charge,
uint64_t &  feature_id,
const double &  feature_rt,
const double &  feature_mz,
bool &  writecompound,
const bool &  no_masstrace_info_isotope_pattern,
const int &  isotope_pattern_iterations,
int &  count_skipped_spectra,
int &  count_assume_mono,
int &  count_no_ms1,
std::vector< SiriusMSFile::CompoundInfo > &  v_cmpinfo,
const size_t &  file_index 
)
staticprotected

Internal structure to write the .ms file (called in store function)

Parameters
osstream
spectraspectra
ms2_spectra_indexvector of index ms2 spectra (in feature)
ainfoaccession information
adductsvector of adducts
v_descriptionvector of descriptions
v_sumformulavector of sumformulas
f_isotopesisotope pattern of the feature
feature_chargefeature charge
feature_idfeature id
feature_rtfeatures retention time
feature_mzfeature mass to charge
writecompoundbool if new compound should be written in .ms file
no_masstrace_info_isotope_patternbool if isotope pattern should be extracted (if not in feature)
isotope_pattern_iterationsnumber of iterations (trying to find a C13 pattern)
count_skipped_spectracount number of skipped spectra
count_assume_monocount number of features where mono charge was assumed
count_no_ms1count number of compounds without a valid ms1 spectrum
v_cmpinfovector of CompoundInfo
file_indexfile index (to differentiate entries derived from different mzML files and resolve ambiguities)