junction_saturation.py error -- ValueError: tid -1 out of range 0<=tid<25

48 views
Skip to first unread message

Michael zhou

unread,
Apr 28, 2014, 4:54:34 PM4/28/14
to rseqc-...@googlegroups.com
I am trying to run command line one by one, all other functions seem to work (except 2 more functions which are still running, so far so good. ) 
when i tried  junction annotion, no error message, but output is 0
when I tried junction saturation, got the ValueError: tid -1 out of range 0<=tid<25.
I did try these 2 functions on the sample data from the website, it worked. 
Anyone has any ideas?

Thanks a lot for your help.


############# error message ####################

$RSeQC/junction_saturation.py -i ${x}.sorted.bam -r $r                     efSeqBed -o ${x}.sorted.bam
reading reference bed file:  /home/hz783373/ngs5/onc_ngs5/MichaelHZ/                     database/Homo_sapiens/UCSC/hg19/hg19_RefSeq.bed  ...  Done! Total 21                     9696 known splicing junctions.
Load BAM file ... Traceback (most recent call last):
  File "/home/hz783373/ngs5/onc_ngs5/MichaelHZ/software/RSeQC-2.3.9/                     scripts/junction_saturation.py", line 99, in <module>
    main()
  File "/home/hz783373/ngs5/onc_ngs5/MichaelHZ/software/RSeQC-2.3.9/                     scripts/junction_saturation.py", line 85, in main
    obj.saturation_junction(outfile=options.output_prefix, refgene=o                     ptions.refgene_bed, sample_start=options.percentile_low_bound,sample                     _end=options.percentile_up_bound,sample_step=options.percentile_step                     ,min_intron=options.minimum_intron_size,recur=options.minimum_splice                     _read, q_cut = options.map_qual)
  File "/home/hz783373/ngs5/onc_ngs5/MichaelHZ/bin/lib/python2.7/sit                     e-packages/RSeQC-2.3.9-py2.7-linux-x86_64.egg/qcmodule/SAM.py", line                      3670, in saturation_junction
    chrom = self.samfile.getrname(aligned_read.tid).upper()
  File "csamtools.pyx", line 644, in csamtools.Samfile.getrname (lib                     /pysam/csamtools.c:6891)
ValueError: tid -1 out of range 0<=tid<25

Liguo Wang

unread,
Apr 28, 2014, 8:55:55 PM4/28/14
to rseqc-...@googlegroups.com
Hi Mike,

Make sure the chromosome IDs (chr1, chr2, chrX, etc) are consistent between your alignment BAM file and the gene model BED files.

Liguo


--
You received this message because you are subscribed to the Google Groups "rseqc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rseqc-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael zhou

unread,
Apr 29, 2014, 11:53:33 AM4/29/14
to rseqc-...@googlegroups.com
Hi Liguo,

I checked both reference genome (i use ucsc hg19) and hg19_RefSeq.bed, both use "chr". I assume my .bam files are also use this. So they should be consistant. Any other possibilities for the error? Thanks a lot.

Michael


--
You received this message because you are subscribed to a topic in the Google Groups "rseqc-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rseqc-discuss/p6Bj2iGu5h4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rseqc-discus...@googlegroups.com.

Michael zhou

unread,
Jun 4, 2014, 9:24:34 AM6/4/14
to rseqc-...@googlegroups.com
hi liguo,

here is my .bam output 

HWI-1KL155:43:H088BADXX:2:1114:13792:19720      163     chr2    20199715        42      50M     =       20199801        136 CTCAAACTTACTGGAAGATCTGTGTGGGTCTAATTCAGGCATTCACAAAG       CCCFFFFFHHHHHEHIHIGGHDHHCGHIDHHGIJGIJIJJJIJJJJIJJI      AS:i:0  XN:i:0       XM:i:0  XO:i:0  XG:i:0  NM:i:0  MD:Z:50 YS:i:0  YT:Z:CP
HWI-1KL155:43:H088BADXX:1:2213:7424:98962       83      chr2    20199743        42      50M     =       20199610        -183TCTAATTCAGGCATTCACAAAGTCTTCTTTACTAAAATCATCCAGCTTTA       IHIJIGHJHGEJIGGIHJGJIHDIIJJJJIIFFJIGGDHDHGFFFDD@?B      AS:i:0  XN:i:0       XM:i:0  XO:i:0  XG:i:0  NM:i:0  MD:Z:50 YS:i:0  YT:Z:CP
HWI-1KL155:43:H088BADXX:2:1114:13792:19720      83      chr2    20199801        42      50M     =       20199715        -136ACTACAGAAAAGTTCCAGGCCAAGTTTTAACTGGAAAAAGATCAGTTCAT       FEGG?IHC9JGIGJGGHGC+JJJJJJJJFFCGJJIGJHHHHDDFFFDCCB      AS:i:0  XN:i:0       XM:i:0  XO:i:0  XG:i:0  NM:i:0  MD:Z:50 YS:i:0  YT:Z:CP
HWI-1KL155:43:H088BADXX:1:1103:5121:92473       99      chr2    20199819        42      50M     =       20199945        176 GCCAAGTTTTAACTGGAAAAAGATCAGTTCATCCTATCACACCAAATAGT       B@BFDDDEHGFHHHIJJ?IH>EFHF9CHHHEIJJICHI@DHJJJJJJCGI      AS:i:0  XN:i:0       XM:i:0  XO:i:0  XG:i:0  NM:i:0  MD:Z:50 YS:i:0  YT:Z:CP
HWI-1KL155:43:H088BADXX:1:1103:5121:92473       147     chr2    20199945        42      50M     =       20199819        -176GGATAAGGACCCTACATTTAGTTAGTTTTTCTCATATCCCCCACTCCCTA       C8AG@DC=8FB?<B@HHD9D<GG?FGGF??HEEHGHFHAHBCA@BDD=1?      AS:i:0  XN:i:0       XM:i:0  XO:i:0  XG:i:0  NM:i:0  MD:Z:50 YS:i:0  YT:Z:CP

