Skip to main content

Python interface to Prodigal, an ORF finder for genomes, progenomes and metagenomes.

Project description

🔥 Pyrodigal Stars

Python interface to Prodigal, an ORF finder for genomes, progenomes and metagenomes.

GitLabCI AppVeyor Coverage License PyPI Bioconda Wheel Python Versions Python Implementations Source GitHub issues Changelog Downloads DOI

🗺️ Overview

Pyrodigal is a Python module that provides bindings to Prodigal using Cython. It directly interacts with the Prodigal internals, which has the following advantages:

  • single dependency: Pyrodigal is distributed as a Python package, so you can add it as a dependency to your project, and stop worrying about the Prodigal binary being present on the end-user machine.
  • no intermediate files: everything happens in memory, in a Python object you fully control, so you don't have to manually import and export sequences to pass to the Prodigal CLI.
  • no input formatting: sequences are manipulated directly as strings, which leverages the issue of formatting your input to FASTA for Prodigal.
  • lower memory usage: Pyrodigal is slightly more conservative when it comes to using memory, which can help process very large sequences.

📋 Features

The library now features everything needed to run Prodigal in single or metagenomic mode. It is still missing some features of the CLI:

Roadmap:

  • ✔️ Metagenomic mode
  • ✔️ Single mode
  • ❌ External training file support (-t flag)
  • ❌ Region masking (-m flag)

🐏 Memory

Contrary to the Prodigal command line, Pyrodigal attempts to be more conservative about memory usage. This means that most of the allocations will be lazy, and that some functions will reallocate their results to exact-sized arrays when it's possible. This leads to Pyrodigal using about 30% less memory, but with a little bit more overhead to compute the size of buffers in advance.

🧶 Thread-safety

pyrodigal.Pyrodigal instances are thread-safe, and use an internal lock to prevent parallel calls to their methods from overwriting the internal buffers. However, a better solution to process sequences in parallel is to use a consumer/worker pattern, and have on Pyrodigal instance in each worker. Using a pool spawning Pyrodigal instances on the fly is also fine, but prevents recycling memory:

with multiprocessing.pool.ThreadPool() as pool:
    pool.map(lambda s: Pyrodigal(meta=True).find_genes(s), sequences)

🔧 Installing

Pyrodigal can be installed directly from PyPI, which hosts some pre-built CPython wheels for x86-64 Unix and Windows platforms, as well as the code required to compile from source with Cython:

$ pip install pyrodigal

Otherwise, Pyrodigal is also available as a Bioconda package:

$ conda install -c bioconda pyrodigal

💡 Example

Using Biopython, load a sequence from a GenBank file, import Pyrodigal to find all genes it contains, and print the proteins in FASTA format:

record = Bio.SeqIO.read("sequence.gbk", "genbank")
p = pyrodigal.Pyrodigal(meta=True)

for i, gene in enumerate(p.find_genes(str(record.seq))):
    print(f"> {record.id}_{i+1}")
    print(textwrap.fill(record.translate()))

To use Pyrodigal in single mode, you must explicitly call Pyrodigal.train with the sequence you want to use for training before trying to find genes, or you will get a RuntimeError:

p = pyrodigal.Pyrodigal()
p.train(str(record.seq))
genes = p.find_genes(str(record.seq))

📜 License

This library, like the original Prodigal software, is provided under the GNU General Public License v3.0.

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

