one_letter_code#

biotite.structure.info.one_letter_code(res_name)[source]#

Get the one-letter code of a residue/compound, based on the PDB chemical components dictionary.

The one-letter code is only defined for amino acids and nucleotides and for compounds that are structurally similar to them.

Parameters:
res_namestr

The up to 3-letter residue name.

Returns:
one_letter_codestr or None

The one-letter code. None if the compound is not present in the CCD or if no one-letter code is defined for this compound.

Examples

Get the one letter code for an amino acid (or a nucleotide).

>>> print(full_name("ALA"))
ALANINE
>>> print(one_letter_code("ALA"))
A

For similar compounds, the one-letter code is also defined.

>>> print(full_name("DAL"))
D-ALANINE
>>> print(one_letter_code("DAL"))
A

For other compounds, the one-letter code is not defined.

>>> print(full_name("MAN"))
alpha-D-mannopyranose
>>> print(one_letter_code("MAN"))
None