here i s the bed file i use: /hg19_RefSeq.bed

chr1    175913966       176176370       NM_022457       0       -       175914288       176176114       0       20      340,4
5,161,125,118,117,82,109,144,136,115,58,77,60,69,120,77,98,60,663,      0,2364,42112,43457,44531,82741,98355,98879,101350,136
321,140945,171793,190179,191657,204175,218038,218984,231079,239802,261741,
chr1    175913966       176176370       NM_001001740    0       -       175914288       176176114       0       19      340,4
5,161,125,118,117,82,109,144,136,115,58,77,69,120,65,98,60,663, 0,2364,42112,43457,44531,82741,98355,98879,101350,136321,1409

What is the reason I can not get any result?
Thanks.

Michael
To unsubscribe from this group and stop receiving emails from it, send an email to rseqc-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "rseqc-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rseqc-discuss/p6Bj2iGu5h4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rseqc-discuss+unsubscribe@googlegroups.com.

Liguo Wang

unread,
Jun 4, 2014, 2:58:49 PM6/4/14
to rseqc-...@googlegroups.com
The format has no problem. If the program finished normally, I cannot understand why you didn't get any results. Be sure the bam and bed files are matched:

1) chromosome name
2) genome version (hg19 or hg18)
3) there are reads in BAM files covering your genes. It cannot give you results if your BAM file contains reads aligned to chr2, and your input genes are all from chr1. ( But I guess what you sent is just example)

You try to run this program using other bam files to see if it works.

Liguo


To unsubscribe from this group and stop receiving emails from it, send an email to rseqc-discus...@googlegroups.com.

Indugu Nagaraju

unread,
Jun 3, 2016, 7:10:17 PM6/3/16
to rseqc-discuss
Hi
I am getting same error meassage when I run junction_saturation.py.

Michael how you solved this issue. The chromosome names in bam file and reference file are same.


log file 
Load BAM file ... Traceback (most recent call last):
  File "/usr/local/bin/junction_saturation.py", line 5, in <module>
    pkg_resources.run_script('RSeQC==2.4', 'junction_saturation.py')
  File "/opt/qiime/matplotlib-1.3.1-release/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/opt/qiime/matplotlib-1.3.1-release/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 1239, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/RSeQC-2.4-py2.7-linux-x86_64.egg/EGG-INFO/scripts/junction_saturation.py", line 99, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/RSeQC-2.4-py2.7-linux-x86_64.egg/EGG-INFO/scripts/junction_saturation.py", line 85, in main
    obj.saturation_junction(outfile=options.output_prefix, refgene=options.refgene_bed, sample_start=options.percentile_low_bound,sample_end=options.percentile_up_bound,sample_step=options.percentile_step,min_intron=options.minimum_intron_size,recur=options.minimum_splice_read, q_cut = options.map_qual)
  File "/usr/local/lib/python2.7/dist-packages/RSeQC-2.4-py2.7-linux-x86_64.egg/qcmodule/SAM.py", line 3670, in saturation_junction
    chrom = self.samfile.getrname(aligned_read.tid).upper()
  File "csamtools.pyx", line 644, in csamtools.Samfile.getrname (lib/pysam/csamtools.c:7386)
ValueError: tid -1 out of range 0<=tid<25


Thank you 
Raju

To unsubscribe from this group and stop receiving emails from it, send an email to rseqc-discus...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "rseqc-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rseqc-discuss/p6Bj2iGu5h4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rseqc-discus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages