Skip to main content

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://comparativechrono.github.io/Gpxil-browser/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

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.

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.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpxil2pxil 0.1.0
File Size Uploaded Provenance Actions
gpxil2pxil-0.1.0.tar.gz 21.8 kB With provenance Details for gpxil2pxil-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gpxil2pxil 0.1.0
File Interpreter ABI Platform Actions
gpxil2pxil-0.1.0-py3-none-any.whl Python 3 none any Details for gpxil2pxil-0.1.0-py3-none-any.whl

Total release size: 40.5 kB

Release files / gpxil2pxil-0.1.0.tar.gz

Download URL gpxil2pxil-0.1.0.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8d3a27bec784276c454b04f6760e7b282df20a64e2f0ad5826bbbc8c32a519b5
BLAKE2b-256 checksum
How to use checksums
e84e564a464f1f6435ca82dddb4b9e610cddbe1ef7952b258c92dec6e91698fa
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 Oct 27, 2026.

Transparency log

Release files / gpxil2pxil-0.1.0-py3-none-any.whl

Download URL gpxil2pxil-0.1.0-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
527922cf04cb94e7f349c815ae75fcfa311b2852a6e25e68064b67c16e6c4a00
BLAKE2b-256 checksum
How to use checksums
77e22ab82ce76aa6729a04094c8db27af950f501c0dd8ac67023c221c3a98d17
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 Oct 27, 2026.

Transparency log

Security for gpxil2pxil 0.1.0

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.

Select from 2 files

Attestation for gpxil2pxil-0.1.0.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 Oct 27, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page