Skip to main content

genome_entropy

Python CI Documentation Read the Docs Python 3.10+ License: MIT

genome_entropy quantifies Shannon entropy across biological representations derived from genomic DNA. It finds open reading frames (ORFs), translates proteins, predicts structural-state encodings, and writes a non-redundant JSON record for downstream analysis.

Current multitask ModernProst models produce both Foldseek 3Di and 12-state (12st) encodings. The command remains named encode3di for compatibility. Legacy ModernProst and ProstT5 models produce 3Di only, with 12-state fields written as null.

Capabilities

  • DNA FASTA and GenBank input, including gzip-compressed GenBank files
  • six-frame ORF discovery through the external get_orfs program
  • translation with pygenetic-code
  • 3Di and optional 12-state prediction with ModernProst or ProstT5
  • raw Shannon entropy for DNA, protein, 3Di, and 12-state representations
  • CUDA, ROCm-through-PyTorch's CUDA API, Apple MPS, CPU, and multi-GPU encoding
  • optional XGBoost or PyTorch classification of whether an ORF matches a GenBank CDS

ORF discovery is gene calling, not functional annotation. Likewise, a classifier score is a model estimate of agreement with the supplied GenBank annotations, not biological proof of a gene or function.

Installation

Python 3.10 or newer is required.

pip install genome_entropy
pip install "genome_entropy[ml]"  # optional ML dependencies

get_orfs is not installed by pip; install it separately and ensure the executable is on PATH, or set GET_ORFS_PATH. GPU users should install a PyTorch build appropriate for their CUDA or ROCm platform before installing this package. See the installation guide for development, CPU, GPU, HPC, caching, and offline-job instructions.

Quick start

# Pre-cache the default model when login nodes have internet access
genome_entropy download --model gbouras13/modernprost-50M

# DNA FASTA to unified JSON
genome_entropy run --input genome.fasta --output results.json

# GenBank matching accepts aligned ambiguous X residues in C-terminal suffixes
genome_entropy run --genbank genome.gbk.gz --output results.json

# Protein FASTA directly to structural-state records
genome_entropy encode3di --input proteins.faa --output structures.json

Run genome_entropy --help and genome_entropy COMMAND --help for the installed version's authoritative option list. Detailed examples are in the quick-start guide and CLI reference.

Supported encoders

Canonical model Approximate size 3Di 12-state Status
gbouras13/modernprost-50M 52.6M yes yes default
gbouras13/modernprost-base approximately 1B yes yes supported
gbouras13/modernprost-base-deprecated legacy yes no deprecated
gbouras13/modernprost-profiles-deprecated legacy yes no deprecated
Rostlab/ProstT5 approximately 3B yes no supported
Rostlab/ProstT5_fp16 approximately 3B yes no supported, half precision

ModernProst loads model-provided Python code with trust_remote_code=True. Review and pin model revisions when your threat model requires reproducible, audited remote code. The legacy alias gbouras13/modernprost-profiles resolves to gbouras13/modernprost-profiles-deprecated with a warning.

See the model guide for provenance, precision, devices, multi-GPU behaviour, output semantics, and verified repository links.

Output and entropy

The pipeline writes schema 2.1.0, with features keyed by ORF identifier. Each feature contains location, DNA, protein, 3Di, optional 12-state, metadata, and raw entropy. JSON and JSON-gzip input are supported where documented.

Normalised entropy is deliberately not serialised. Derive it downstream:

from genome_entropy.entropy import normalise_protein_entropy

value = normalise_protein_entropy(feature["entropy"]["protein_entropy"])

The generic formula is raw_entropy / math.log2(alphabet_size), using theoretical alphabet sizes 4 (DNA), 20 (protein), 20 (3Di), and 12 (12-state). See data formats and entropy for the complete schema, coordinate conventions, null semantics, and normalisation helpers.

Documentation and support

This project is alpha software. Report reproducible bugs through the issue tracker and include the package version, command, platform, accelerator, and relevant log output without credentials or sensitive sequence data.

Citation and attribution

Please cite the software release used in your analysis and the methods relevant to your workflow:

  • Heinzinger et al., Bilingual language model for protein sequence and structure (ProstT5), NAR Genomics and Bioinformatics (2024), doi:10.1093/nargab/lqae150.
  • van Kempen et al., Fast and accurate protein structure search with Foldseek, Nature Biotechnology (2024), doi:10.1038/s41587-023-01773-0.
  • Chen and Guestrin, XGBoost: A Scalable Tree Boosting System, KDD (2016), doi:10.1145/2939672.2939785, when using the ML workflow.

ModernProst model repositories and integration were provided by George Bouras. See the full attribution page for model and dependency links.

Licence

genome_entropy is distributed under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genome_entropy-0.1.16.tar.gz (108.2 kB view details)

Uploaded Source

Built Distribution

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

genome_entropy-0.1.16-py3-none-any.whl (88.5 kB view details)

Uploaded Python 3

File details

Details for the file genome_entropy-0.1.16.tar.gz.

File metadata

  • Download URL: genome_entropy-0.1.16.tar.gz
  • Upload date:
  • Size: 108.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for genome_entropy-0.1.16.tar.gz
Algorithm Hash digest
SHA256 f74f6b2a3716ce5f36f81d0881465d5f51002dd8b40d77c541d23ea6392480d0
MD5 02083df1331a68e2ee72e9d8413f1720
BLAKE2b-256 fe11548d78050e9d78ece6dc6c2cfb95b279c0f96ff7a1ab8077872741594eed

See more details on using hashes here.

Provenance

The following attestation bundles were made for genome_entropy-0.1.16.tar.gz:

Publisher: python-publish.yml on linsalrob/genome_entropy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file genome_entropy-0.1.16-py3-none-any.whl.

File metadata

  • Download URL: genome_entropy-0.1.16-py3-none-any.whl
  • Upload date:
  • Size: 88.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for genome_entropy-0.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 ac44c8af7e39542a4da0c7a38927a14880919002ede35f011790eca88f9178dd
MD5 0b98df206d3bfd5582e094cbe344612f
BLAKE2b-256 1e5c6d0d391666c266e390ecfb1ce870185cdf5b4516829db777316b690b1c41

See more details on using hashes here.

Provenance

The following attestation bundles were made for genome_entropy-0.1.16-py3-none-any.whl:

Publisher: python-publish.yml on linsalrob/genome_entropy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.16 This release

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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