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

# 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.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.2.0
File Size Uploaded Provenance Actions
gpxil2pxil-0.2.0.tar.gz 23.3 kB With provenance Details for gpxil2pxil-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 42.9 kB

Release files / gpxil2pxil-0.2.0.tar.gz

Download URL gpxil2pxil-0.2.0.tar.gz
Size 23.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3ad1189c717cedf5d11eaede58da512135a6be906561f24f5186c235befabea7
BLAKE2b-256 checksum
How to use checksums
da0691fc89b73acd4962235ba5c6a32b42f8be5b995245a7e90f9f64a079a500
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 28, 2026.

Transparency log

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

Download URL gpxil2pxil-0.2.0-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f073ed7ec835608dfdeec65594e901cc69cdabccbbebe186df47237ec6771ac4
BLAKE2b-256 checksum
How to use checksums
6e47200722d586a8eb8a75128bf4e5754e33710f8839b332d6d94052fe50fa46
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 28, 2026.

Transparency log

Security for gpxil2pxil 0.2.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.2.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 28, 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