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

Error about reference index #14

Open
sylee623 opened this issue Jan 26, 2021 · 2 comments
Open

Error about reference index #14

sylee623 opened this issue Jan 26, 2021 · 2 comments

Comments

@sylee623
Copy link

my command was

bamsnap -bam ./NA12878.final.cram -pos chr11:12314 -out ./test.png

It worked well but suddenly it didn't work with error below.

Traceback (most recent call last):
File "/usr/lib64/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib64/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/home/sylee/.local/lib/python3.6/site-packages/bamsnap/bamsnap.py", line 227, in run_process_drawplot_bamlist
refseq = rseq.get_refseq(pos1)
File "/home/sylee/.local/lib/python3.6/site-packages/bamsnap/bamsnap.py", line 535, in get_refseq
refseq = self.get_refseq_from_ucsc(pos1)
File "/home/sylee/.local/lib/python3.6/site-packages/bamsnap/bamsnap.py", line 575, in get_refseq_from_ucsc
refseq[gpos] = seq[i]
IndexError: string index out of range

how can I fix this problem?

@ankit-21
Copy link

ankit-21 commented Nov 17, 2021

I am facing the same issue as the OP. When I run the command

bamsnap -bam BAMs/NA18-281_CID21-7767_B21-613.BAM_ETC-RUO.bam -bed regions.bed -out snapshots

I get the error as follows:
Traceback (most recent call last):
File "/Users/ankit/Desktop/ETCR-BMO-206/venv/bin/bamsnap", line 8, in
sys.exit(cli())
File "/Users/ankit/Desktop/ETCR-BMO-206/venv/lib/python3.8/site-packages/bamsnap/init.py", line 7, in cli
opt = get_options()
File "/Users/ankit/Desktop/ETCR-BMO-206/venv/lib/python3.8/site-packages/bamsnap/_options.py", line 209, in get_options
check_option(opt)
File "/Users/ankit/Desktop/ETCR-BMO-206/venv/lib/python3.8/site-packages/bamsnap/_options.py", line 165, in check_option
opt['poslist'] = set_pos_list(opt)
File "/Users/ankit/Desktop/ETCR-BMO-206/venv/lib/python3.8/site-packages/bamsnap/_options.py", line 131, in set_pos_list
p1['t_pos'] = int(arr[1])
IndexError: list index out of range

I have tried both the dockerized container and running locally by installing bamsnap from the pypi. I get the same errors for both the cases. Any information/help regarding the issue will be helpful.

Thanks.

@ankit-21
Copy link

Apparently this issue was caused by the bed file I was using as input. The formatting of bed file was not appropriate and when the lines were split based on tabs (in the _options.py file line 127), the function wasn't able to split the lines properly. By reformatting the bed files, I was able to resolve this issue. Once again, thanks for this awesome tool! :)

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

2 participants