comparison read2mut.py @ 46:f733c425b804 draft

planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
author mheinzl
date Tue, 09 Mar 2021 12:43:22 +0000
parents abb937211f2e
children edf8596463a8
comparison
equal deleted inserted replaced
45:abb937211f2e 46:f733c425b804
293 counter_tier22 = 0 293 counter_tier22 = 0
294 counter_tier23 = 0 294 counter_tier23 = 0
295 counter_tier24 = 0 295 counter_tier24 = 0
296 counter_tier31 = 0 296 counter_tier31 = 0
297 counter_tier32 = 0 297 counter_tier32 = 0
298 counter_tier33 = 0 298 counter_tier25 = 0
299 counter_tier4 = 0 299 counter_tier4 = 0
300 # if chimera_correction: 300 # if chimera_correction:
301 # counter_tier43 = 0 301 # counter_tier43 = 0
302 counter_tier51 = 0 302 counter_tier51 = 0
303 counter_tier52 = 0 303 counter_tier52 = 0
322 dcs_median = cvrg_dict[key1][2] 322 dcs_median = cvrg_dict[key1][2]
323 whole_array = pure_tags_dict_short[key1].keys() 323 whole_array = pure_tags_dict_short[key1].keys()
324 324
325 tier_dict[key1] = {} 325 tier_dict[key1] = {}
326 values_tier_dict = [("tier 1.1", 0), ("tier 1.2", 0), ("tier 2.1", 0), ("tier 2.2", 0), ("tier 2.3", 0), ("tier 2.4", 0), ("tier 3.1", 0), 326 values_tier_dict = [("tier 1.1", 0), ("tier 1.2", 0), ("tier 2.1", 0), ("tier 2.2", 0), ("tier 2.3", 0), ("tier 2.4", 0), ("tier 3.1", 0),
327 ("tier 3.2", 0), ("tier 3.3", 0), ("tier 4", 0), ("tier 5.1", 0), ("tier 5.2", 0), ("tier 5.3", 0), ("tier 5.4", 0), ("tier 5.5", 0), 327 ("tier 3.2", 0), ("tier 2.5", 0), ("tier 4", 0), ("tier 5.1", 0), ("tier 5.2", 0), ("tier 5.3", 0), ("tier 5.4", 0), ("tier 5.5", 0),
328 ("tier 6", 0), ("tier 7", 0)] 328 ("tier 6", 0), ("tier 7", 0)]
329 for k, v in values_tier_dict: 329 for k, v in values_tier_dict:
330 tier_dict[key1][k] = v 330 tier_dict[key1][k] = v
331 331
332 used_keys = [] 332 used_keys = []
825 alt3f = 0 825 alt3f = 0
826 trimmed = True 826 trimmed = True
827 details1 = (total1, total4, total1new, total4new, ref1, ref4, alt1, alt4, ref1f, ref4f, alt1f, alt4f, na1, na4, lowq1, lowq4, beg1, beg4) 827 details1 = (total1, total4, total1new, total4new, ref1, ref4, alt1, alt4, ref1f, ref4f, alt1f, alt4f, na1, na4, lowq1, lowq4, beg1, beg4)
828 details2 = (total2, total3, total2new, total3new, ref2, ref3, alt2, alt3, ref2f, ref3f, alt2f, alt3f, na2, na3, lowq2, lowq3, beg2, beg3) 828 details2 = (total2, total3, total2new, total3new, ref2, ref3, alt2, alt3, ref2f, ref3f, alt2f, alt3f, na2, na3, lowq2, lowq3, beg2, beg3)
829 829
830
831 sum_highTiers = sum([tier_dict[key1][ij] for ij in tier_dict[key1].keys()[:6]])
832
830 # assign tiers 833 # assign tiers
831 if ((all(int(ij) >= 3 for ij in [total1new, total4new]) & 834 if ((all(int(ij) >= 3 for ij in [total1new, total4new]) &
832 all(float(ij) >= 0.75 for ij in [alt1ff, alt4ff])) | 835 all(float(ij) >= 0.75 for ij in [alt1ff, alt4ff])) |
833 (all(int(ij) >= 3 for ij in [total2new, total3new]) & 836 (all(int(ij) >= 3 for ij in [total2new, total3new]) &
834 all(float(ij) >= 0.75 for ij in [alt2ff, alt3ff]))): 837 all(float(ij) >= 0.75 for ij in [alt2ff, alt3ff]))):
893 all(float(ij) >= 0.5 for ij in [alt2ff, alt3ff]))): 896 all(float(ij) >= 0.5 for ij in [alt2ff, alt3ff]))):
894 tier = "3.2" 897 tier = "3.2"
895 counter_tier32 += 1 898 counter_tier32 += 1
896 tier_dict[key1]["tier 3.2"] += 1 899 tier_dict[key1]["tier 3.2"] += 1
897 900
898 elif (trimmed) and (len(pure_tags_dict_short[key1]) > 1): 901 elif (trimmed) and (sum_highTiers > 1):
899 tier = "3.3" 902 tier = "2.5"
900 counter_tier33 += 1 903 counter_tier25 += 1
901 tier_dict[key1]["tier 3.3"] += 1 904 tier_dict[key1]["tier 2.5"] += 1
902 905
903 elif (trimmed): 906 elif (trimmed):
904 tier = "4" 907 tier = "4"
905 counter_tier4 += 1 908 counter_tier4 += 1
906 tier_dict[key1]["tier 4"] += 1 909 tier_dict[key1]["tier 4"] += 1
1036 'criteria': '=OR($B${}="1.1", $B${}="1.2")'.format(row + 1, row + 1), 1039 'criteria': '=OR($B${}="1.1", $B${}="1.2")'.format(row + 1, row + 1),
1037 'format': format1, 1040 'format': format1,
1038 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)}) 1041 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
1039 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2), 1042 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
1040 {'type': 'formula', 1043 {'type': 'formula',
1041 'criteria': '=OR($B${}="2.1", $B${}="2.2", $B${}="2.3", $B${}="2.4")'.format(row + 1, row + 1, row + 1, row + 1), 1044 '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),
1042 'format': format3, 1045 'format': format3,
1043 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)}) 1046 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
1044 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2), 1047 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
1045 {'type': 'formula', 1048 {'type': 'formula',
1046 'criteria': '=$B${}>="3"'.format(row + 1), 1049 'criteria': '=$B${}>="3"'.format(row + 1),
1061 chimeric_dcs_high_tiers += high_tiers 1064 chimeric_dcs_high_tiers += high_tiers
1062 chimera_dict[key1] = (chimeric_dcs, chimeric_dcs_high_tiers) 1065 chimera_dict[key1] = (chimeric_dcs, chimeric_dcs_high_tiers)
1063 # sheet 2 1066 # sheet 2
1064 if chimera_correction: 1067 if chimera_correction:
1065 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)', 1068 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)',
1066 'tier 1.1', 'tier 1.2', 'tier 2.1', 'tier 2.2', 'tier 2.3', 'tier 2.4', 1069 'tier 1.1', 'tier 1.2', 'tier 2.1', 'tier 2.2', 'tier 2.3', 'tier 2.4', 'tier 2.5',
1067 'tier 3.1', 'tier 3.2', 'tier 3.3', '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', 1070 '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',
1068 'AF 1.1-2.3', 'AF 1.1-2.4', 'AF 1.1-3.1', 'AF 1.1-3.2', 'AF 1.1-4.1', 'AF 1.1-4.2', 'AF 1.1-5.1', 'AF 1.1-5.2', 'AF 1.1-5.3', 'AF 1.1-5.4', 'AF 1.1-5.5', 'AF 1.1-6') 1071 'AF 1.1-2.3', 'AF 1.1-2.4', 'AF 1.1-3.1', 'AF 1.1-3.2', 'AF 1.1-4.1', 'AF 1.1-4.2', 'AF 1.1-5.1', 'AF 1.1-5.2', 'AF 1.1-5.3', 'AF 1.1-5.4', 'AF 1.1-5.5', 'AF 1.1-6')
1069 else: 1072 else:
1070 header_line2 = ('variant ID', 'cvrg', 'AC alt (all tiers)', 'AF (all tiers)', 'cvrg (tiers 1.1-2.4)', 'AC alt (tiers 1.1-2.4)', 'AF (tiers 1.1-2.4)', 'AC alt (orginal DCS)', 'AF (original DCS)', 1073 header_line2 = ('variant ID', 'cvrg', 'AC alt (all tiers)', 'AF (all tiers)', 'cvrg (tiers 1.1-2.4)', 'AC alt (tiers 1.1-2.4)', 'AF (tiers 1.1-2.4)', 'AC alt (orginal DCS)', 'AF (original DCS)',
1071 'tier 1.1', 'tier 1.2', 'tier 2.1', 'tier 2.2', 'tier 2.3', 'tier 2.4', 1074 'tier 1.1', 'tier 1.2', 'tier 2.1', 'tier 2.2', 'tier 2.3', 'tier 2.4', 'tier 2.5',
1072 'tier 3.1', 'tier 3.2', 'tier 3.3', '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', 1075 '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',
1073 'AF 1.1-2.3', 'AF 1.1-2.4', 'AF 1.1-3.1', 'AF 1.1-3.2', 'AF 1.1-4.1', 'AF 1.1-4.2', 'AF 1.1-5.1', 'AF 1.1-5.2', 'AF 1.1-5.3', 'AF 1.1-5.4', 'AF 1.1-5.5', 'AF 1.1-6') 1076 'AF 1.1-2.3', 'AF 1.1-2.4', 'AF 1.1-3.1', 'AF 1.1-3.2', 'AF 1.1-4.1', 'AF 1.1-4.2', 'AF 1.1-5.1', 'AF 1.1-5.2', 'AF 1.1-5.3', 'AF 1.1-5.4', 'AF 1.1-5.5', 'AF 1.1-6')
1074 1077
1075 ws2.write_row(0, 0, header_line2) 1078 ws2.write_row(0, 0, header_line2)
1076 row = 0 1079 row = 0
1077 1080
1105 fraction_chimeras = safe_div(chimeras_all, float(sum(used_tiers))) 1108 fraction_chimeras = safe_div(chimeras_all, float(sum(used_tiers)))
1106 if fraction_chimeras is None: 1109 if fraction_chimeras is None:
1107 fraction_chimeras = 0. 1110 fraction_chimeras = 0.
1108 new_cvrg = cvrg * (1. - fraction_chimeras) 1111 new_cvrg = cvrg * (1. - fraction_chimeras)
1109 lst.extend([chimeras_all, new_cvrg, safe_div(new_alt, new_cvrg)]) 1112 lst.extend([chimeras_all, new_cvrg, safe_div(new_alt, new_cvrg)])
1110 lst.extend([(cvrg - sum(used_tiers[-11:])), sum(used_tiers[0:6]), safe_div(sum(used_tiers[0:6]), (cvrg - sum(used_tiers[-11:])))]) 1113 lst.extend([(cvrg - sum(used_tiers[-10:])), sum(used_tiers[0:7]), safe_div(sum(used_tiers[0:7]), (cvrg - sum(used_tiers[-10:])))])
1111 if chimera_correction: 1114 if chimera_correction:
1112 chimeras_all = chimera_dict[key1][1] 1115 chimeras_all = chimera_dict[key1][1]
1113 new_alt = sum(used_tiers[0:6]) - chimeras_all 1116 new_alt = sum(used_tiers[0:7]) - chimeras_all
1114 fraction_chimeras = safe_div(chimeras_all, float(sum(used_tiers[0:6]))) 1117 fraction_chimeras = safe_div(chimeras_all, float(sum(used_tiers[0:7])))
1115 if fraction_chimeras is None: 1118 if fraction_chimeras is None:
1116 fraction_chimeras = 0. 1119 fraction_chimeras = 0.
1117 new_cvrg = (cvrg - sum(used_tiers[-11:])) * (1. - fraction_chimeras) 1120 new_cvrg = (cvrg - sum(used_tiers[-10:])) * (1. - fraction_chimeras)
1118 lst.extend([chimeras_all, new_cvrg, safe_div(new_alt, new_cvrg)]) 1121 lst.extend([chimeras_all, new_cvrg, safe_div(new_alt, new_cvrg)])
1119 lst.extend([alt_count, safe_div(alt_count, cvrg)]) 1122 lst.extend([alt_count, safe_div(alt_count, cvrg)])
1120 lst.extend(used_tiers) 1123 lst.extend(used_tiers)
1121 lst.extend(cum_af) 1124 lst.extend(cum_af)
1122 lst = tuple(lst) 1125 lst = tuple(lst)
1123 ws2.write_row(row + 1, 0, lst) 1126 ws2.write_row(row + 1, 0, lst)
1124 if chimera_correction: 1127 if chimera_correction:
1125 ws2.conditional_format('P{}:Q{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$P$1="tier 1.1"', 'format': format12, 'multi_range': 'P{}:Q{} P1:Q1'.format(row + 2, row + 2)}) 1128 ws2.conditional_format('P{}:Q{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$P$1="tier 1.1"', 'format': format12, 'multi_range': 'P{}:Q{} P1:Q1'.format(row + 2, row + 2)})
1126 ws2.conditional_format('R{}:U{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$R$1="tier 2.1"', 'format': format32, 'multi_range': 'R{}:U{} R1:U1'.format(row + 2, row + 2)}) 1129 ws2.conditional_format('R{}:V{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$R$1="tier 2.1"', 'format': format32, 'multi_range': 'R{}:V{} R1:V1'.format(row + 2, row + 2)})
1127 ws2.conditional_format('V{}:AF{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$V$1="tier 3.1"', 'format': format22, 'multi_range': 'V{}:AF{} V1:AF1'.format(row + 2, row + 2)}) 1130 ws2.conditional_format('W{}:AF{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$W$1="tier 3.1"', 'format': format22, 'multi_range': 'W{}:AF{} W1:AF1'.format(row + 2, row + 2)})
1128 else: 1131 else:
1129 ws2.conditional_format('J{}:K{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$J$1="tier 1.1"', 'format': format12, 'multi_range': 'J{}:K{} J1:K1'.format(row + 2, row + 2)}) 1132 ws2.conditional_format('J{}:K{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$J$1="tier 1.1"', 'format': format12, 'multi_range': 'J{}:K{} J1:K1'.format(row + 2, row + 2)})
1130 ws2.conditional_format('L{}:O{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$L$1="tier 2.1"', 'format': format32, 'multi_range': 'L{}:O{} L1:O1'.format(row + 2, row + 2)}) 1133 ws2.conditional_format('L{}:P{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$L$1="tier 2.1"', 'format': format32, 'multi_range': 'L{}:P{} L1:P1'.format(row + 2, row + 2)})
1131 ws2.conditional_format('P{}:Z{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$P$1="tier 3.1"', 'format': format22, 'multi_range': 'P{}:Z{} P1:Z1'.format(row + 2, row + 2)}) 1134 ws2.conditional_format('Q{}:Z{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$P$1="tier 3.1"', 'format': format22, 'multi_range': 'Q{}:Z{} Q1:Z1'.format(row + 2, row + 2)})
1132 row += 1 1135 row += 1
1133 1136
1134 # sheet 3 1137 # sheet 3
1135 sheet3 = [("tier 1.1", counter_tier11), ("tier 1.2", counter_tier12), ("tier 2.1", counter_tier21), 1138 sheet3 = [("tier 1.1", counter_tier11), ("tier 1.2", counter_tier12), ("tier 2.1", counter_tier21),
1136 ("tier 2.2", counter_tier22), ("tier 2.3", counter_tier23), ("tier 2.4", counter_tier24), 1139 ("tier 2.2", counter_tier22), ("tier 2.3", counter_tier23), ("tier 2.4", counter_tier24), ("tier 2.5", counter_tier25),
1137 ("tier 3.1", counter_tier31), ("tier 3.2", counter_tier32), ("tier 3.3", counter_tier33), ("tier 4", counter_tier4), 1140 ("tier 3.1", counter_tier31), ("tier 3.2", counter_tier32), ("tier 4", counter_tier4),
1138 ("tier 5.1", counter_tier51), ("tier 5.2", counter_tier52), 1141 ("tier 5.1", counter_tier51), ("tier 5.2", counter_tier52),
1139 ("tier 5.3", counter_tier53), ("tier 5.4", counter_tier54), ("tier 5.5", counter_tier55), ("tier 6", counter_tier6), ("tier 7", counter_tier7)] 1142 ("tier 5.3", counter_tier53), ("tier 5.4", counter_tier54), ("tier 5.5", counter_tier55), ("tier 6", counter_tier6), ("tier 7", counter_tier7)]
1140 1143
1141 header = ("tier", "count") 1144 header = ("tier", "count")
1142 ws3.write_row(0, 0, header) 1145 ws3.write_row(0, 0, header)
1147 {'type': 'formula', 1150 {'type': 'formula',
1148 'criteria': '=OR($A${}="tier 1.1", $A${}="tier 1.2")'.format(i + 2, i + 2), 1151 'criteria': '=OR($A${}="tier 1.1", $A${}="tier 1.2")'.format(i + 2, i + 2),
1149 'format': format1}) 1152 'format': format1})
1150 ws3.conditional_format('A{}:B{}'.format(i + 2, i + 2), 1153 ws3.conditional_format('A{}:B{}'.format(i + 2, i + 2),
1151 {'type': 'formula', 1154 {'type': 'formula',
1152 'criteria': '=OR($A${}="tier 2.1", $A${}="tier 2.2", $A${}="tier 2.3", $A${}="tier 2.4")'.format(i + 2, i + 2, i + 2, i + 2), 1155 'criteria': '=OR($A${}="tier 2.1", $A${}="tier 2.2", $A${}="tier 2.3", $A${}="tier 2.4", $A${}="tier 2.5")'.format(i + 2, i + 2, i + 2, i + 2, i + 2),
1153 'format': format3}) 1156 'format': format3})
1154 ws3.conditional_format('A{}:B{}'.format(i + 2, i + 2), 1157 ws3.conditional_format('A{}:B{}'.format(i + 2, i + 2),
1155 {'type': 'formula', 1158 {'type': 'formula',
1156 'criteria': '=$A${}>="3"'.format(i + 2), 1159 'criteria': '=$A${}>="3"'.format(i + 2),
1157 'format': format2}) 1160 'format': format2})
1253 ex = examples_tiers[i] 1256 ex = examples_tiers[i]
1254 for k in range(len(ex)): 1257 for k in range(len(ex)):
1255 ws3.write_row(start_row + 2 + row + i + k + 2, 0, ex[k]) 1258 ws3.write_row(start_row + 2 + row + i + k + 2, 0, ex[k])
1256 ws3.conditional_format('L{}:M{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3), {'type': 'formula', 'criteria': '=OR($B${}="1.1", $B${}="1.2")'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2), 'format': format13, 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3)}) 1259 ws3.conditional_format('L{}:M{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3), {'type': 'formula', 'criteria': '=OR($B${}="1.1", $B${}="1.2")'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2), 'format': format13, 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3)})
1257 ws3.conditional_format('L{}:M{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3), 1260 ws3.conditional_format('L{}:M{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3),
1258 {'type': 'formula', 'criteria': '=OR($B${}="2.1",$B${}="2.2", $B${}="2.3", $B${}="2.4")'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2), 1261 {'type': 'formula', 'criteria': '=OR($B${}="2.1",$B${}="2.2", $B${}="2.3", $B${}="2.4", $B${}="2.5")'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2),
1259 'format': format33, 1262 'format': format33,
1260 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3)}) 1263 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3)})
1261 ws3.conditional_format('L{}:M{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3), 1264 ws3.conditional_format('L{}:M{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3),
1262 {'type': 'formula', 1265 {'type': 'formula',
1263 'criteria': '=$B${}>="3"'.format(start_row + 2 + row + i + k + 2), 1266 'criteria': '=$B${}>="3"'.format(start_row + 2 + row + i + k + 2),