API Reference#

This section contains a complete reference of the pyaragorn module API.

Module#

Bindings to ARAGORN, a (t|mt|tm)RNA gene finder.

pyaragorn.ARAGORN_VERSION#

The version of ARAGORN currently wrapped in PyARAGORN.

Type:

str

pyaragorn.TRANSLATION_TABLES#

A set containing all the translation tables supported by PyARAGORN.

Type:

set of int

Example

PyARAGORN can work on any DNA sequence stored in either a text or a byte array. To load a sequence from one of the common sequence formats, you can use an external dedicated library such as Biopython:

>>> import gzip
>>> import Bio.SeqIO
>>> with gzip.open("CP001621.fna.gz", "rt") as f:
...     record = Bio.SeqIO.read(f, "fasta")

Then use PyARAGORN to find the tRNA genes using the bacterial genetic code (translation table 11):

>>> import pyaragorn
>>> rna_finder = pyaragorn.RNAFinder(11, trna=True, tmrna=False)
>>> for gene in rna_finder.find_rna(record.seq.encode()):
...     print(gene.anticodon, gene.amino_acid, gene.begin, gene.end)
tag Leu 87124 87207
ttt Lys 87210 87285
...

The gene coordinates are 1-indexed, inclusive, similarly to Pyrodigal genes.

References

RNA Finder#

RNAFinder

A configurable RNA gene finder.

Genes#

Gene

A gene identified by ARAGORN.

TRNAGene

A transfer RNA (tRNA) gene.

TMRNAGene

A transfer-messenger RNA (tmRNA) gene.