Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear error when using BAM from Nanopore data #15

Open
mcortes-lopez opened this issue Jan 26, 2021 · 3 comments
Open

Unclear error when using BAM from Nanopore data #15

mcortes-lopez opened this issue Jan 26, 2021 · 3 comments

Comments

@mcortes-lopez
Copy link

Hi,
I am trying to use bamsnap with long read data from Nanopore aligned reads using minimap. I do not manage to get any output and the exit error is a number that I cannot debug (when I Google "KeyError: 28747748" it does not return any meaningful results). Here is the code that I am using and the output:

bamsnap -bam ../aln_bam/dRNA_aln.sorted.bam -pos chr16:28932034 -out ./test.png

2021-01-26 23:07:53,894 : [INFO] Total running time: 0.0 sec Process proc 1: Traceback (most recent call last): File "/home/mcortesl/.conda/envs/myenv/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap self.run() File "/home/mcortesl/.conda/envs/myenv/lib/python3.7/multiprocessing/process.py", line 99, in run self._target(*self._args, **self._kwargs) File "/home/mcortesl/.conda/envs/myenv/lib/python3.7/site-packages/bamsnap/bamsnap.py", line 229, in run_process_drawplot_bamlist imagefname = bsplot.drawplot_bamlist(pos1, image_w, bamlist, xscale, refseq) File "/home/mcortesl/.conda/envs/myenv/lib/python3.7/site-packages/bamsnap/bamsnap.py", line 467, in drawplot_bamlist ia_sub = self.get_bamplot_image(bam, pos1, image_w, xscale, refseq) File "/home/mcortesl/.conda/envs/myenv/lib/python3.7/site-packages/bamsnap/bamsnap.py", line 351, in get_bamplot_image rset.calculate_readmap(is_strand_group=True) File "/home/mcortesl/.conda/envs/myenv/lib/python3.7/site-packages/bamsnap/drawreadset.py", line 305, in calculate_readmap r = DrawRead(a, self.refseq) File "/home/mcortesl/.conda/envs/myenv/lib/python3.7/site-packages/bamsnap/drawread.py", line 66, in __init__ self.set_read_variant() File "/home/mcortesl/.conda/envs/myenv/lib/python3.7/site-packages/bamsnap/drawread.py", line 126, in set_read_variant refbase = self.refseq[gp].upper() KeyError: 28747748

Could this be a problem because of the formatting of the minimap2 aligned file?

@yinshiyi
Copy link

I have similar observation using nanopore data, it seems failed at
Process proc 1:
Traceback (most recent call last):
File "/home/shiyi/miniconda3/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/home/shiyi/miniconda3/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/shiyi/miniconda3/lib/python3.9/site-packages/bamsnap/bamsnap.py", line 235, in run_process_drawplot_bamlist
imagefname = bsplot.drawplot_bamlist(pos1, image_w, bamlist, xscale, refseq)
File "/home/shiyi/miniconda3/lib/python3.9/site-packages/bamsnap/bamsnap.py", line 473, in drawplot_bamlist
ia_sub = self.get_bamplot_image(bam, pos1, image_w, xscale, refseq)
File "/home/shiyi/miniconda3/lib/python3.9/site-packages/bamsnap/bamsnap.py", line 357, in get_bamplot_image
rset.calculate_readmap(is_strand_group=True)
File "/home/shiyi/miniconda3/lib/python3.9/site-packages/bamsnap/drawreadset.py", line 305, in calculate_readmap
r = DrawRead(a, self.refseq)
File "/home/shiyi/miniconda3/lib/python3.9/site-packages/bamsnap/drawread.py", line 66, in init
self.set_read_variant()
File "/home/shiyi/miniconda3/lib/python3.9/site-packages/bamsnap/drawread.py", line 125, in set_read_variant
base = self.readseq_with_softclipped[bidx]
TypeError: 'NoneType' object is not subscriptable

@lskatz
Copy link

lskatz commented Sep 6, 2022

Has anyone solved this issue?

@comery
Copy link

comery commented Aug 9, 2023

Has anyone solved this issue?

This may be helpful for you. see Issue#26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants