pretextannotate
PretextAnnotate is a script originally written by Karen van Niekerk (Sanger GRIT) in order to add chromosome annotations to a PNG image produced by PretextSnapshot.
/src/fonts/OpenSans-Regular.ttf - Open Sans font file used for text rendering.
Font file is taken from https://fonts.google.com/specimen/Open+Sans/ and is licensed under Open Font License.
original_scripts - Contains the original scripts used in this project, this is simply for archiving and reference purposes.
Installation
git clone https://github.com/sanger-tol/pretextannotate.git
cd pretextannotate
pip install .
Coming soon
pip install pretextannotate
Usage
To make full use of the script (and politeness to NCBI) you must set the environment variables:
ENTREZ_EMAIL
ENTREZ_API_KEY
You can generate your own API keys by creating an account on https://www.ncbi.nlm.nih.gov/account/ with your ORCID.
pretextannotate -h
pretextannotate \\
--pretext_file src/tests/ilDryDodo1.1_normal_FullMap.png \\
--output ./ \\
--prefix HELLO \\
--gca_accession GCA_965178025.1
pretextannotate \\
--pretext_file src/tests/ilDryDodo1.1_normal_FullMap.png \\
--output ./ \\
--prefix HELLO \\
--index GCA_965178025.1.sizes
As of version 1.1.3, --sizes has been replaces with --index to allow for genome, sizes and fai file types.
Expected output
With the input pretext snapshot:
As well as the arguments used in the Usage section.
The output should be a PNG, gif and tif file resembling:
There will also be a pretextannotation.log file containing, in this case:
2026-02-12 12:55:46,100 [INFO] [Pretext Annotation] Starting Pretext Annotation
2026-02-12 12:55:46,100 [INFO] [Pretext Annotation] PretextSnapshot: src/tests/ilDryDodo1.1_normal_FullMap.png | WITH | context_dict: {"accession": "GCA_965178025.1"}
2026-02-12 12:55:46,100 [INFO] [Pretext Annotation] Input Snapshot Image is src/tests/ilDryDodo1.1_normal_FullMap.png
2026-02-12 12:55:46,100 [INFO] [Pretext Annotation] Output will be saved at .//HELLO_annotated_pretext.png
2026-02-12 12:55:46,100 [INFO] [Pretext Annotation] Starting Pretext Annotation Process
2026-02-12 12:55:46,470 [INFO] [Pretext Annotation] Adjusted font size: 60 for 31 chromosomes
2026-02-12 12:55:47,355 [INFO] [Pretext Annotation] Saved labelled PNG → .//HELLO_annotated_pretext.png
2026-02-12 12:55:47,783 [INFO] [Pretext Annotation] Converted .//HELLO_annotated_pretext.png → .//HELLO_annotated_pretext.tif, .//HELLO_annotated_pretext.gif
2026-02-12 12:55:47,783 [INFO] [Pretext Annotation] Converted to TIFF & GIF → .//HELLO_annotated_pretext.tif, .//HELLO_annotated_pretext.gif
Future ToDo's:
- Graphs to right side
- Telomere, gap, coverage, repeats, GC?
- Tests
Metadata
Release files for pretextannotate 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pretextannotate-1.1.3.tar.gz | 99.1 kB | With provenance | Details for pretextannotate-1.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pretextannotate-1.1.3-py3-none-any.whl | Python 3 | none | any | Details for pretextannotate-1.1.3-py3-none-any.whl |
Total release size: 197.2 kB
Release files / pretextannotate-1.1.3.tar.gz
| Download URL | pretextannotate-1.1.3.tar.gz |
|---|---|
| Size | 99.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a44cb6a6ff0082dab94e671aa56e0f7b20921e226f71cf1d1f3fa90b543348b1
|
|
BLAKE2b-256 checksum How to use checksums |
fe51cbe09e23efed517889a0a7c3b54a7a8596945b0fc8391aef66938c140e76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.
Transparency logRelease files / pretextannotate-1.1.3-py3-none-any.whl
| Download URL | pretextannotate-1.1.3-py3-none-any.whl |
|---|---|
| Size | 98.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c37120b4e226e35790ef3dbb74bfd55508695c33bfa3e44349131bba4f982f1e
|
|
BLAKE2b-256 checksum How to use checksums |
b8d4a7e0891803f97343c17f340e4f24ceba02fa9f6a229e5dd8a1dcb7925dc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.
Transparency logSecurity for pretextannotate 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pretextannotate-1.1.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.