Skip to content

Commit

Permalink
Fix: error handling of SV types #77.
Browse files Browse the repository at this point in the history
  • Loading branch information
arnikz committed Dec 2, 2020
1 parent e1b19a5 commit ce98aca
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions scripts/genome_wide/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ def get_filepath(vec_type):

logging.info('Loading SR positions')

total_reads_coord_min_support = []
chrlist = get_chr_list()
chr_list = chrlist # if sampleName != 'T1' else ['17']

Expand All @@ -438,20 +439,19 @@ def get_filepath(vec_type):
left_clipped_pos_cnt, right_clipped_pos_cnt = json.loads(
fin.read().decode('utf-8'))

if svtype == 'DEL':
total_reads_coord_min_support = total_reads_coord_min_support_json['DEL'] + \
total_reads_coord_min_support_json['INDEL_DEL']
elif svtype == 'INS':
total_reads_coord_min_support = total_reads_coord_min_support_json['INS'] + \
total_reads_coord_min_support_json['INDEL_INS']
else:
total_reads_coord_min_support = total_reads_coord_min_support_json[
svtype]
if svtype in total_reads_coord_min_support_json:
if svtype in ('DEL', 'INDEL_DEL'):
total_reads_coord_min_support = total_reads_coord_min_support_json['DEL'] + \
total_reads_coord_min_support_json['INDEL_DEL']
elif svtype in ('INS', 'INDEL_INS'):
total_reads_coord_min_support = total_reads_coord_min_support_json['INS'] + \
total_reads_coord_min_support_json['INDEL_INS']
else:
total_reads_coord_min_support = total_reads_coord_min_support_json[svtype]

locations_sr = dict()
locations_cr_r = dict()
locations_cr_l = dict()

positions_cr = dict()

for chrom in chr_list:
Expand Down

0 comments on commit ce98aca

Please sign in to comment.