Class AminoAcid

A class representing an amino acid instance with its backing RNA codon. The constructor enforces validation, and all members are readonly. Therefore, all AminoAcid objects can only exist in a valid state.

Implements

Constructors

Properties

abbrv: string
codon: RNA
hydrophobicity: number
molecularWeight: number
name: string
sideChainType: AminoAcidSideChainType
singleLetterCode: string

Methods

  • Checks if the given amino acid is the same, including the backing codon

    Parameters

    Returns boolean

    True if the amino acid is the same (including the backing codon), false otherwise

    Example

     //comparing the same amino acid with the same codon
    new AminoAcid(new RNA('GCG')).equals(new AminoAcid(new RNA('GCG'))); //returns true

    //comparing the same amino acid with alternate codons
    new AminoAcid(new RNA('GCA')).equals(new AminoAcid(new RNA('GCC'))); //returns false

    //comparing different amino acids
    new AminoAcid(new RNA('UGC')).equals(new AminoAcid(new RNA('GCA'))); //returns false
  • Return all codons that code for this amino acid

    Returns RNA[]

    All codons that code for this amino acid

  • Returns the codon nucleotide sequence

    Returns string

    The codon nucleotide sequence

  • Checks if the given amino acid is the same amino acid regardless of the backing codon

    Parameters

    Returns boolean

    True if the amino acid is the same (without checking the codon), false otherwise

    Example

     //comparing the same amino acid with the same codon
    new AminoAcid(new RNA('GCG')).isAlternateOf(new AminoAcid(new RNA('GCG'))); //returns false
    //comparing the same amino acid with alternate codons
    new AminoAcid(new RNA('GCA')).isAlternateOf(new AminoAcid(new RNA('GCC'))); //returns true