genome_entropy
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. For those models, genome_entropy also reports the empirical mutual information between aligned 3Di and 12-state assignments in bits. The command remains named encode3di for compatibility. Legacy ModernProst and ProstT5 models produce 3Di only, with 12-state and mutual-information fields written as null.
Capabilities
- DNA FASTA and GenBank input, including gzip-compressed GenBank files
- six-frame ORF discovery through the external
get_orfsprogram - 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
- raw 3Di--12-state mutual information for dual-head ModernProst outputs
- 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.
Extract one GenBank record
The dependency-free bin/extract_genbank_locus utility extracts one record
from a large, uncompressed GenBank file. It matches the complete first token
after LOCUS, writes from that LOCUS line through its terminating // line,
and stops scanning immediately. Build it with a POSIX C compiler:
make -C bin
bin/extract_genbank_locus INPUT.gbk LOCUS_ID OUTPUT.gbk
For example, bin/extract_genbank_locus assemblies.gb NC_000913.3 ecoli.gb
matches NC_000913.3 exactly; it will not match NC_000913.30. The output is
created only after a complete matching record is found. Gzip input is not
supported by this standalone utility; decompress it first.
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.2.0, with features keyed by ORF identifier. Each feature contains location, DNA, protein, 3Di, optional 12-state, metadata, raw entropy, and (when available) raw 3Di--12-state mutual information. 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
- GitHub Pages documentation
- Read the Docs
- Issue tracker
- Machine-learning guide
- NVIDIA and ROCm SLURM notes
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file genome_entropy-0.2.0.tar.gz.
File metadata
- Download URL: genome_entropy-0.2.0.tar.gz
- Upload date:
- Size: 115.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
112c894e1d278e3026196d3ef08ad56ad0e282532aa02ed11a3a50a39cff2148
|
|
| MD5 |
dd0862b9c33c175175b8497725780cd2
|
|
| BLAKE2b-256 |
e94fad535f390d094e7546bc4ee4726fcb7e4ea3ad745cda54f8f7ad502b47c9
|
Provenance
The following attestation bundles were made for genome_entropy-0.2.0.tar.gz:
Publisher:
python-publish.yml on linsalrob/genome_entropy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genome_entropy-0.2.0.tar.gz -
Subject digest:
112c894e1d278e3026196d3ef08ad56ad0e282532aa02ed11a3a50a39cff2148 - Sigstore transparency entry: 2496166418
- Sigstore integration time:
-
Permalink:
linsalrob/genome_entropy@90c8c15609134256e622b6ab94cb0081fa4ddc90 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/linsalrob
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@90c8c15609134256e622b6ab94cb0081fa4ddc90 -
Trigger Event:
release
-
Statement type:
File details
Details for the file genome_entropy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: genome_entropy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 92.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e18d2de3ae8e5d66fed7f41cb57640621dde58d77bc685187bb37fecf7454a53
|
|
| MD5 |
63716b7427180739deb4d05295067e2a
|
|
| BLAKE2b-256 |
b666d0292a8c64ec8d3b012534b08d2e331113b66d6aec701ed16b17fbe3009d
|
Provenance
The following attestation bundles were made for genome_entropy-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on linsalrob/genome_entropy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genome_entropy-0.2.0-py3-none-any.whl -
Subject digest:
e18d2de3ae8e5d66fed7f41cb57640621dde58d77bc685187bb37fecf7454a53 - Sigstore transparency entry: 2496166464
- Sigstore integration time:
-
Permalink:
linsalrob/genome_entropy@90c8c15609134256e622b6ab94cb0081fa4ddc90 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/linsalrob
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@90c8c15609134256e622b6ab94cb0081fa4ddc90 -
Trigger Event:
release
-
Statement type: