An RNA codon that codes for an amino acid
InvalidCodonError Thrown if the codon does not code for an amino acid
Readonly
abbrvReadonly
chargeReadonly
codonReadonly
hydrophobicityReadonly
molecularReadonly
nameReadonly
polarityReadonly
sideReadonly
singleChecks if the given amino acid is the same, including the backing codon
The amino acid to check
True if the amino acid is the same (including the backing codon), false otherwise
//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
Checks if the given amino acid is the same amino acid regardless of the backing codon
The amino acid to check
True if the amino acid is the same (without checking the codon), false otherwise
//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
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.