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

ValueError: invalid coordinates: start > stop #173

Open
pauline-ng opened this issue Feb 4, 2021 · 1 comment
Open

ValueError: invalid coordinates: start > stop #173

pauline-ng opened this issue Feb 4, 2021 · 1 comment

Comments

@pauline-ng
Copy link

Hi Adam,

I'm getting the following error that breaks BamSurgeon addsv.py:

Traceback (most recent call last):
  File "/usr/local/bin/addsv.py", line 4, in <module>
    __import__('pkg_resources').run_script('bamsurgeon==1.2', 'addsv.py')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 665, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1470, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/local/lib/python3.8/dist-packages/bamsurgeon-1.2-py3.8.egg/EGG-INFO/scripts/addsv.py", line 1305, in <module>
  File "/usr/local/lib/python3.8/dist-packages/bamsurgeon-1.2-py3.8.egg/EGG-INFO/scripts/addsv.py", line 1100, in main
  File "/usr/local/lib/python3.8/dist-packages/bamsurgeon-1.2-py3.8.egg/EGG-INFO/scripts/addsv.py", line 389, in fetch_read_names
  File "pysam/libcalignmentfile.pyx", line 1082, in pysam.libcalignmentfile.AlignmentFile.fetch
  File "pysam/libchtslib.pyx", line 688, in pysam.libchtslib.HTSFile.parse_region
ValueError: invalid coordinates: start (48025033) > stop (48024294)

As far as I can tell, this happens when the upstream altered region overlaps the downstream altered region.


INFO 2021-02-04 02:32:18,364 fetched 226 read pairs from 2:48021205-48025033, downsample factor: 0.500000
INFO 2021-02-04 02:32:18,371 fetched 250 read pairs from 2:48024294-48028525, downsample factor: 0.500000

where 48025033 > 4802494.

Some additional log info:

INFO 2021-02-04 02:32:18,333 2_48023033_48023033_BIGDEL start: 48021033, end: 48025033, tgtstart: 172, tgtend: 4000, refstart: 48021205, refend: 48025033
INFO 2021-02-04 02:32:18,346 2_48023033_48023033_BIGDEL alignment result: ['SUMMARY', '21146', '26', '4257', '0', '4231']
INFO 2021-02-04 02:32:18,347 2_48023033_48023033_BIGDEL trimmed contig length: 4231
INFO 2021-02-04 02:32:18,347 2_48023033_48023033_BIGDEL trn_start: 48024294, trn_end: 48032294, trn_tgtstart: 0, trn_tgtend:4231 , trn_refstart: 48024294, trn_refend: 48028525

Thanks,
Pauline

@adamewing
Copy link
Owner

There's a 5kbp size cutoff where addsv switches from big SV ("BIGDEL", "BIGINV", etc) mode to small SV mode ("DEL", "INV", etc) in an attempt to avoid this problem but it isn't a perfect solution obviously. Will look at detecting collisions between the big SV ends or turning this into a parameter.

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