Skip to content
goguxor edited this page Jun 1, 2026 · 12 revisions

prot2exon

Map protein-domain amino-acid coordinates to their underlying genomic CDS/UTR/intron structure, using any GENCODE, Ensembl, or NCBI RefSeq GTF.

For each input query — a protein_id or a transcript_id, optionally with an aa range — prot2exon answers two related questions:

  1. Mappingwhich exact genomic bases code this domain?
  2. Structurehow is the whole transcript organised into 5′UTR / CDS / 3′UTR / intron, and where does the domain fall on it?

A C++17 binary does the heavy lifting (≤ 1 µs per query on a warm index), a Python wrapper hands you DataFrames, and prot2exon plot renders static figures or an interactive HTML viewer.

The four commands

The whole workflow is four commands, used in order:

prot2exon fetch human                         # 1. get an index  -> see Building an index
prot2exon map   --index human.idx \           # 2. map queries   -> see Mapping
                --bed queries.bed --out-dir results --output all
prot2exon plot  --isoform results/isoform_structure.tsv \   # 3. plot -> see Plotting
                --input-id TP53_DBD --out tp53.pdf
Command Does Page
fetch Download a pre-built index, or download a GTF and build one. Building an index
index Build a binary index from a GTF. Building an index
map Map protein/domain queries to genomic structure. Mapping
plot Render a static (PDF/PNG) or interactive (HTML) figure. Plotting

The same workflow from Python:

import prot2exon as p2e

idx = p2e.fetch_index("human")
mapper = p2e.Mapper(index=idx)
result = mapper.map_batch([
    {"protein_id": "ENSP00000269305", "aa_start": 102, "aa_end": 292, "domain_id": "TP53_DBD"},
])
result.summary          # DataFrame, one row per query
p2e.plot(result, input_id="TP53_DBD", out="tp53.pdf")

New here? Start with Installation, then walk the sidebar top to bottom. The Tutorials and Notebooks page has a copy-paste run from zero to a figure.

Project links

Clone this wiki locally