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

PacBio CCS reads support #26

Open
sjin09 opened this issue Aug 5, 2021 · 3 comments
Open

PacBio CCS reads support #26

sjin09 opened this issue Aug 5, 2021 · 3 comments

Comments

@sjin09
Copy link

sjin09 commented Aug 5, 2021

I was wondering if bamsnap supports PacBio CCS reads. When I use bamsnap with my CCS bam files, it produces the following error:

Traceback (most recent call last):
  File "/Users/sl17/Languages/python3/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/Users/sl17/Languages/python3/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/sl17/Languages/python3/lib/python3.8/site-packages/bamsnap/bamsnap.py", line 235, in run_process_drawplot_bamlist
    imagefname = bsplot.drawplot_bamlist(pos1, image_w, bamlist, xscale, refseq)
  File "/Users/sl17/Languages/python3/lib/python3.8/site-packages/bamsnap/bamsnap.py", line 473, in drawplot_bamlist
    ia_sub = self.get_bamplot_image(bam, pos1, image_w, xscale, refseq)
  File "/Users/sl17/Languages/python3/lib/python3.8/site-packages/bamsnap/bamsnap.py", line 383, in get_bamplot_image
    ia_sub = rset.get_image(
  File "/Users/sl17/Languages/python3/lib/python3.8/site-packages/bamsnap/drawreadset.py", line 350, in get_image
    self.draw_read(dr, group, readcolor, readcolorby)
  File "/Users/sl17/Languages/python3/lib/python3.8/site-packages/bamsnap/drawreadset.py", line 357, in draw_read
    r.yidx = self.get_yidx(r, group)
  File "/Users/sl17/Languages/python3/lib/python3.8/site-packages/bamsnap/drawreadset.py", line 199, in get_yidx
    self.readmap[gpos][group] = []
KeyError: 2725160
2021-08-05 14:22:24,744 : [INFO] Total running time: 3.1 sec

The command that I have used is:

bamsnap -bam input.bam -pos 20:2740569  -refversion hg19  -out chr20_2740569
@sjin09 sjin09 changed the title PacBio CCS reads PacBio CCS reads support Aug 5, 2021
@Noonanav
Copy link

I am having a similar issue with ONP reads mapped using minimap2

@SieglindeCoppens
Copy link

We are also having the same issue with ONT reads mapped using minimap2, with the following error message:

Process proc 1:
Traceback (most recent call last):
  File "/home/bygul/.local/lib/python3.8/site-packages/bamsnap/drawreadset.py", line 191, in get_yidx
    yidx = self.yidxmap[group][r.id]
KeyError: 'all'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bygul/.local/lib/python3.8/site-packages/bamsnap/drawreadset.py", line 197, in get_yidx
    self.readmap[gpos][group]
KeyError: 765

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/bygul/.local/lib/python3.8/site-packages/bamsnap/bamsnap.py", line 235, in run_process_drawplot_bamlist
    imagefname = bsplot.drawplot_bamlist(pos1, image_w, bamlist, xscale, refseq)
  File "/home/bygul/.local/lib/python3.8/site-packages/bamsnap/bamsnap.py", line 473, in drawplot_bamlist
    ia_sub = self.get_bamplot_image(bam, pos1, image_w, xscale, refseq)
  File "/home/bygul/.local/lib/python3.8/site-packages/bamsnap/bamsnap.py", line 383, in get_bamplot_image
    ia_sub = rset.get_image(
  File "/home/bygul/.local/lib/python3.8/site-packages/bamsnap/drawreadset.py", line 350, in get_image
    self.draw_read(dr, group, readcolor, readcolorby)
  File "/home/bygul/.local/lib/python3.8/site-packages/bamsnap/drawreadset.py", line 357, in draw_read
    r.yidx = self.get_yidx(r, group)
  File "/home/bygul/.local/lib/python3.8/site-packages/bamsnap/drawreadset.py", line 199, in get_yidx
    self.readmap[gpos][group] = []
KeyError: 765
2023-05-05 10:24:49,873 : [INFO] Total running time: 0.5 sec

@comery
Copy link

comery commented Aug 9, 2023

I have a similar issue. We found that bamsnap can not deal with long cigar strings in BAM generated by CCS or ONT. So we guess bansnap was not designed for long read mapping.

We have made a revised version of bamsnap for long-read mapping. It looks working well for most conditions. you can find it form this repo

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