Skip to main content

A Python package designed for visualizing RNA isoform structures and expression levels by leveraging Plotly for interactive plotting and Polars for efficient data manipulation, enabling the creation of fast-rendering, interactive plots.

Project description

RNApysoforms

Run Tests Codecov test coverage Lifecycle: stable GitHub issues GitHub pulls Documentation Status DOI

RNApysoforms is a Python package designed for visualizing RNA isoform structures and expression levels. Leveraging Plotly for interactive plotting and Polars for efficient data manipulation, it enables the creation of fast-rendering, interactive plots suitable for both local and web applications. Inspired by the R package ggtranscript, RNApysoforms brings similar RNA visualization capabilities to the Python ecosystem, facilitating effective exploration and presentation of RNA sequencing data.

Cite us:

https://doi.org/10.1093/bioadv/vbaf057

Important

RNApysoforms expects feature start and end coordinates in GTF format, where coordinates are 1-indexed and inclusive on both ends.

Installation

You can install RNApysoforms using pip:

pip install RNApysoforms

Quick Start

Basic usage (quick start)

More vignettes (usage examples)

Rescaling introns for a prettier RNA isoform structure plot

Plotting RNA isoform structure and expression

Plotting RNA isoform structure and normalized expression

Test data and documentation

Download small test dataset

Function documentation and vignettes

Issues

Please go through the documentation and vignettes before submitting an issue.

Contributing

Contributions to RNApysoforms are welcome! Please feel free to submit a Pull Request.

The function implementations are under the src/RNApysoforms directory.

Functions

  • calculate_exon_number(): Assigns exon numbers to exons, CDS, and introns within a genomic annotation dataset based on transcript structure and strand direction.

  • gene_filtering(): Filters genomic annotations and optionally an expression matrix for a specific gene, with options to order and select top expressed transcripts.

  • make_plot(): Creates a Plotly figure panel for transcript structure plots and/or expression data plots.

  • make_traces(): Generates Plotly traces for visualizing transcript structures and expression data.

  • read_expression_matrix(): Loads and processes an expression matrix, optionally merging with metadata, performing CPM normalization, and calculating relative transcript abundance.

  • read_ensembl_gtf(): Reads an ENSEMBL GTF (Gene Transfer Format) file and returns the data as a Polars DataFrame.

  • shorten_gaps(): Shortens intron and transcript start gaps between exons in genomic annotations to enhance visualization.

  • to_intron(): Converts exon coordinates into corresponding intron coordinates within a genomic annotation dataset.

License

This project is licensed under the MIT License.

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

rnapysoforms-1.3.0.tar.gz (37.3 kB view details)

Uploaded Source

Built Distribution

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

rnapysoforms-1.3.0-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file rnapysoforms-1.3.0.tar.gz.

File metadata

  • Download URL: rnapysoforms-1.3.0.tar.gz
  • Upload date:
  • Size: 37.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.12

File hashes

Hashes for rnapysoforms-1.3.0.tar.gz
Algorithm Hash digest
SHA256 d0db1aff8f3eacea4bd6f3df179914ed7d8869a3af9d4326addf506c9d587f0c
MD5 b9550df16b10524b9a288428ce54a986
BLAKE2b-256 8eafa940d96ff763994229511325d79001e6c2ab2039a060358f461bfe3b0865

See more details on using hashes here.

File details

Details for the file rnapysoforms-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: rnapysoforms-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.12

File hashes

Hashes for rnapysoforms-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e67661b1a1a1c830506bde6906d032636f2c7fd240bb42c3a7c7b6d5ec86b1d3
MD5 030c77cf161dd41e9a8bda2a5c9c5e75
BLAKE2b-256 aa4340a7a97b184a11d19444b7ec8d33f27118042fe586dea9153bb163088398

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