ratschlab / spladder

Tool for the detection and quantification of alternative splicing events from RNA-Seq data.
Other
103 stars 33 forks source link

Index error in write.py for psi value #162

Closed lunazhaoxxx closed 1 year ago

lunazhaoxxx commented 2 years ago

Description

I tried to run some bam files (mapped using STAR, sorted, indexed, subsampled using Samtools) on Spladder. When performing subsampled files (0.05 percent of the original bam file), the spladder run successfully (psi output are nan because --psi-min-reads option is default). When performing on original bam file or subsampled bam file (1 percent of original bam file), Spladder reports an error.

What I Did

I use command spladder build -b xxx.bam -a gencode.v39.annotation.gtf -o directoryname

Error reports as below:

Make mutex_exons events unique by event
. . events dropped: 135
saving mutually exclusive exons to spladder001/merge_graphs_mutex_exons_C3.pickle
analyzing events with confidence 3

Reporting complete exon_skip events:

Reporting confirmed exon_skip events:
writing exon_skip events in gff3 format to spladder001/merge_graphs_exon_skip_C3.confirmed.gff3
writing exon_skip events in flat txt format to spladder001/merge_graphs_exon_skip_C3.confirmed.txt.gz

Traceback (most recent call last):
  File "/usr/local/bin/spladder", line 11, in <module>
    load_entry_point('spladder==3.0.2', 'console_scripts', 'spladder')()
  File "/usr/local/lib/python3.8/dist-packages/spladder-3.0.2-py3.8.egg/spladder/spladder.py", line 229, in main
    options.func(options)
  File "/usr/local/lib/python3.8/dist-packages/spladder-3.0.2-py3.8.egg/spladder/spladder_build.py", line 163, in spladder
    analyze_events(event_type, options.bam_fnames, options)
  File "/usr/local/lib/python3.8/dist-packages/spladder-3.0.2-py3.8.egg/spladder/alt_splice/analyze.py", line 191, in analyze_events
    write_events_txt(fn_out_conf_txt, options.samples[sample_idx], events_all, fn_out_count, event_idx=confirmed_idx)
  File "/usr/local/lib/python3.8/dist-packages/spladder-3.0.2-py3.8.egg/spladder/alt_splice/write.py", line 90, in write_events_txt
    psi = psi_chunk[:, i - chunk_idx_psi[0]]
IndexError: index 2354 is out of bounds for axis 1 with size 1015
akahles commented 2 years ago

Dear @lunazhaoxxx ,

I have difficulties reproducing this behaviour. Would it be possible for you to share the small dataset you are running this on? A single pair of alignment and annotation file should work.

Thanks and Cheers,

Andre

kate-stankiewicz commented 1 year ago

Hello, I am encountering the same error--was there a resolution to this?