Skip to main content

Plot transcript models for a gene from a GTF in the terminal.

Project description

txview

Terminal plotter for transcript models of a gene from a GTF annotation.

Install

Latest from main:

pip install "txview @ git+https://github.com/ymvk/monorepo@main#subdirectory=packages/txview"

Pin to a version tag:

pip install "txview @ git+https://github.com/ymvk/monorepo@txview-v0.1.0#subdirectory=packages/txview"

CLI

txview path/to/annotation.gtf BRCA1

Accepts .gtf or .gtf.gz. The gene may be specified by gene_name or gene_id.

Flags:

Flag Default Description
--width terminal width - 30 Display width in columns
--intron-width 5 Columns reserved per truncated intron

Example

BRCA1 [chr17:43044295-43125483] (-)
ENST00000357654  │████████████████████████████╌╌╌╌╌█╌╌╌╌╌█╌╌╌╌╌█╌╌╌╌╌██╌╌╌╌╌██╌╌╌╌╌██╌╌╌╌╌███████████████████████████◀
ENST00000471181  │████████████████████████████╌╌╌╌╌─╌╌╌╌╌─╌╌╌╌╌─╌╌╌╌╌██╌╌╌╌╌──╌╌╌╌╌──╌╌╌╌╌███████████████████████◀
ENST00000586385                                    │╌╌╌╌╌─╌╌╌╌╌█╌╌╌╌╌──╌╌╌╌╌██╌╌╌╌╌──╌╌╌╌╌█◀

Legend:

Char Meaning
Exon
Intron within a transcript's span (e.g. alternative splicing)
Truncated intron region (intergenic-like compression for display)
TSS (5' end) on + strand; on - strand
TTS (3' end)

Python API

from txview import parse_gtf, layout, render

transcripts = parse_gtf("annotation.gtf", "BRCA1")
segments, width = layout(transcripts, total_width=120, intron_width=5)
print(render(transcripts, segments, width))

parse_gtf returns dict[str, Transcript] keyed by transcript_id.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

txview-0.1.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

txview-0.1.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file txview-0.1.1.tar.gz.

File metadata

  • Download URL: txview-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for txview-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0b0708dd3c93a05396faf9a38c099d53999236d78e50b39be860b4b4b7f28a79
MD5 e9c3354d1125f9941e2f52b400996071
BLAKE2b-256 94ae7ae66e19f741536f45c466fb927ce6eaf3788c21272e543146580fcfd583

See more details on using hashes here.

File details

Details for the file txview-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: txview-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for txview-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 caae93893561f873b70ef133b82cdcead116cc16b979a553f4f2a9f5656e454c
MD5 d39f64e8bf513588ae24b0ca9e157011
BLAKE2b-256 9603d1797424618a8e8c5f3971f1638f6d794fa5341b9e38ccb4949ea8ea2102

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page