parklab / bamsnap

MIT License
110 stars 24 forks source link

Bamsnap can't recognize lower case letters in reference genomes #22

Open SeongGyuKwon opened 3 years ago

SeongGyuKwon commented 3 years ago

I have been struggling with KeyErrors in bamsnap

Process proc 1: Traceback (most recent call last): File "/home/jaesoon/miniconda3/envs/gunhee/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/home/jaesoon/miniconda3/envs/gunhee/lib/python3.6/multiprocessing/process.py", line 93, in run self._target(*self._args, **self._kwargs) File "/home/jaesoon/miniconda3/envs/gunhee/lib/python3.6/site-packages/bamsnap/bamsnap.py", line 235, in run_process_drawplot_bamlist imagefname = bsplot.drawplot_bamlist(pos1, image_w, bamlist, xscale, refseq) File "/home/jaesoon/miniconda3/envs/gunhee/lib/python3.6/site-packages/bamsnap/bamsnap.py", line 473, in drawplot_bamlist ia_sub = self.get_bamplot_image(bam, pos1, image_w, xscale, refseq) File "/home/jaesoon/miniconda3/envs/gunhee/lib/python3.6/site-packages/bamsnap/bamsnap.py", line 377, in get_bamplot_image ia_sub = covplot.get_image(image_w, self.opt['coverage_height'], self.opt['coverage_bgcolor']) File "/home/jaesoon/miniconda3/envs/gunhee/lib/python3.6/site-packages/bamsnap/drawreadset.py", line 26, in get_image self.draw_coverage(dr, w, h) File "/home/jaesoon/miniconda3/envs/gunhee/lib/python3.6/site-packages/bamsnap/drawreadset.py", line 81, in draw_coverage dr.line([(x, y11), (x, y21)], fill=COLOR[base], width=self.xscale.base_width) KeyError: **'a'**

and I assume that the KeyError is because the reference genome contains lower case letters.

When I tried with other species with reference genomes without any lower case letters, it worked

I would be grateful if you could consider this opinion.

Thank you