26 class ResidueModification;
181 static inline std::array<std::string_view, Residue::ResidueType::SizeOfResidueType> names_of_residuetype {
199 "Non-identified ion",
224 const std::string& three_letter_code,
225 const std::string& one_letter_code,
233 const std::set<std::string>& synonyms = std::set<std::string>());
494 std::string name_ =
"unknown";
506 double average_weight_ = 0;
508 double mono_weight_ = 0;
574 std::size_t seed = 0;
580 for (
const auto& syn : r.getSynonyms())
604 for (
const auto& name : r.getLossNames())
610 for (
const auto& formula : r.getLossFormulas())
616 for (
const auto& name : r.getNTermLossNames())
622 for (
const auto& formula : r.getNTermLossFormulas())
628 for (
const auto& formula : r.getLowMassIons())
652 for (
const auto& rs : r.getResidueSets())
OpenMS stores a central database of all residues in the ResidueDB. All (unmodified) residues are adde...
Definition ResidueDB.h:40
Representation of a modification on an amino acid residue.
Definition ResidueModification.h:55
Representation of an amino acid residue.
Definition Residue.h:41
static const double internal_to_b_monoweight_
Definition Residue.h:551
static const double internal_to_x_monoweight_
Definition Residue.h:553
void setPkb(double value)
sets the pkb of the residue
static const EmpiricalFormula & getInternalToZp2Ion()
Definition Residue.h:135
void setResidueSets(const std::set< std::string > &residues_sets)
sets the residue sets the amino acid is contained in (e.g. Natural20)
bool hasNTermNeutralLosses() const
true if N-terminal neutral losses are set
void validateSatelliteIon_(ResidueType type) const
Reject satellite ions whose cleavage residue has no supported loss.
static const double internal_to_z_monoweight_
Definition Residue.h:555
std::string toString() const
double getBackboneBasicityRight() const
returns the C-terminal direction backbone basicity
static const double internal_to_a_monoweight_
Definition Residue.h:550
static const double internal_to_zp1_monoweight_
Definition Residue.h:556
const std::vector< EmpiricalFormula > & getLowMassIons() const
returns a vector of formulas with the low mass markers of the residue
Residue()
Default constructor (needed by pyOpenMS)
bool hasVLoss() const
true if the residue can produce a v-ion via complete side-chain loss
std::vector< EmpiricalFormula > NTerm_loss_formulas_
Definition Residue.h:520
std::set< std::string > synonyms_
Definition Residue.h:496
bool operator==(char one_letter_code) const
equality operator for one letter code
static const double internal_to_nterm_monoweight_
Definition Residue.h:548
static const double internal_to_zp2_monoweight_
Definition Residue.h:557
void setSynonyms(const std::set< std::string > &synonyms)
sets the synonyms
bool hasNeutralLoss() const
true if the residue has neutral loss
const std::string & getName() const
returns the name of the residue
std::vector< std::string > loss_names_
Definition Residue.h:514
EmpiricalFormula getFormula(ResidueType res_type=Full) const
const std::string & getThreeLetterCode() const
returns the name of the residue as three letter code (std::string of size 3)
double getPiValue() const
calculates the isoelectric point using the pk* values
const ResidueModification * getModification() const
returns a pointer to the modification, or a null pointer if none is set
void setPkc(double value)
sets the pkc of the residue
void addSynonym(const std::string &synonym)
adds a synonym
static const double internal_to_full_monoweight_
Definition Residue.h:547
static const double internal_to_y_monoweight_
Definition Residue.h:554
Residue & operator=(const Residue &)=default
Assignment operator.
static const double internal_to_cterm_monoweight_
Definition Residue.h:549
const std::vector< EmpiricalFormula > & getLossFormulas() const
returns the neutral loss formulas
bool operator==(const Residue &residue) const
equality operator
bool isModified() const
true if the residue is a modified one
const std::vector< std::string > & getLossNames() const
gets neutral loss name (if there is one, else returns an empty string)
bool isInResidueSet(const std::string &residue_set)
true if the residue is contained in the set
void setPka(double value)
sets the pka of the residue
std::vector< EmpiricalFormula > loss_formulas_
Definition Residue.h:516
double getPkb() const
returns the pkb of the residue
ResidueType
Definition Residue.h:153
@ CTerminal
only C-terminus
Definition Residue.h:157
@ YIon
MS:1001220 peptide bond up to the C-terminus.
Definition Residue.h:162
@ XIon
MS:1001228 amide/C-alpha bond up to the C-terminus.
Definition Residue.h:161
@ Zp2Ion
MS:1001230 C-alpha/carbonyl carbon bond (free radical, z+2 "ion" with additional abstracted hydrogen)...
Definition Residue.h:165
@ ZIon
MS:1001230 C-alpha/carbonyl carbon bond [CID fragment].
Definition Residue.h:163
@ WIon
MS:1001238 z ion with partial side-chain loss.
Definition Residue.h:175
@ BIonMinusH20
MS:1001222 b ion without water.
Definition Residue.h:167
@ NTerminal
only N-terminus
Definition Residue.h:156
@ BIonMinusNH3
MS:1001232 b ion without ammonia.
Definition Residue.h:169
@ AIon
MS:1001229 N-terminus up to the C-alpha/carbonyl carbon bond.
Definition Residue.h:158
@ Precursor
MS:1001523 Precursor ion.
Definition Residue.h:166
@ YIonMinusH20
MS:1001223 y ion without water.
Definition Residue.h:168
@ NonIdentified
MS:1001240 Non-identified ion.
Definition Residue.h:171
@ VIon
MS:1001237 y ion with complete side-chain loss.
Definition Residue.h:174
@ BIon
MS:1001224 N-terminus up to the peptide bond.
Definition Residue.h:159
@ Zp1Ion
MS:1001230 C-alpha/carbonyl carbon bond (free radical, z+1 "ion") [main EAD fragment].
Definition Residue.h:164
@ CIon
MS:1001231 N-terminus up to the amide/C-alpha bond.
Definition Residue.h:160
@ YIonMinusNH3
MS:1001233 y ion without ammonia.
Definition Residue.h:170
@ Internal
internal residue, without any termini
Definition Residue.h:155
@ Unannotated
no stored annotation
Definition Residue.h:172
@ DIon
MS:1001236 a ion with partial side-chain loss.
Definition Residue.h:173
void setBackboneBasicityRight(double gb_bb_r)
sets the C-terminal direction backbone basicity
friend std::ostream & operator<<(std::ostream &os, const Residue &residue)
ostream iterator to write the residue to a stream
void setSideChainBasicity(double gb_sc)
sets the side chain basicity
Residue & operator=(Residue &&) &=default
Move assignment operator.
std::vector< EmpiricalFormula > low_mass_ions_
low mass markers like immonium ions
Definition Residue.h:523
void setOneLetterCode(const std::string &one_letter_code)
sets the name as one letter code (std::string of size 1)
void setModification(const ResidueModification &mod)
void setLowMassIons(const std::vector< EmpiricalFormula > &low_mass_ions)
sets the low mass marker ions as a vector of formulas
void setLossNames(const std::vector< std::string > &name)
set the neutral loss molecule name
static const EmpiricalFormula & getInternalToZp1Ion()
Definition Residue.h:127
double getSideChainBasicity() const
returns the side chain basicity
static std::string residueTypeToIonLetter(const ResidueType &res_type)
helper for mapping residue types to letters for Text annotations and labels
EmpiricalFormula getVLossFormula() const
Residue(Residue &&)=default
Move constructor.
static const double internal_to_c_monoweight_
Definition Residue.h:552
virtual ~Residue()
Destructor.
const std::vector< EmpiricalFormula > & getNTermLossFormulas() const
returns N-terminal loss formulas
std::vector< std::string > NTerm_loss_names_
Definition Residue.h:518
double getHydrophobicity(const HydrophobicityScaleMethod scale) const
returns the hydrophobicity value of the residue
std::string one_letter_code_
Definition Residue.h:500
static const EmpiricalFormula & getInternalToYIon()
Definition Residue.h:112
void setName(const std::string &name)
sets the name of the residue
void addResidueSet(const std::string &residue_sets)
adds a residue set to the residue sets (e.g. Natural20)
void setModification(const std::string &name)
sets the modification by name; the mod should be present in ModificationsDB
const std::set< std::string > & getResidueSets() const
returns the residue sets this residue is contained in (e.g. Natural20)
bool hasSatelliteLoss(char subtype='\0') const
static const EmpiricalFormula & getInternalToAIon()
Definition Residue.h:81
void setThreeLetterCode(const std::string &three_letter_code)
sets the name of the residue as three letter code (std::string of size 3)
Residue(const std::string &name, const std::string &three_letter_code, const std::string &one_letter_code, const EmpiricalFormula &formula, double pka=0, double pkb=0, double pkc=-1, double gb_sc=0, double gb_bb_l=0, double gb_bb_r=0, const std::set< std::string > &synonyms=std::set< std::string >())
double getBackboneBasicityLeft() const
returns the backbone basicity if located in N-terminal direction
void addLossName(const std::string &name)
add neutral loss molecule name
void setModification(const ResidueModification *mod)
sets the modification by existing ResMod (make sure it exists in ModificationsDB)
static const EmpiricalFormula & getInternalToZIon()
Definition Residue.h:119
void setModificationByDiffMonoMass(double diffMonoMass)
void setAverageWeight(double weight)
sets average weight of the residue (must be full, with N and C-terminus)
static const EmpiricalFormula & getInternalToNTerm()
Definition Residue.h:69
void addNTermLossName(const std::string &name)
adds a N-terminal loss name
double getPka() const
returns the pka of the residue
const std::vector< std::string > & getNTermLossNames() const
returns the N-terminal loss names
static const EmpiricalFormula & getInternalToFull()
Definition Residue.h:63
EmpiricalFormula getSatelliteLossFormula(char subtype='\0') const
static const EmpiricalFormula & getInternalToCIon()
Definition Residue.h:97
bool operator!=(char one_letter_code) const
equality operator for one letter code
void addNTermLossFormula(const EmpiricalFormula &)
adds N-terminal losses
void addLossFormula(const EmpiricalFormula &)
adds a neutral loss formula
double getAverageWeight(ResidueType res_type=Full) const
Residue(const Residue &)=default
Copy constructor.
EmpiricalFormula internal_formula_
Definition Residue.h:504
void setNTermLossFormulas(const std::vector< EmpiricalFormula > &)
sets the N-terminal losses
EmpiricalFormula formula_
Definition Residue.h:502
const std::set< std::string > & getSynonyms() const
returns the synonyms
std::set< std::string > residue_sets_
residue sets this amino acid is contained in
Definition Residue.h:544
void setBackboneBasicityLeft(double gb_bb_l)
sets the N-terminal direction backbone basicity
static const EmpiricalFormula & getInternalToCTerm()
Definition Residue.h:75
void setNTermLossNames(const std::vector< std::string > &name)
sets the N-terminal loss names
static const EmpiricalFormula & getInternalToBIon()
Definition Residue.h:89
const std::string & getModificationName() const
returns the name (ID) of the modification, or an empty string if none is set
double getPkc() const
returns the pkc of the residue if it exists otherwise -1
void setFormula(const EmpiricalFormula &formula)
set empirical formula of the residue (must be full, with N and C-terminus)
double getMonoWeight(ResidueType res_type=Full) const
static std::string getResidueTypeName(const ResidueType res_type)
returns the ion name given as a residue type
void setLossFormulas(const std::vector< EmpiricalFormula > &)
sets the neutral loss formulas
void setMonoWeight(double weight)
sets monoisotopic weight of the residue (must be full, with N and C-terminus)
bool operator!=(const Residue &residue) const
inequality operator
const std::string & getOneLetterCode() const
returns the name as one letter code (std::string of size 1)
static const EmpiricalFormula & getInternalToXIon()
Definition Residue.h:104
std::string three_letter_code_
Definition Residue.h:498
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
std::size_t hash_int(T value) noexcept
Hash for an integer type.
Definition HashUtils.h:107
void hash_combine(std::size_t &seed, std::size_t value) noexcept
Combine a hash value with additional data using golden ratio mixing.
Definition HashUtils.h:87
std::size_t hash_float(T value) noexcept
Hash for a floating point type (float or double).
Definition HashUtils.h:142
std::size_t fnv1a_hash_string(const std::string &s) noexcept
FNV-1a hash for a string.
Definition HashUtils.h:70
HydrophobicityScaleMethod
Enum for different hydrophobicity scales.
Definition CommonEnums.h:50
std::size_t operator()(const OpenMS::Residue &r) const noexcept
Definition Residue.h:572