Skip to main content

ScanExitronLR: a lightweight tool for the characterization and quantification of exitrons in long read RNA-seq data

Project description

PEP8 PyPI Status Python Version License

ScanExitronLR

A computational workflow for exitron splicing identification in long-read RNA-seq data.

Installation

The recommended way to install ScanExitronLR is using pip:

$ pip install scanexitronlr

This will pull and install the latest stable release from PyPi. ScanExitronLR requires Python 3.7+. Thus you need to make sure that the pip is for python3 using e.g. which pip or using:

$ pip3 install scanexitronlr

To test your installation, run:

$ selr

You should see the version number, usage instructions and commands. (If you prefer a more descriptive command scanexitronlr also works.)

NOTE: ScanExitronLR uses the LIQA package to infer exitron specific transcript abundance. Currently, LIQA sometimes crashes with newest versions of the lifelines package. To avoid this, install version v0.26.4 of lifelines with conda install lifelines=v0.26.4.

Usage

ScanExitronLR has two modes, extract and annotate. Use extract when calling exitrons in an alignment and annotate when annotating exitrons called using extract.

Extract

extract requires three inputs: (1) a BAM alignment file of long-reads containing the ts:A flag (provided by default by Minimap2), (2) a reference genome and (3) a sorted and bgzip'd gene annotation file. Currently only gtf files are supported. We suggest using the --junc-bed parameter in minimap2 for more accurate spliced alignments. Without the parameter, it may be harder to distinguish unannoted exitron splicing events from annotated splicing events.

To sort your gtf file, use the command:

$ awk '$1 ~ /^#/ {print $0;next} {print $0 | "sort -k1,1 -k4,4n -k5,5n"}' in.gtf > out_sorted.gtf

To bgzip your gene annotation file, use:

$ bgzip in.gtf

bgzip is part of the htslib, which you most likely already have installed if you care about BAM files. Otherwise, you can get it here. It is important to note that if you download the latest GENCODE release it will be in the gzip form, not bgzip. You will need to run gzip -d and then bgzip.

ScanExitronLR utilizes the gffutils package, which requires an SQL-lite database of the annotation file. You do not need to provide such a file, as ScanExitronLR will create one if one is not found, though it may take ~20 minutes to build. It will be saved as your_annotation.gtf.gz.db in the same location as your annotation and will not need to be built again. In addition, we require a tabix index, and it will be created if one is not found. This should only take seconds. It will be saved as your_annotation.gtf.gz.tbi.

Thus, if you are running ScanExitronLR on a shared server and using a shared annotation database, you may not have writing privelages in the shared space. You will need to copy your annotation file to your local directory.

We have provided fully processed GTF files for Gencode V39 and TAIR10 for your convenience.

To run ScanExitronLR in extract mode, simply run

$ selr extract ...

with the following parameters:

