Skip to content

IntronExonSplitter

Mason M Lai edited this page Jun 21, 2017 · 4 revisions

IntronExonSplitter accepts a BAM file of alignments and a BED file of gene annotations; categorizes the alignments as exonic, intronic or unclassifiable relative to the annotations; and outputs each alignment into one of three BAM files corresponding to its category. An example of input and output:

IntronExonSplitter is not as flexible as the bedtools suite of programs, but it has a few advantages:

  1. IntronExonSplitter considers both reads in a paired-end fragment together. Each fragment is represented as a genomic interval with internal gaps corresponding to spliced-out regions and/or the fragment insert.

  2. IntronExonSplitter will consider splice-junctions in reads.

  3. IntronExonSplitter will call a fragment as unclassifiable if two annotations provide conflicted information (typically when dealing with different gene isoforms).

Running on the command line

See below for details on the different flags.

Example invocation:

java -jar IntronExonSplitter.jar --bam /path/to/input.bam --genes /path/to/annotations.bed
--exons /path/to/exon/output.bam --introns /path/to/intron/output.bam --unclassified 
/path/to/unclassified/output.bam --exonpadding 2 --stranded

IntronExonSplitter requires Java 8. Guttman Lab members, Java 8 is installed on the workstation, so you only need to worry about this if you try to run the program elsewhere. You can find a copy of IntronExonSplitter in Software/alignment-tools.

Flags

flag default value description
--bam [FILE] N/A (required) input BAM file of alignments
--genes [FILE] N/A (required) input BED file of gene annotations
--exons [FILE] exons.bam output BAM file of alignments classified as exonic
--introns [FILE] introns.bam output BAM file of alignments classified as intronic
--unclassified [FILE] unclassified.bam output BAM file of unclassified alignments
--exonpadding [INT] 0 extends exon boundaries by this many bases
--stranded N/A consider strandedness when calculating overlap
--debug N/A print internal tree structures as BED files for IGV
--help N/A print help menu and exit
--version N/A print version number and exit

--bam

If the BAM file represents a paired-end alignment, it must be sorted.

--exonpadding

Some gene annotations may be slightly mis-annotated, causing an obviously spliced read to be classified as intronic if it spills into an intron by a single base. This parameter "inflates" all exons by [INT] bases (and "deflates" the introns accordingly) to avoid this misclassification.

--stranded

By default, IntronExonSplitter does not consider strandedness when calculating interval overlap. (Internally, all annotations are created with a strandedness of "BOTH", so that reads will overlap regardless of their orientation.) Set this flag to tell IntronExonSplitter to consider strandedness -- particularly if you are interested in regions where oppositely stranded annotations converge, e.g., Xist and Tsix.

--debug

Currently, setting this flag will cause IntronExonSplitter to output BED files containing the introns and gene bodies of the annotations as it runs. This is done to aid visually inspecting the output in IGV when debugging. These files are written to gene_bodies.debug.bam and introns.debug.bam. Currently, these paths are fixed.

Clone this wiki locally