This is a fork of the rmats2sashimiplot repository by the Xing lab. It contains a quick fix for producing plots with unlimited amounts of samples and colours.
--- Still under development! If you want to contribute, please feel free to do so! ---
- Python 2.7 (Python 3 can be used after running 2to3.sh)
- numpy
- scipy
- matplotlib
- pysam
- Samtools
- bedtools
I recommend setting up a conda environment with the respective dependencies. This can be easily done using the provided environment file conda.yaml
:
conda env create -f conda.yaml
Or for mamba users:
mamba env create -f conda.yaml
After cloning the repo, rmats2sasmimiplot can be run without installing:
python ./src/rmats2sashimiplot/rmats2sashimiplot.py
I recommend running rmats2sashimiplot without installing.
rmats2sashimiplot can be installed with:
python ./setup.py install
If installed, rmats2sashimiplot can be run with just:
rmats2sashimiplot
BAM files must be sorted before visualization/indexing.
The fix lets you specify multiple input samples with colors for each tracks:
--b1
takes input bam files as a comma-separated list--l1
takes track labels as comma-separated list (lengths ofb1
andl1
must match)--color
takes comma-separated list of colors in hex code, one color per track-c
takes the genome region coordinates and a GFF3 annotation file (format see below)--exon_s
and--intron_s
take scale factors on how much to scale down exons/introns respectively.
cols=#ff8d17,#e77600,#b95e00,#8b4600
bams=./bams/sample1.bam,./bams/sample2.bam,./bams/sample3.bam,./bams/sample4.bam
labels=sample1,sample2,sample3,sample4
outdir=/path/to/outdir/
mkdir -p $outdir
python ./src/rmats2sashimiplot/rmats2sashimiplot.py \
--b1 $bams \
-c {chromosome}:{strand}:{start}:{end}:{/path/to/gff3} \
--l1 $labels \
--color $cols \
--exon_s 1 \
--intron_s 5 \
--fig-height 12 \
-o $outdir
All output is written to the directory specified by -o
. Under that directory:
Sashimi_index/
: contains intermediate files used to create the plotSashimi_index_{Gene}_{event_id}/
: likeSashimi_index/
but one directory for each rMATS event plottedSashimi_plot/
: contains the generated sashimi plots in .pdf format
If you encounter a bug using this modified version, feel free to open an issue and I will respond as soon as I can.
See here.