Skip to content

Commit

Permalink
Moved amino acids predefined selection to AminoAcid
Browse files Browse the repository at this point in the history
  • Loading branch information
douweschulte committed Nov 10, 2023
1 parent ee75c49 commit bdd1e06
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 26 deletions.
49 changes: 49 additions & 0 deletions src/aminoacids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,55 @@ impl AminoAcid {
pub const Tyr: Self = Self::Tyrosine;
pub const Xaa: Self = Self::Unknown;

/// All amino acids with a unique mass (no I/L in favour of J, no B, no Z, and no X)
pub const UNIQUE_MASS_AMINOACIDS: &[Self] = &[
Self::Glycine,
Self::Alanine,
Self::Arginine,
Self::Asparagine,
Self::AsparticAcid,
Self::Cysteine,
Self::Glutamine,
Self::GlutamicAcid,
Self::Histidine,
Self::AmbiguousLeucine,
Self::Lysine,
Self::Methionine,
Self::Phenylalanine,
Self::Proline,
Self::Serine,
Self::Threonine,
Self::Tryptophan,
Self::Tyrosine,
Self::Valine,
Self::Selenocysteine,
Self::Pyrrolysine,
];

/// All 20 canonical amino acids
pub const CANONICAL_AMINOACIDS: &[Self] = &[
Self::Glycine,
Self::Alanine,
Self::Arginine,
Self::Asparagine,
Self::AsparticAcid,
Self::Cysteine,
Self::Glutamine,
Self::GlutamicAcid,
Self::Histidine,
Self::Leucine,
Self::Isoleucine,
Self::Lysine,
Self::Methionine,
Self::Phenylalanine,
Self::Proline,
Self::Serine,
Self::Threonine,
Self::Tryptophan,
Self::Tyrosine,
Self::Valine,
];

// TODO: Take side chain mutations into account (maybe define pyrrolysine as a mutation)
pub fn satellite_ion_fragments(&self) -> Vec<MolecularFormula> {
match self {
Expand Down
27 changes: 1 addition & 26 deletions src/isobaric_sets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,31 +521,6 @@ impl Iterator for IsobaricSetIterator {
}
}

/// All amino acids with a unique mass (no I/L in favour of J, no B, no Z, and no X)
pub const UNIQUE_MASS_AMINOACIDS: &[AminoAcid] = &[
AminoAcid::Glycine,
AminoAcid::Alanine,
AminoAcid::Arginine,
AminoAcid::Asparagine,
AminoAcid::AsparticAcid,
AminoAcid::Cysteine,
AminoAcid::Glutamine,
AminoAcid::GlutamicAcid,
AminoAcid::Histidine,
AminoAcid::AmbiguousLeucine,
AminoAcid::Lysine,
AminoAcid::Methionine,
AminoAcid::Phenylalanine,
AminoAcid::Proline,
AminoAcid::Serine,
AminoAcid::Threonine,
AminoAcid::Tryptophan,
AminoAcid::Tyrosine,
AminoAcid::Valine,
AminoAcid::Selenocysteine,
AminoAcid::Pyrrolysine,
];

#[cfg(test)]
mod tests {
use crate::ComplexPeptide;
Expand All @@ -557,7 +532,7 @@ mod tests {
let sets: Vec<LinearPeptide> = find_isobaric_sets(
pep.bare_formula().unwrap().monoisotopic_mass().unwrap(),
MassTolerance::Ppm(10.0),
UNIQUE_MASS_AMINOACIDS,
AminoAcid::UNIQUE_MASS_AMINOACIDS,
&[],
&[],
None,
Expand Down

0 comments on commit bdd1e06

Please sign in to comment.