open2c / pairtools

Extract 3D contacts (.pairs) from sequencing alignments
MIT License
104 stars 32 forks source link

restrict can't handle '!' chromosome #76

Closed zhqu1148980644 closed 2 years ago

zhqu1148980644 commented 5 years ago

When pair file includes pairs like:

.   !   0   chr1    109060  -   +   NU

or other chromosomes not included in the pair header. pairtools restrict raises error:

irtools_restrict.py", line 80, in restrict_py 
    rfrag_idx1, rfrag_start1, rfrag_end1 = find_rfrag(rfrags, chrom1, pos1)
File ".../lib/python3.6/site-packages/pairtools/pa irtools_restrict.py", line 95, in find_rfrag
    rsites_chrom = rfrags[chrom.encode('ascii')]
KeyError: b'!'
agalitsyna commented 2 years ago

Resolved by https://github.com/open2c/pairtools/pull/117 Feel free to re-open!