Parameter Description
-i STR REQUIRED: Input BAM file
-g STR REQUIRED: Input genome reference (e.g. hg38.fa)
-r STR REQUIRED: Input sorted and bgzip'd annotation reference (e.g. gencode_v38_sorted.gtf.gz).
-o STR Output filename (e.g. bam_filename.exitron <- this is default)
-a/--ao INT Reports only exitrons with AO (# of supporting reads) of INT or above (default: 2).
-p/--pso FLOAT Reports only exitrons with PSO of FLOAT or above (default: 0.01).
-c/--cores INT Use INT cores (default: 1). Use as many as you can spare. Even large BAM files only use at most 4GB total memory on 10 cores.
-cp/--cluster-purity FLOAT Reports only exitrons with cluster purity of FLOAT or above (default: 0).
-m/--mapq INT Only considers reads with mapq score >= INT (default: 50)
-j/--jitter INT Treat splice-sites with fuzzy boundry of +/- INT (default: 10).
-sr Use this flag to skip the realignment step.
-sa Use this flag to save isoform abundance files for downstream differential isoform usage analysis with LIQA. Files are of the form: input.isoform.exitrons, input.isoform.normals (See example page)

We provide some functionality to perform exitron differential isoform usage with the -sa flag. See here for an example.

Choosing Filtering Parameters

ScanExitronLR filters exitron splicing events based on AO (-a/--ao), PSO (-p/--pso) and cluster purity (-cp/--cluster-purity):

AO. By default, ScanExitronLR only reports exitrons with at least two supporting reads (AO >= 2). This is filter out random sequencing errors that may lead to a faulty alignment and false splicing event. However, if the coverage is particularly low, you may need to set the AO threshold to 1 in order to detect exitrons in medium and lower expressed genes.

PSO. By default, ScanExitronLR only reports exitrons with a splicing frequence (PSO) above 1%. Splicing events below this frequency may not be biologically relevant or may just be due to splicing noise. Setting PSO filtering to 0% is not recommended because it will increase running time and report many low quality splicing events.

Cluster Purity. By default, ScanExitronLR does not filter by cluster purity. However, cluster purity is important for having high confidence the the reported splice sites. For example, if the cluster purity is 90%, then 90% of the exitron spliced reads have the reported splice sites. Thus, one ought to be cautious when investigating exitrons with cluster purities below 50%. There is an exitron splicing event being detected, but it is unclear where the exact splice sites occur. This can happen if the reads are particularly noisy or are aligned to a repetitive region.

Annotate

To run ScanExitronLR in annotate mode, simply run

$ selr annotate ...

with the following parameters:

parameters Description
-i STR REQUIRED: Input exitron file, generated from selr extract
-g STR REQUIRED: Input genome reference (e.g. hg38.fa)
-r STR REQUIRED: Input sorted and _ gzip'd_ annotation reference (e.g. gencode_v38_sorted.gtf.gz).
-o STR Output filename (e.g. bam_filename.exitron.annotation <- this is default)
-b/--bam-file STR If specified, annotation includes read supported NMD status directly from alignments.
-arabidopsis Use this flag if using alignments from Arabidopsis. See github page for annotation file/genome assumptions.

The output is a tab-separated file with the following columns:

Column Description
chrom Chromosome name
start Exitron start
end Exitron end
name Unique exitron identifier
region Exitron region
ao # of supporting reads
strand Gene strand
gene_name Gene name from annotation
gene_id Gene ID from annotation
length Exitron legnth
splice_site Exitron splice sites (G[T/C]-AG, AT-AC)
transcript_id Transcript ID from annotation
pso Exitron percent spliced out value
dp Total depth at exitron position (PSO = AO/DP)
cluster_purity Exitron cluster purity
exitron_prot_position Position in amino acid sequence of exitron splicing event
type Exitron type (frameshift/truncation/truncation+substitution)
substitution If from substitution type, determines which amino acid substitution occured
nmd_status_predicted If frameshift type, determines if a downstream stop codon is 50 nt upstream of splicing junction
nmd_status_percentage If frameshift type, reports percentage of reads that directly support a stop codon 50 nt upstream of splicing junction
downstream_inframe_AUG If frameshift type, reports whether there is a downstream AUG, usually attenuating NMD efficiency
start_proximal_PTC If frameshift type, reports whether premature stop codon is within 200 nt of start codon, usually attenuating NMD efficiency
prot_domains Any PFAM domains that are disrupted by the exitron splicing
reads Name of all reads which are exitron spliced

ScanExitronLR may assign transcript abundance to multiple annotated transcripts. If this is the case, each transcript will get an annotation. Thus, if an exitron is associated with two transcripts, there will be two rows in the annotation output, one for each transcript.

Example

See here for an example.

Contact

Please feel free to post any issues here on github.

Citation

@article{Fry_ScanExitronLR_characterization_and_2022,
author = {Fry, Joshua P and Li, Yang Yang and Yang, Ren Dong},
doi = {10.1101/2022.03.25.485864},
journal = {bioRxiv},
month = {3},
number = {1},
pages = {1--7},
title = {{ScanExitronLR: characterization and quantification of exitron splicing events in long-read RNA-seq data}},
volume = {1},
year = {2022}
}

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

scanexitronlr-1.1.9.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

scanexitronlr-1.1.9-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file scanexitronlr-1.1.9.tar.gz.

File metadata

  • Download URL: scanexitronlr-1.1.9.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5

File hashes

Hashes for scanexitronlr-1.1.9.tar.gz
Algorithm Hash digest
SHA256 fe9ef2a1925aa707bca34914731987a74eba240a8e5e39f475fefdf4ef003102
MD5 00aeef4a1bd86eb6947204758c642ffb
BLAKE2b-256 fe28c817f1f08741cee85c4f18e2b9a75c6955a66cf09b002cf9fdafe07ef1d2

See more details on using hashes here.

File details

Details for the file scanexitronlr-1.1.9-py3-none-any.whl.

File metadata

  • Download URL: scanexitronlr-1.1.9-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5

File hashes

Hashes for scanexitronlr-1.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8c0dd984de881c5aa08eb962386eb574850fc874662d88ffee07461ad186270a
MD5 9abb02c72fdd2cb1b133cb0276566ba1
BLAKE2b-256 72839de51fc2d9931279896ba3a09bd1ddf7c07f87a2bfbc34f32b095800f683

See more details on using hashes here.

Supported by

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