OpenMS
SiriusFragmentAnnotation.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Oliver Alka $
6 // $Authors: Oliver Alka $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/FORMAT/CsvFile.h>
13 
14 namespace OpenMS
15 {
16  class OPENMS_DLLAPI SiriusFragmentAnnotation
17  {
18  public:
19 
24  {
25  public:
26 
29 
31  SiriusTargetDecoySpectra(MSSpectrum target_spectrum, MSSpectrum decoy_spectrum) : target(std::move(target_spectrum)), decoy(std::move(decoy_spectrum)) {}
32  };
33 
48  static std::vector<SiriusTargetDecoySpectra> extractAndResolveSiriusAnnotations(const std::vector<String>& sirius_workspace_subdirs, double score_threshold,
49  bool use_exact_mass, bool decoy_generation);
50 
82  static std::vector<MSSpectrum> extractAnnotationsFromSiriusFile(const String& path_to_sirius_workspace, Size max_rank = 1, bool decoy = false, bool use_exact_mass = false);
83 
87  static std::map< std::string, Size > extract_columnname_to_columnindex(const CsvFile& csvfile);
88 
89  protected:
98  static OpenMS::String extractConcatNativeIDsFromSiriusMS_(const OpenMS::String& path_to_sirius_workspace);
99 
110  static OpenMS::String extractConcatMIDsFromSiriusMS_(const String& path_to_sirius_workspace);
111 
120  static OpenMS::String extractFeatureIDFromSiriusMS_(const String& path_to_sirius_workspace);
121 
122 
131  static std::map< Size, String > extractCompoundRankingAndFilename_(const String& path_to_sirius_workspace);
132 
141  static std::map< Size, double > extractCompoundRankingAndScore_(const String& path_to_sirius_workspace);
142 
143  };
144 } // namespace OpenMS
This class handles csv files. Currently only loading is implemented. Does NOT support comment lines!
Definition: CsvFile.h:25
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
SiriusTargetDecoySpectra holds the target and/or decoy information for one entry (subdirectory from S...
Definition: SiriusFragmentAnnotation.h:24
SiriusTargetDecoySpectra(MSSpectrum target_spectrum, MSSpectrum decoy_spectrum)
Definition: SiriusFragmentAnnotation.h:31
MSSpectrum target
Definition: SiriusFragmentAnnotation.h:27
MSSpectrum decoy
Definition: SiriusFragmentAnnotation.h:28
Definition: SiriusFragmentAnnotation.h:17
static std::map< Size, double > extractCompoundRankingAndScore_(const String &path_to_sirius_workspace)
extractCompoundRankingAndFilename Extract compound ranking and score (./formula_candidates....
static std::map< std::string, Size > extract_columnname_to_columnindex(const CsvFile &csvfile)
Extract columnname and index based in SIRIUS entries.
static std::vector< MSSpectrum > extractAnnotationsFromSiriusFile(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 (uniq...
static OpenMS::String extractConcatMIDsFromSiriusMS_(const String &path_to_sirius_workspace)
extractConcatMIDsFromSiriusMS Extract m_ids from SIRIUS output (./spectrum.ms) and concatenates them....
static OpenMS::String extractFeatureIDFromSiriusMS_(const String &path_to_sirius_workspace)
extractConcatMIDsFromSiriusMS Extract fid (i.e. original OpenMS feature ID) from SIRIUS output (....
static OpenMS::String extractConcatNativeIDsFromSiriusMS_(const OpenMS::String &path_to_sirius_workspace)
extractConcatNativeIDsFromSiriusMS Extract concatenated native id from SIRIUS output (....
static std::map< Size, String > extractCompoundRankingAndFilename_(const String &path_to_sirius_workspace)
extractCompoundRankingAndFilename Extract compound ranking and filename (./formula_candidates....
static std::vector< SiriusTargetDecoySpectra > extractAndResolveSiriusAnnotations(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 map...
A more convenient string class.
Definition: String.h:34
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19