NCBI DNA/RNA to protein translation tabled and genetic codes
Project description
Genetic Codes
A pure Python library with no imports for working with the NCBI Genetic Codes
The NCBI Genetic Codes are central to working with alternate genetic codes. This Python tool kit includes a library that exposes the genetic codes so you can query a codon and get its variants or query a code and get its table.
Installation
You can install pygenetic_code
with pip.
pip install pygenetic_code
pygenetic_code --version
Conda installation is coming.
Usage
Standalone
You can just print translation tables using the pygenetic_code
command. There are currently a couple of options:
json
prints the table in machine readable json format.difference
prints a.tsv
file with the the difference from the standard (translation table 1) codemaxdifference
prints a.tsv
file with the difference from the most common amino acid. The main difference is thatTGA
is more frequently tryptophan than a stop.
Library
In your python application you want to access the translate()
function, that has this signature:
amino_acid = translate(codon, translation_table=1, one_letter=False)
The codon
is the codon that you want to translate as either an RNA (e.g. AUG
) or DNA (e.g. ATG
) sequence. The translation_table
is your required translation table (see the NCBI website for valid tables), and one_letter
is whether to return a three letter amino acid code (e.g. Met
or Ter
) or a one letter amino acid code (e.g. M
or *
).
The library provides other ways to access the genetic codes, and those are exemplified in the pytest
files in tests/
Citing
Please cite this repository as:
Edwards, Robert A. 2023. pygenetic_code. https://github.com/linsalrob/genetic_codes
A full DOI citation is coming soon.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pygenetic_code-0.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4b63b2b0ee776acf780087fc7da9238e94e7c2b047c71cbe43fa4f1b168628f |
|
MD5 | 7aa958ead1381e657f3757df580495f4 |
|
BLAKE2b-256 | 3fde3956838a090b1192897fa5a96db2644fb86f0ce706ef6711e5c36d334ffd |