OpenMS
SiriusFragmentAnnotation Class Reference

#include <OpenMS/FORMAT/DATAACCESS/SiriusFragmentAnnotation.h>

Classes

class  SiriusTargetDecoySpectra
 SiriusTargetDecoySpectra holds the target and/or decoy information for one entry (subdirectory from SIRIUS) More...
 

Static Public Member Functions

static std::vector< SiriusTargetDecoySpectraextractAndResolveSiriusAnnotations (const std::vector< String > &sirius_workspace_subdirs, double score_threshold, bool use_exact_mass, bool decoy_generation)
 extractAndResolveSiriusAnnotations Extract and resolves SIRIUS target and/or decoy annotation for mapping native_id to MSSpectrum. More...
 
static std::vector< MSSpectrumextractAnnotationsFromSiriusFile (const String &path_to_sirius_workspace, Size max_rank=1, bool decoy=false, bool use_exact_mass=false)
 extractSiriusFragmentAnnotationMapping
Extract concatenated native ids and concatenated m_ids (unique identifier) from (./spectrum.ms) and annotations from spectra/decoy subfolder More...
 
static std::map< std::string, Sizeextract_columnname_to_columnindex (const CsvFile &csvfile)
 Extract columnname and index based in SIRIUS entries. More...
 

Static Protected Member Functions

static OpenMS::String extractConcatNativeIDsFromSiriusMS_ (const OpenMS::String &path_to_sirius_workspace)
 extractConcatNativeIDsFromSiriusMS Extract concatenated native id from SIRIUS output (./spectrum.ms) and concatenates them. More...
 
static OpenMS::String extractConcatMIDsFromSiriusMS_ (const String &path_to_sirius_workspace)
 extractConcatMIDsFromSiriusMS Extract m_ids from SIRIUS output (./spectrum.ms) and concatenates them. M_id is the native id + an index, which is incremented based on the number of possible identifications (accurate mass search). More...
 
static OpenMS::String extractFeatureIDFromSiriusMS_ (const String &path_to_sirius_workspace)
 extractConcatMIDsFromSiriusMS Extract fid (i.e. original OpenMS feature ID) from SIRIUS output (./spectrum.ms). More...
 
static std::map< Size, StringextractCompoundRankingAndFilename_ (const String &path_to_sirius_workspace)
 extractCompoundRankingAndFilename Extract compound ranking and filename (./formula_candidates.tsv). More...
 
static std::map< Size, double > extractCompoundRankingAndScore_ (const String &path_to_sirius_workspace)
 extractCompoundRankingAndFilename Extract compound ranking and score (./formula_candidates.tsv). More...
 

Member Function Documentation

◆ extract_columnname_to_columnindex()

static std::map< std::string, Size > extract_columnname_to_columnindex ( const CsvFile csvfile)
static

Extract columnname and index based in SIRIUS entries.

◆ extractAndResolveSiriusAnnotations()

static std::vector<SiriusTargetDecoySpectra> extractAndResolveSiriusAnnotations ( const std::vector< String > &  sirius_workspace_subdirs,
double  score_threshold,
bool  use_exact_mass,
bool  decoy_generation 
)
static

extractAndResolveSiriusAnnotations Extract and resolves SIRIUS target and/or decoy annotation for mapping native_id to MSSpectrum.

Returns
map native_id to annotated MSSpectrum (target or decoy)

If there are multiple identifications for a feature with the same MS2 spectras (concatenated native ids) the identification with the higher SIRIUS score is chosen (currently based on the explained peak intensities).

Parameters
sirius_workspace_subdirsVector of paths to SIRIUS subdirectories.
score_thresholdOnly use spectra over a certain score threshold (0-1)
use_exact_massOption to use exact mass instead of peak mz in MSSpectrum.
decoy_generationExtract decoy spectra from SIRIUS subdirectories.

◆ extractAnnotationsFromSiriusFile()

static std::vector<MSSpectrum> extractAnnotationsFromSiriusFile ( const String path_to_sirius_workspace,
Size  max_rank = 1,
bool  decoy = false,
bool  use_exact_mass = false 
)
static

extractSiriusFragmentAnnotationMapping
Extract concatenated native ids and concatenated m_ids (unique identifier) from (./spectrum.ms) and annotations from spectra/decoy subfolder

If decoy is true, uses fragment annotation (./spectra/1_sumformula.tsv) from SIRIUS output (per compound) else uses fragment annotation (./decoy/1_sumformula.tsv) from SIRIUS/PASSATUTTO output (per compound).

Returns
annotated decoy MSSpectrum with associated native id

MetaValues: peak_mz annotated_sumformula annotated_adduct

The data is stored in a MSSpectrum, which contains a Peak1D (mz or exact mass [depending on use_exact_mass], int), a FloatDataArray for targets only (exact mass or mz [depending on use_exact_mass]), a StringDataArray (explanation), and a StringDataArray (ionization).

MSSpectrum
Peak1D [FloatDataArray] StringDataArray StringDataArray
mz intensity [exact_mass] explanation ionization
56.050855 20794.85 [56.049476] C3H5N [M + H]+
Parameters
path_to_sirius_workspacePath to SIRIUS workspace.
max_rankUp to which rank to extract annotations maximally. Auto-stops at last candidate.
decoyExtract annotations for decoys? Or else targets. Run twice if you want both
use_exact_massOption to use exact mass instead of peak mz in MSSpectrum.

◆ extractCompoundRankingAndFilename_()

static std::map< Size, String > extractCompoundRankingAndFilename_ ( const String path_to_sirius_workspace)
staticprotected

extractCompoundRankingAndFilename Extract compound ranking and filename (./formula_candidates.tsv).

Returns
a map with specified rank and filename (formula_adduct.tsv) (based on the annotation)
Parameters
path_to_sirius_workspacePath to SIRIUS workspace.

◆ extractCompoundRankingAndScore_()

static std::map< Size, double > extractCompoundRankingAndScore_ ( const String path_to_sirius_workspace)
staticprotected

extractCompoundRankingAndFilename Extract compound ranking and score (./formula_candidates.tsv).

Returns
a map with specified rank and score (explainedIntensity) (based on the annotation)
Parameters
path_to_sirius_workspacePath to SIRIUS workspace.

◆ extractConcatMIDsFromSiriusMS_()

static OpenMS::String extractConcatMIDsFromSiriusMS_ ( const String path_to_sirius_workspace)
staticprotected

extractConcatMIDsFromSiriusMS Extract m_ids from SIRIUS output (./spectrum.ms) and concatenates them. M_id is the native id + an index, which is incremented based on the number of possible identifications (accurate mass search).

Returns
String m_id of current SIRIUS compound
Parameters
path_to_sirius_workspacePath to SIRIUS workspace.

◆ extractConcatNativeIDsFromSiriusMS_()

static OpenMS::String extractConcatNativeIDsFromSiriusMS_ ( const OpenMS::String path_to_sirius_workspace)
staticprotected

extractConcatNativeIDsFromSiriusMS Extract concatenated native id from SIRIUS output (./spectrum.ms) and concatenates them.

Returns
String native id of current SIRIUS compound
Parameters
path_to_sirius_workspacePath to SIRIUS workspace.

◆ extractFeatureIDFromSiriusMS_()

static OpenMS::String extractFeatureIDFromSiriusMS_ ( const String path_to_sirius_workspace)
staticprotected

extractConcatMIDsFromSiriusMS Extract fid (i.e. original OpenMS feature ID) from SIRIUS output (./spectrum.ms).

Returns
String fid of current SIRIUS workspace
Parameters
path_to_sirius_workspacePath to SIRIUS workspace.