Amino Acids

The amino acids module provides lookups for standard and non-standard amino acids.

class tacular.amino_acids.AALookup(data)[source]

Bases: object

Parameters:

data (dict[AminoAcid, AminoAcidInfo])

property ambiguous_amino_acids: tuple[AminoAcidInfo, ...][source]

Get ambiguous amino acids (B, J, X, Z)

composition(key)[source]

Get the elemental composition of the amino acid identified by key

Return type:

dict[ElementInfo, int]

Parameters:

key (str)

get(key, default=None)[source]

Get amino acid info or None if not found

Return type:

AminoAcidInfo | None

Parameters:
is_ambiguous(key)[source]

Check if the amino acid identified by key is ambiguous

Return type:

bool

Parameters:

key (str)

is_mass_ambiguous(key)[source]

Check if the amino acid identified by key has mass ambiguity

Return type:

bool

Parameters:

key (str)

is_mass_unambiguous(key)[source]

Check if the amino acid identified by key has no mass ambiguity

Return type:

bool

Parameters:

key (str)

is_unambiguous(key)[source]

Check if the amino acid identified by key is unambiguous

Return type:

bool

Parameters:

key (str)

mass(key, monoisotopic=True)[source]

Get the mass of the amino acid identified by key

Return type:

float

Parameters:
  • key (str)

  • monoisotopic (bool)

property mass_amino_acids: tuple[AminoAcidInfo, ...][source]

Get amino acids that have defined masses

property mass_unambiguous_amino_acids: tuple[AminoAcidInfo, ...][source]

Get unambiguous amino acids that have defined masses

name(name)[source]
Return type:

AminoAcidInfo

Parameters:

name (str)

one_letter(code)[source]
Return type:

AminoAcidInfo

Parameters:

code (str)

property ordered_amino_acids: tuple[AminoAcidInfo, ...][source]

Get amino acids in order of one-letter codes A-Z

three_letter(code)[source]
Return type:

AminoAcidInfo

Parameters:

code (str)

property unambiguous_amino_acids: tuple[AminoAcidInfo, ...][source]

Get unambiguous amino acids (all except B, J, X, Z)

class tacular.amino_acids.AminoAcid(*values)[source]

Bases: StrEnum

Enumeration of amino acid single-letter codes.

A = 'A'
B = 'B'
C = 'C'
D = 'D'
E = 'E'
F = 'F'
G = 'G'
H = 'H'
I = 'I'
J = 'J'
K = 'K'
L = 'L'
M = 'M'
N = 'N'
O = 'O'
P = 'P'
Q = 'Q'
R = 'R'
S = 'S'
T = 'T'
U = 'U'
V = 'V'
W = 'W'
X = 'X'
Y = 'Y'
Z = 'Z'
classmethod from_str(aa)[source]

Get AminoAcid enum from string

Return type:

AminoAcid

Parameters:

aa (str)

class tacular.amino_acids.AminoAcidInfo(id, name, three_letter_code, formula, monoisotopic_mass, average_mass, dict_composition, is_mass_ambiguous=False, is_ambiguous=False)[source]

Bases: object

Information about an amino acid

Parameters:
  • id (str)

  • name (str)

  • three_letter_code (str)

  • formula (str | None)

  • monoisotopic_mass (float | None)

  • average_mass (float | None)

  • dict_composition (dict[str, int] | None)

  • is_mass_ambiguous (bool)

  • is_ambiguous (bool)

average_mass: float | None
property composition: Counter[ElementInfo] | None[source]

Get the composition as a Counter

dict_composition: dict[str, int] | None
formula: str | None
get_mass(monoisotopic=True)[source]

Get the mass of the amino acid

Return type:

float | None

Parameters:

monoisotopic (bool)

id: str
is_ambiguous: bool = False
is_mass_ambiguous: bool = False
monoisotopic_mass: float | None
name: str
property one_letter_code: str
three_letter_code: str
to_dict(float_precision=6)[source]

Convert the AminoAcidInfo to a dictionary

Return type:

dict[str, object]

Parameters:

float_precision (int)