parklab / bamsnap

MIT License
111 stars 25 forks source link

KeyError on RNA-seq data #20

Open simoncchu opened 3 years ago

simoncchu commented 3 years ago

Hey Daniel,

I met this error when try to run bamsnap on a rna-seq bam file:

Process proc 1:
Traceback (most recent call last):
  File "/home/cc439/anaconda3/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/home/cc439/anaconda3/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/home/cc439/anaconda3/lib/python3.7/site-packages/bamsnap/bamsnap.py", line 436, in start_process_drawplot_bamlist
    imagefname = self.drawplot_bamlist(pos1, image_w, bamlist, xscale, refseq)
  File "/home/cc439/anaconda3/lib/python3.7/site-packages/bamsnap/bamsnap.py", line 360, in drawplot_bamlist
    ia_sub = self.get_bamplot_image(bam, pos1, image_w, xscale, refseq)
  File "/home/cc439/anaconda3/lib/python3.7/site-packages/bamsnap/bamsnap.py", line 257, in get_bamplot_image
    rset.calculate_readmap(is_strand_group=True)
  File "/home/cc439/anaconda3/lib/python3.7/site-packages/bamsnap/drawreadset.py", line 301, in calculate_readmap
    r = DrawRead(a, self.refseq)
  File "/home/cc439/anaconda3/lib/python3.7/site-packages/bamsnap/drawread.py", line 66, in __init__
    self.set_read_variant()
  File "/home/cc439/anaconda3/lib/python3.7/site-packages/bamsnap/drawread.py", line 126, in set_read_variant
    refbase = self.refseq[gp].upper()
KeyError: 32793279

Any suggestions on this? Thank you!

Aikaterini-Chatzipli commented 3 years ago

Hi Daniel,

I run into the same issue as Simon when running Bamsnap on RNA-seq bams. Thanks for developing Bamsnap, it's incredibly useful and easy to use for visualizing bams. Please let us know how it would be possible to tackle the KeyError.

Many thanks,

Katerina

lparsons commented 3 years ago

I too have the same issue, using RNA-Seq data. It is possible this is because of the large junctions in the middle of reads?