comparison read2mut.py @ 50:b32c973fe8ab draft

planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
author mheinzl
date Thu, 11 Mar 2021 11:04:05 +0000
parents aa45100f5b14
children 26e53b5b8bcb
comparison
equal deleted inserted replaced
49:aa45100f5b14 50:b32c973fe8ab
1074 sum_highTiers = sum([tier_dict[key1][ij] for ij in tier_dict[key1].keys()[:6]]) 1074 sum_highTiers = sum([tier_dict[key1][ij] for ij in tier_dict[key1].keys()[:6]])
1075 if tier_dict[key1]["tier 4"] > 0 and sum_highTiers > 0: 1075 if tier_dict[key1]["tier 4"] > 0 and sum_highTiers > 0:
1076 tier_dict[key1]["tier 2.5"] = tier_dict[key1]["tier 4"] 1076 tier_dict[key1]["tier 2.5"] = tier_dict[key1]["tier 4"]
1077 tier_dict[key1]["tier 4"] = 0 1077 tier_dict[key1]["tier 4"] = 0
1078 lines = change_tier_after_print[key1] 1078 lines = change_tier_after_print[key1]
1079 l_i = 0 1079
1080 for li in lines: 1080 for sample in lines:
1081 row = li[0] 1081 l_i = 0
1082 new_line = li[1] 1082 for li in sample:
1083 if l_i == 0: 1083 row = li[0]
1084 new_line[1] == "2.5" 1084 new_line = li[1]
1085 ws1.write_row(row, 0, new_line) 1085 if l_i == 0:
1086 else: 1086 new_line[1] == "2.5"
1087 ws1.write_row(row + 1, 0, new_line) 1087 ws1.write_row(row, 0, new_line)
1088 1088 else:
1089 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2), 1089 ws1.write_row(row + 1, 0, new_line)
1090 {'type': 'formula', 1090
1091 'criteria': '=OR($B${}="1.1", $B${}="1.2")'.format(row + 1, row + 1), 1091 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
1092 'format': format1, 1092 {'type': 'formula',
1093 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)}) 1093 'criteria': '=OR($B${}="1.1", $B${}="1.2")'.format(row + 1, row + 1),
1094 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2), 1094 'format': format1,
1095 {'type': 'formula', 1095 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
1096 'criteria': '=OR($B${}="2.1", $B${}="2.2", $B${}="2.3", $B${}="2.4", $B${}="2.5")'.format(row + 1, row + 1, row + 1, row + 1, row + 1), 1096 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
1097 'format': format3, 1097 {'type': 'formula',
1098 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)}) 1098 'criteria': '=OR($B${}="2.1", $B${}="2.2", $B${}="2.3", $B${}="2.4", $B${}="2.5")'.format(row + 1, row + 1, row + 1, row + 1, row + 1),
1099 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2), 1099 'format': format3,
1100 {'type': 'formula', 1100 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
1101 'criteria': '=$B${}>="3"'.format(row + 1), 1101 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
1102 'format': format2, 1102 {'type': 'formula',
1103 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)}) 1103 'criteria': '=$B${}>="3"'.format(row + 1),
1104 1104 'format': format2,
1105 l_i += 1 1105 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
1106 1106
1107 l_i += 1
1108
1107 # sheet 2 1109 # sheet 2
1108 if chimera_correction: 1110 if chimera_correction:
1109 header_line2 = ('variant ID', 'cvrg', 'AC alt (all tiers)', 'AF (all tiers)', 'chimeras in AC alt (all tiers)', 'chimera-corrected cvrg', 'chimera-corrected AF (all tiers)', 'cvrg (tiers 1.1-2.4)', 'AC alt (tiers 1.1-2.4)', 'AF (tiers 1.1-2.4)', 'chimeras in AC alt (tiers 1.1-2.4)', 'chimera-corrected cvrg (tiers 1.1-2.4)', 'chimera-corrected AF (tiers 1.1-2.4)', 'AC alt (orginal DCS)', 'AF (original DCS)', 1111 header_line2 = ('variant ID', 'cvrg', 'AC alt (all tiers)', 'AF (all tiers)', 'chimeras in AC alt (all tiers)', 'chimera-corrected cvrg', 'chimera-corrected AF (all tiers)', 'cvrg (tiers 1.1-2.4)', 'AC alt (tiers 1.1-2.4)', 'AF (tiers 1.1-2.4)', 'chimeras in AC alt (tiers 1.1-2.4)', 'chimera-corrected cvrg (tiers 1.1-2.4)', 'chimera-corrected AF (tiers 1.1-2.4)', 'AC alt (orginal DCS)', 'AF (original DCS)',
1110 'tier 1.1', 'tier 1.2', 'tier 2.1', 'tier 2.2', 'tier 2.3', 'tier 2.4', 'tier 2.5', 1112 'tier 1.1', 'tier 1.2', 'tier 2.1', 'tier 2.2', 'tier 2.3', 'tier 2.4', 'tier 2.5',
1111 'tier 3.1', 'tier 3.2', 'tier 4', 'tier 5.1', 'tier 5.2', 'tier 5.3', 'tier 5.4', 'tier 5.5', 'tier 6', 'tier 7', 'AF 1.1-1.2', 'AF 1.1-2.1', 'AF 1.1-2.2', 1113 'tier 3.1', 'tier 3.2', 'tier 4', 'tier 5.1', 'tier 5.2', 'tier 5.3', 'tier 5.4', 'tier 5.5', 'tier 6', 'tier 7', 'AF 1.1-1.2', 'AF 1.1-2.1', 'AF 1.1-2.2',