gpxil2pxil
Pictures of genes, transcripts and proteins, as pxil files, from a gpxil genome: from its reference, or from either of a person's haplotypes, so that someone's own version of a protein can be seen and compared with the reference.
Genes and transcripts come from the Gpxil browser's gene files (every Ensembl release 116 transcript on GRCh38, read from the web a gene at a time), or from any GTF file (Ensembl or GENCODE).
pip install gpxil2pxil
# TP53 from the GRCh38 reference, read from the Gpxil browser (nothing to download first)
gpxil2pxil https://pixelverse.cam/data/grch38/gpxil/chr17.gpxil.tif TP53
# a person's TP53 and BRCA1, both haplotypes and the reference, every transcript
gpxil2pxil HG002.gpxil.tif TP53 BRCA1 --haplotypes all --transcripts all -o pictures
# the transcripts of a gene, to choose from
gpxil2pxil HG002.gpxil.tif TP53 --list
# another assembly or annotation: a GTF
gpxil2pxil genome.gpxil.tif MYGENE --annotation Homo_sapiens.GRCh38.116.gtf.gz
# a window: TP53 and 100 kb either side, cut out of HG002's genome (gpxil subset … chr17:7,561,779-7,787,546)
gpxil2pxil HG002_TP53.gpxil.tif TP53 --haplotypes all
To read the Gpxil browser's gene files from a copy of them (a folder, or
another web address), set GPXIL_BROWSER_DATA to it, or give it as
--annotation.
A gpxil file can hold windows (gpxil 0.3): stretches of a chromosome that keep
its positions, cut out of a genome with gpxil subset FILE chr17:7,561,779-7,787,546
or saved from GpxilStudio's viewer. A gene is found in the window that holds it,
so a window of a few kilobytes gives the same files as the whole genome
(windows need gpxiltools 0.7 or later). A window kept without its reference
plane takes its bases from --reference, such as the Gpxil browser's
chromosome.
Files are named with the Ensembl IDs, and with the sample and haplotype when they come from one:
| File | What it holds |
|---|---|
TP53_ENSG00000141510.gene.pxil.png |
the gene's genomic sequence, 5′ to 3′, introns and soft-masked repeats included |
TP53-201_ENST00000269305.transcript.pxil.png |
the spliced transcript, 5′ to 3′ |
TP53-201_ENSP00000269305.protein.pxil.png |
the protein, from the start codon to the stop codon (*) |
TP53-201_ENSP00000269305_HG002-hap1.protein.pxil.png |
the same protein, made from HG002's first haplotype |
Each file's metadata (python -m pxil --info FILE) gives its coordinates,
exons, coding region, genetic code and, for a haplotype, the sample and how it
differs from the reference ("notes": ["differs from the reference: P72R"]).
How a haplotype's sequence is made
The sample's genotypes in the gpxil file are applied to the reference, as
gpxil fasta --which 1 does: substitutions replace bases, deletions remove
them, insertions follow their anchor base, and bases whose state is not known
become N. A transcript of a haplotype is its sequence over each exon, joined.
Its protein is translated from the annotated start codon until the first stop
codon, so a frameshift is followed into the 3′ UTR, and a protein whose stop
codon is lost ends at the transcript's end (and the file says so).
Selenocysteines (TGA read as U) are kept where Ensembl annotates them, and
mitochondrial genes use the vertebrate mitochondrial code.
Python
from gpxiltools import GpxilFile
from gpxil2pxil import BrowserData, Source, make
gene = BrowserData().find("TP53") # or GTF("genes.gtf.gz").find("TP53")
with GpxilFile("HG002.gpxil.tif") as g:
for f in make(g, gene, haplotypes=(None, 1, 2), out_dir="TP53"):
print(f.path, f.notes)
hap1 = Source(g, 1).protein(gene.canonical()) # the sequence itself, as a string
Tests
pip install -e ".[test]"
pytest # a made-up genome whose genes and variants are known exactly
GPXIL2PXIL_NETWORK=1 pytest # also TP53 from the Gpxil browser
It began in Gpxil-scratchpad, where the tools for gpxil are tried out first, and runs in GpxilStudio, in the browser.
Licence
Copyright © 2026 Chronomic Medicine Group, Department of Genomic Medicine, University of Cambridge. Released under the MIT licence.
Metadata
Release files for gpxil2pxil 0.2.1
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 |
|---|---|---|---|---|
| gpxil2pxil-0.2.1.tar.gz | 23.3 kB | With provenance | Details for gpxil2pxil-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gpxil2pxil-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for gpxil2pxil-0.2.1-py3-none-any.whl |
Total release size: 42.9 kB
Release files / gpxil2pxil-0.2.1.tar.gz
| Download URL | gpxil2pxil-0.2.1.tar.gz |
|---|---|
| Size | 23.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f25a9f6202584da27ce5f54a6ea1c244d8810ab644a31379c2a9d237fe7b3940
|
|
BLAKE2b-256 checksum How to use checksums |
bcd201eeba4fe2692a8d5f79126c744e816e236b82cefaf1a8838b1e4857a2e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 2, 2026.
Transparency logRelease files / gpxil2pxil-0.2.1-py3-none-any.whl
| Download URL | gpxil2pxil-0.2.1-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9359ea9f9696b7d6a6ea6b43849321a8f04cb4d54fc49c8342ab83c3982ed06a
|
|
BLAKE2b-256 checksum How to use checksums |
28f83fd71e78c28f0c1089cf8f84b76e60f185145fd8eaddd18fcf6b1c311594
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 2, 2026.
Transparency logSecurity for gpxil2pxil 0.2.1
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 gpxil2pxil-0.2.1.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 Nov 2, 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.