|
5 | 5 | from os import unlink
|
6 | 6 | import os
|
7 | 7 | from io import StringIO
|
| 8 | +import traceback |
8 | 9 | import warnings
|
9 | 10 | warnings.simplefilter(action="ignore", category=RuntimeWarning)
|
10 | 11 | warnings.simplefilter(action="ignore", category=PendingDeprecationWarning)
|
@@ -1002,8 +1003,9 @@ def process_data(pMateBuffer1, pMateBuffer2, pMinMappingQuality,
|
1002 | 1003 | len(restrictionSequence)
|
1003 | 1004 | frag_end = max(mate1.pos + mate1.qlen, mate2.pos + mate2.qlen) - len(restrictionSequence)
|
1004 | 1005 | mate_ref = pRefId2name[mate1.rname]
|
1005 |
| - has_rf.extend(sorted( |
1006 |
| - pRfPositions[mate_ref][frag_start: frag_end])) |
| 1006 | + if mate_ref in pRfPositions: |
| 1007 | + has_rf.extend(sorted( |
| 1008 | + pRfPositions[mate_ref][frag_start: frag_end])) |
1007 | 1009 |
|
1008 | 1010 | # case when there is no restriction fragment site between the
|
1009 | 1011 | # mates
|
@@ -1071,7 +1073,7 @@ def process_data(pMateBuffer1, pMateBuffer2, pMinMappingQuality,
|
1071 | 1073 | mate_not_close_to_rf, count_inward, count_outward,
|
1072 | 1074 | count_left, count_right, inter_chromosomal, short_range, long_range, pair_added, len(pMateBuffer1), pResultIndex, pCounter, out_bam_index_buffer]])
|
1073 | 1075 | except Exception as exp:
|
1074 |
| - pQueueOut.put('Fail: ' + str(exp)) |
| 1076 | + pQueueOut.put('Fail: ' + str(exp) + traceback.format_exc()) |
1075 | 1077 | return
|
1076 | 1078 | return
|
1077 | 1079 |
|
@@ -1147,7 +1149,7 @@ def main(args=None):
|
1147 | 1149 | rf_interval.extend(bed2interval_list(restrictionCutFile))
|
1148 | 1150 |
|
1149 | 1151 | rf_positions = intervalListToIntervalTree(rf_interval)
|
1150 |
| - |
| 1152 | + log.debug('rf_positions {}'.format(rf_positions.keys())) |
1151 | 1153 | if args.binSize:
|
1152 | 1154 | bin_intervals = get_bins(args.binSize[0], chrom_sizes, args.region)
|
1153 | 1155 | else:
|
|
0 commit comments