Skip to main content

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.

  • process_expression_matrix(): Same as read_expression_matrix(), but takes a polars dataframe as input instead of a file path.

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

  • process_ensembl_gtf(): Same as read_ensembl_gtf(), but takes a polars dataframe as input instead of a file path.

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

Metadata

Release files for RNApysoforms 1.3.1

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

Source distribution (sdist)

Source distribution for RNApysoforms 1.3.1
File Size Uploaded
rnapysoforms-1.3.1.tar.gz 37.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for RNApysoforms 1.3.1
File Interpreter ABI Platform
rnapysoforms-1.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 78.4 kB

Release files / rnapysoforms-1.3.1.tar.gz

Download URL rnapysoforms-1.3.1.tar.gz
Size 37.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6b3949925e46f5d0f8ca3cf19e614126efece79773dfe2088ef69336f2997e8e
BLAKE2b-256 checksum
How to use checksums
9b09a411ad39ed5580c063e4a2ea8db3cc67b1787e2d41d33c95df2268fcb9ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.12

Release files / rnapysoforms-1.3.1-py3-none-any.whl

Download URL rnapysoforms-1.3.1-py3-none-any.whl
Size 40.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
909ed271f2cfb789370a501e4c3b6b493b1e4ca95c13535ba19893f80a48fe99
BLAKE2b-256 checksum
How to use checksums
2b5fad8cdb0b1d869181a214be9e33e6723f3ca6cdc47110f9af2a5137bb7520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.12

Release history Release notifications | RSS feed

This release

1.3.1 This release

2 release files

1.3.0

2 release files

1.2.10

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

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