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
39 struct OPENMS_DLLAPI NuXLModificationMassesResult
40 {
43 {
44 bool operator () (const std::string & p_lhs, const std::string & p_rhs) const
45 {
46 const size_t lhsLength = p_lhs.length() ;
47 const size_t rhsLength = p_rhs.length() ;
48 if(lhsLength == rhsLength)
49 {
50 return (p_lhs < p_rhs) ; // when two strings have the same
51 // length, defaults to the normal
52 // string comparison
53 }
54 return (lhsLength < rhsLength) ; // compares with the length
55 }
56 };
57 std::map<std::string, double> formula2mass;
58
60 using NucleotideFormulas = std::set<std::string, MyStringLengthCompare>;
62 using MapSumFormulaToNucleotideFormulas = std::map<std::string, NucleotideFormulas>;
64 };
65
86 class OPENMS_DLLAPI NuXLModificationsGenerator
87 {
88 public:
135 const StringList& nt_groups,
136 const std::set<char>& can_xl,
137 const StringList& mappings,
138 const StringList& modifications,
139 std::string sequence_restriction = "",
140 bool cysteine_adduct = false,
141 Int max_length = 4);
142 private:
151 static bool notInSeq(const std::string& res_seq, const std::string& query);
152
165 static void generateTargetSequences(const std::string& res_seq, Size param_pos, const std::map<char, std::vector<char> >& map_source2target, StringList& target_sequences);
166 };
167}
168
Enumerator of precursor-adduct masses for NuXL cross-link searches.
Definition NuXLModificationsGenerator.h:87
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.
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.
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...
std::set< std::string, MyStringLengthCompare > NucleotideFormulas
Length-ordered set of nucleotide-composition strings producing the same empirical formula.
Definition NuXLModificationsGenerator.h:60
MapSumFormulaToNucleotideFormulas mod_combinations
Empirical formula → all nucleotide compositions yielding that formula (kept as a set because mutation...
Definition NuXLModificationsGenerator.h:63
std::map< std::string, NucleotideFormulas > MapSumFormulaToNucleotideFormulas
Empirical formula → NucleotideFormulas.
Definition NuXLModificationsGenerator.h:62
std::map< std::string, double > formula2mass
Empirical formula → monoisotopic mass.
Definition NuXLModificationsGenerator.h:57
Result of NuXLModificationsGenerator::initModificationMassesNA — empirical formulas with their monois...
Definition NuXLModificationsGenerator.h:40
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 ListUtils.h:44
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:43