OpenMS
Loading...
Searching...
No Matches
NuXLModificationsGenerator.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: Timo Sachsenberg $
6// $Authors: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
15#include <vector>
16#include <map>
17#include <set>
18#include <iostream>
19
20namespace OpenMS
21{
22 class AASequence;
23 class Residue;
24 class ResidueModification;
25
42 {
45 {
46 bool operator () (const std::string & p_lhs, const std::string & p_rhs) const
47 {
48 const size_t lhsLength = p_lhs.length() ;
49 const size_t rhsLength = p_rhs.length() ;
50 if(lhsLength == rhsLength)
51 {
52 return (p_lhs < p_rhs) ; // when two strings have the same
53 // length, defaults to the normal
54 // string comparison
55 }
56 return (lhsLength < rhsLength) ; // compares with the length
57 }
58 };
59 std::map<std::string, double> formula2mass;
60
62 using NucleotideFormulas = std::set<std::string, MyStringLengthCompare>;
64 using MapSumFormulaToNucleotideFormulas = std::map<std::string, NucleotideFormulas>;
66 };
67
89 {
90 public:
137 const StringList& nt_groups,
138 const std::set<char>& can_xl,
139 const StringList& mappings,
140 const StringList& modifications,
141 std::string sequence_restriction = "",
142 bool cysteine_adduct = false,
143 Int max_length = 4);
144
157 static const ResidueModification* registerPrecursorAdduct(const std::string& nucleotide_composition,
158 const EmpiricalFormula& adduct_formula,
159 const Residue& residue);
160 private:
169 static bool notInSeq(const std::string& res_seq, const std::string& query);
170
183 static void generateTargetSequences(const std::string& res_seq, Size param_pos, const std::map<char, std::vector<char> >& map_source2target, StringList& target_sequences);
184 };
185}
186
Representation of an empirical formula.
Definition EmpiricalFormula.h:62
Enumerator of precursor-adduct masses for NuXL cross-link searches.
Definition NuXLModificationsGenerator.h:89
static bool notInSeq(const std::string &res_seq, const std::string &query)
Test whether query is not present as a sorted-window permutation of res_seq.
Definition NuXLModificationsGenerator.cpp:64
static void generateTargetSequences(const std::string &res_seq, Size param_pos, const std::map< char, std::vector< char > > &map_source2target, StringList &target_sequences)
Recursively expand res_seq into every target-substituted variant according to map_source2target.
Definition NuXLModificationsGenerator.cpp:540
static NuXLModificationMassesResult initModificationMassesNA(const StringList &target_nucleotides, const StringList &nt_groups, const std::set< char > &can_xl, const StringList &mappings, const StringList &modifications, std::string sequence_restriction="", bool cysteine_adduct=false, Int max_length=4)
Build the full set of precursor adducts (formula + mass + nucleotide composition) for the given confi...
Definition NuXLModificationsGenerator.cpp:84
static const ResidueModification * registerPrecursorAdduct(const std::string &nucleotide_composition, const EmpiricalFormula &adduct_formula, const Residue &residue)
Register the precursor adduct as a named modification of residue.
Definition NuXLModificationsGenerator.cpp:26
Representation of a modification on an amino acid residue.
Definition ResidueModification.h:55
Representation of an amino acid residue.
Definition Residue.h:41
std::set< std::string, MyStringLengthCompare > NucleotideFormulas
Length-ordered set of nucleotide-composition strings producing the same empirical formula.
Definition NuXLModificationsGenerator.h:62
MapSumFormulaToNucleotideFormulas mod_combinations
Empirical formula → all nucleotide compositions yielding that formula (kept as a set because mutation...
Definition NuXLModificationsGenerator.h:65
std::map< std::string, NucleotideFormulas > MapSumFormulaToNucleotideFormulas
Empirical formula → NucleotideFormulas.
Definition NuXLModificationsGenerator.h:64
std::map< std::string, double > formula2mass
Empirical formula → monoisotopic mass.
Definition NuXLModificationsGenerator.h:59
Result of NuXLModificationsGenerator::initModificationMassesNA — empirical formulas with their monois...
Definition NuXLModificationsGenerator.h:42
int Int
Signed integer type.
Definition Types.h:72
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
std::vector< std::string > StringList
Vector of String.
Definition TypeAliases.h:39
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Comparator that orders strings primarily by length (shortest first) and lexicographically within the ...
Definition NuXLModificationsGenerator.h:45
bool operator()(const std::string &p_lhs, const std::string &p_rhs) const
Definition NuXLModificationsGenerator.h:46