rmats2sashimiplot

1,838 views
Skip to first unread message

rMATS User Group

unread,
Jul 24, 2015, 2:03:16 PM7/24/15
to rMATS User Group
Dear all,
By popular demand, we have written a script to convert the rmats output into sashimiplot. An example plot is attached here. You can download the script at: http://www.mimg.ucla.edu/faculty/xing/rmats2sashimiplot/. This is still work in progress and right now the script only works with skipped exon events. Comments and feedbacks are welcome. 

Yours,
Yi Xing
UCLA
ENAH-sashimiplot.pdf

Amandine V.

unread,
Sep 30, 2015, 5:06:20 AM9/30/15
to rMATS User Group, rmats-us...@googlegroups.com
Dear Yi,

Thank you very much for this script, which runs very well !

Just a comment about the automatic creation of .bam files from the .sam given as input of the script => this takes a lot of time.

I have taken the liberty to modify the script in order to put in argument my .bam files and verify that they have a valid header, if not, I exit the script.

In attachment, the little modification of the script. 

In addition, it arrives that some values for "IncLevel1" or "IncLevel2" in the rMATS output have a "NA" value. And when the "rmats2sashimiplot.py" meets this value, it generates an error (of course it's not a numeric value) and exit => so, the events after this first NA are not treated. I remove the lines containing NA before launching the script with the following awk commands: 

# on "IncLevel1" column

awk -v value="NA" -v column="21" '
  $column ~ value {++removed; next}
  1 {print}
  END {print removed " lines removed" >"/dev/stderr"}
' <SE.MATS.ReadsOnTargetAndJunctionCounts.txt >SE.MATS.ReadsOnTargetAndJunctionCounts_without_NA.txt

# on "IncLevel2" column

awk -v value="NA" -v column="22" '
  $column ~ value {++removed; next}
  1 {print}
  END {print removed " lines removed" >"/dev/stderr"}
' <SE.MATS.ReadsOnTargetAndJunctionCounts_without_NA.txt >SE.MATS.ReadsOnTargetAndJunctionCounts_without_NA_tmp.txt

mv SE.MATS.ReadsOnTargetAndJunctionCounts_without_NA_tmp.txt SE.MATS.ReadsOnTargetAndJunctionCounts_without_NA.txt

And it's ok !

Thank you very much for this script Yi ! It's very very useful.

Tiago Bruno Castro

unread,
Oct 2, 2015, 10:56:43 AM10/2/15
to rMATS User Group
Dear Yi,

Thank you very much for this script,

I am going to try this right now. Can you explain for me with more detail what is 
Exon size scale down
Intron size scale down

Jakub

unread,
Oct 7, 2015, 10:19:50 AM10/7/15
to rMATS User Group
Hi Amandine,

thanks for your post & warning about NAs.
would you be able to post the changes you added to the script, which I can't find in the attachment?
A rough guide to what you modified would do too.

Best wishes,
Jakub

Jakub

unread,
Oct 7, 2015, 12:09:43 PM10/7/15
to rMATS User Group, rmats-us...@googlegroups.com
Dear Yi,

to get your code to work I had to make the following code substitution in the programme for it to work (line 194)
This is because the  2 column of items actually contains gene names inside quotation marks in my case eg. "Ddny1", which are then passed on to the os module which cannot deal with the formatting.

    geneSymbol = items[2].replace("\"","")

Also would you consider for rmats2sashimiplot to accept both bam and sam files (maybe a -b1 -b2 option?). I run rmats2 from bam files and it makes no sense for me to decompress them following that just so they can be recompressed again by rmats2sashimiplots.For anyones interest, I made the following changes to make your programme work with bam files:

Changed lines 65-66:
s1 = s1.replace(".bam","");
s2 = s2.replace(".bam","");
Commented out lines 88-89 and 95-96
#os.system('samtools view -Sbh '+sample_1[fki]+'.sam > '+sample_1[fki]+'.bam');
#os.system('samtools index '+sample_1[fki]+'.bam');

Best wishes,
Jakub
CGAT Oxford

rene.bo...@upf.edu

unread,
Oct 28, 2015, 6:29:37 AM10/28/15
to rMATS User Group, rmats-us...@googlegroups.com
Dear Yi,

Thank you for providing this script, I was looking for a way to visualize the rMATS output and your solution looks great!
Unfortunately, when using your provided test data, the current version of the script does not produce the splicing graphs for me and instead just plots the IncLevel of an exon for each of the replicates.
There are no error messages and also the log files seem ok, so have you ever experienced this behavior? 

Kind regards,
René

Amanda Vondras

unread,
Feb 9, 2016, 3:22:25 PM2/9/16
to rMATS User Group
rMATS team- 
I also have encountered this error using the test data. A plot is produced, but the actual sashimi with arcs is missing entirely. 
2_ENAH_chr1_225695653_225695719_-@chr1_225692693_225692755_-@chr1_225688694_225688772_-.pdf
Message has been deleted
Message has been deleted
Message has been deleted

David Zhang

unread,
Jun 21, 2016, 9:33:34 AM6/21/16
to rMATS User Group, rmats-us...@googlegroups.com
Thanks Yi for the program. I got below error message when I run the testData as well as my study data, even I have tested on different machines:

$ rmats2sashimiplot -b1 ./testData/S1.R1.test.bam,./testData/S1.R2.test.bam,./testData/S1.R3.test.bam -b2 ./testData/S2.R1.test.bam,./testData/S2.R2.test.bam,./testData/S2.R3.test.bam -c chr2:+:10090000:10110000:./testData/ensGene.gff3 -l1 PC3E -l2 GS689 -exon_s 1 -intron_s 5 -o test_coordinate_output

sh: 1: index_gff: not found
sh: 1: sashimi_plot: not found
mv: cannot stat ‘/data/projects/RNAseq/rMATs/test_coordinate_output/Sashimi_plot/chr2:10090000:10110001:+.pdf’: No such file or directory

Do you have some suggestions?

Thanks

Yi-Fang Wang

unread,
Jun 22, 2016, 8:01:49 AM6/22/16
to rMATS User Group
It looks like you have not installed MISO or it is not available in your PATH.

Yi-Fang Wang

unread,
Jun 22, 2016, 8:03:42 AM6/22/16
to rMATS User Group
I also have got the same problem when running the test data. Hope the team has gotten solutions to this.
Thank you.

David Zhang

unread,
Jun 22, 2016, 9:08:38 AM6/22/16
to rMATS User Group
Thanks, Yi-Fang!

Noah Pieta

unread,
Jul 26, 2016, 4:23:13 AM7/26/16
to rMATS User Group, rmats-us...@googlegroups.com
Dear Yi,
i have a problem when i use rmats2sashimiplot, it cannot import module rmats2sashimiplot.rmats2sashimiplot as below. i don't know what's wrong. would you help me to solve it ? thankyou very much!!

mengh...@gmail.com

unread,
Mar 11, 2017, 9:48:26 PM3/11/17
to rMATS User Group, rmats-us...@googlegroups.com

Dear Yi Xing,

I am trying to use rmats2sashimiplot to output significant rMATS event result. But I have a question about the difference between rMATS output and sashimi plot result.  For example , I have a sign RI event , the info of this event is :

ID      GeneID  geneSymbol      chr     strand  riExonStart_0base       riExonEnd       upstreamES      upstreamEE      downstreamES    downstreamEE    ID      IC_SAMPLE_1     SC_SAMPLE_1     IC_SAMPLE_2     SC_SAMPLE_2     IncFormLen      SkipFormLen     PValue  FDR     IncLevel1       IncLevel2       IncLevelDifference
10      "EEF1B2"        "EEF1B2"        chr2    +       207024317       207024783       207024317       207024408       207024682       207024783
       10      381,499 68,76   7,7     23,44   403     129     0.0     0.0     0.642,0.678     0.089,0.048     0.592

the IC_sample1 is 381,499 JC_sample_1 is 68,76;
but the sashimi plot don't show those number. So I am confused about this.

Thank you.

Howard

在 2015年7月25日星期六 UTC+8上午2:03:16,rMATS User Group写道:
1_EEF1B2_chr2_207024318_207024408_+@chr2_207024318_207024783_+@chr2_207024683_207024783_+.pdf
Reply all
Reply to author
Forward
0 new messages