pyrodigal-0.4.0.tar.gz (742.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyrodigal-0.4.0-cp39-cp39-manylinux2010_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

pyrodigal-0.4.0-cp38-cp38-win_amd64.whl (721.5 kB view details)

Uploaded CPython 3.8Windows x86-64

pyrodigal-0.4.0-cp38-cp38-manylinux2010_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

pyrodigal-0.4.0-cp37-cp37m-win_amd64.whl (720.3 kB view details)

Uploaded CPython 3.7mWindows x86-64

pyrodigal-0.4.0-cp37-cp37m-manylinux2010_x86_64.whl (981.5 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

pyrodigal-0.4.0-cp36-cp36m-win_amd64.whl (720.2 kB view details)

Uploaded CPython 3.6mWindows x86-64

pyrodigal-0.4.0-cp36-cp36m-manylinux2010_x86_64.whl (981.0 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

pyrodigal-0.4.0-cp35-cp35m-win_amd64.whl (719.2 kB view details)

Uploaded CPython 3.5mWindows x86-64

File details

Details for the file pyrodigal-0.4.0.tar.gz.

File metadata

  • Download URL: pyrodigal-0.4.0.tar.gz
  • Upload date:
  • Size: 742.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.9

File hashes

Hashes for pyrodigal-0.4.0.tar.gz
Algorithm Hash digest
SHA256 dc3e04f50c05973bd9c44c1ced7c01d4ed1dd64711e098e8ca7d678f46b32081
MD5 62377fce4660c4f750aeec234a560d7c
BLAKE2b-256 529c02a3a68d7cd8c09a866ffa6cc079d0a041e8364f43c2bf5c62f8715fce8e

See more details on using hashes here.

File details

Details for the file pyrodigal-0.4.0-cp39-cp39-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pyrodigal-0.4.0-cp39-cp39-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for pyrodigal-0.4.0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 379f3fa0f589021487c07b90abf622e5de3d6b56a56141525a474b745f7ec8b2
MD5 99b27effc774d2a92372ef513a76722a
BLAKE2b-256 dd04742f023acef3d425c83ce15bbfb2b3884876d921867cd4df3658e17759d6

See more details on using hashes here.

File details

Details for the file pyrodigal-0.4.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pyrodigal-0.4.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 721.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.0

File hashes

Hashes for pyrodigal-0.4.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c6ce0c91ed2e73cd46d6c6ba5c96044375a7902895c65827a4cb3080db5d6a75
MD5 6bc092abbe024972e0d608b37e33ef68
BLAKE2b-256 d7cadd065c72d0f85a8d84f3150f1fdb3e5a325c4b548b5d821ca935b2989f74

See more details on using hashes here.

File details

Details for the file pyrodigal-0.4.0-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pyrodigal-0.4.0-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.7

File hashes

Hashes for pyrodigal-0.4.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 a9b8837dcab3400fbf177305f0eeec6ddef530d78bfd6281042450131e6746eb
MD5 2bf6a842d9697529eafe6d2f65896570
BLAKE2b-256 b5b2a2b01a9e169aab76232a87e869adaeb2e2cb71e608c187f0ba1187d8c813

See more details on using hashes here.

File details

Details for the file pyrodigal-0.4.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pyrodigal-0.4.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 720.3 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.5

File hashes

Hashes for pyrodigal-0.4.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 467bbcbeeb35eabd129032a21767a205faea9c14855873d2da0a820ab74bdabe
MD5 4a5013f05b6ede5888091546fdc03a21
BLAKE2b-256 696765e73e3e8164a905b92c0d10d787f41d01cd6eef26aa7cffb2f286caf617

See more details on using hashes here.

File details

Details for the file pyrodigal-0.4.0-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pyrodigal-0.4.0-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 981.5 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.9

File hashes

Hashes for pyrodigal-0.4.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 0e6068dea8311ec66a622d57e01738d583c6a0c9efccd2fad974a513e288d2e5
MD5 07323f9f0298939979ddaf3be877cbd0
BLAKE2b-256 8ebf7165534e1c8849dd47144708889902e925d2b7c117d09f29b02972869970

See more details on using hashes here.

File details

Details for the file pyrodigal-0.4.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pyrodigal-0.4.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 720.2 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.6.8

File hashes

Hashes for pyrodigal-0.4.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e7ae430cdbe6e1afc94b12a78551b31cbcc61d9392265edd039dcbd1cb9c0fb1
MD5 cecc302bffd9e99a48a12661fcf76414
BLAKE2b-256 f542551e527a9267fa006cbdea59304b70c71a1f7b592de18f7a4b72e51d837c

See more details on using hashes here.

File details

Details for the file pyrodigal-0.4.0-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pyrodigal-0.4.0-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 981.0 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.6.12

File hashes

Hashes for pyrodigal-0.4.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 e88b7dd1a6eb09388a1b2a30c0e98db4cea957ff3c1a95de031b2820825618a7
MD5 2dcecb0ed20f1fb6d042e85749a8427f
BLAKE2b-256 0faa74c8832ea81fdc23c5c0143baea7d5f5eb62a51269fa60ddab2f5e4642e4

See more details on using hashes here.

File details

Details for the file pyrodigal-0.4.0-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: pyrodigal-0.4.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 719.2 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.5.4

File hashes

Hashes for pyrodigal-0.4.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 4b2c9853c190caaaff76654d12dfaf68e6f2d3a90e338587bde5df9564d23dde
MD5 b304b27231549120a65b58da04580666
BLAKE2b-256 9b8b168aae6259383b7f0da80b1829034072faee08007a9d688bebce0d87da54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page