From 2dbc5841827d2f4d46d3d93636bc44a1f54b3532 Mon Sep 17 00:00:00 2001 From: Liudmyla Kondratova <47575662+lkondratova@users.noreply.github.com> Date: Thu, 22 Feb 2024 11:12:06 -0500 Subject: [PATCH] Add files via upload Separate isoforms with ref.len 0 and not args.is_fusion: + omitted_name = get_omitted_name(args) + omitted_iso = {} + for key in isoforms_info: + if not isoforms_info[key].refLen == 'NA': + if int(isoforms_info[key].refLen) <= int(args.min_ref_len): + omitted_iso[key] = isoforms_info[key] + for key in omitted_iso: + del isoforms_info[key] + omitted_keys = list(omitted_iso.keys()) + print(type(omitted_keys)) + omitted_keys.sort(key=lambda x: (omitted_iso[x].chrom,omitted_iso[x].id)) + print('Type omitted keys ', type(omitted_keys)) + with open(omitted_name, 'w') as h: + fout_omitted = DictWriter(h, fieldnames=fields_class_cur, delimiter='\t') + fout_omitted.writeheader() + for key in omitted_keys: + fout_omitted.writerow(omitted_iso[key].as_dict()) # sort isoform keys iso_keys = list(isoforms_info.keys()) iso_keys.sort(key=lambda x: (isoforms_info[x].chrom,isoforms_info[x].id)) @@ -2082,7 +2105,6 @@ def run(args): else: r['RTS_junction'] = 'FALSE' fout_junc.writerow(r) - #isoform hits to file if requested if args.isoform_hits: fields_hits =['Isoform', 'Isoform_length', 'Isoform_exon_number', 'Hit', 'Hit_length',