Mercurial > repos > mheinzl > variant_analyzer2
comparison read2mut.py @ 67:60e813039aae draft
planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
author | mheinzl |
---|---|
date | Thu, 18 Mar 2021 10:42:19 +0000 |
parents | d20be7e66378 |
children | 4dfed0998184 |
comparison
equal
deleted
inserted
replaced
66:d20be7e66378 | 67:60e813039aae |
---|---|
1193 'format': format2, | 1193 'format': format2, |
1194 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row_number + 1, row_number + 2, row_number + 1, row_number + 2, row_number + 1, row_number + 2)}) | 1194 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row_number + 1, row_number + 2, row_number + 1, row_number + 2, row_number + 1, row_number + 2)}) |
1195 | 1195 |
1196 # sheet 2 | 1196 # sheet 2 |
1197 if chimera_correction: | 1197 if chimera_correction: |
1198 header_line2 = ('variant ID', 'cvrg', 'AC alt (all tiers)', 'AF (all tiers)', 'cvrg (tiers 1.1-2.5)', 'AC alt (tiers 1.1-2.5)', 'AF (tiers 1.1-2.5)', 'chimeras in AC alt (tiers 1.1-2.5)', 'chimera-corrected cvrg (tiers 1.1-2.5)', 'chimera-corrected AF (tiers 1.1-2.5)', 'AC alt (orginal DCS)', 'AF (original DCS)', | 1198 header_line2 = ('variant ID', 'cvrg', 'AC alt (all tiers)', 'AF (all tiers)', 'cvrg (tiers 1.1-2.5)', 'AC alt (tiers 1.1-2.5)', 'AF (tiers 1.1-2.5)', 'chimera-corrected cvrg (tiers 1.1-2.5)', 'chimeras in AC alt (tiers 1.1-2.5)', 'chimera-corrected AF (tiers 1.1-2.5)', 'AC alt (orginal DCS)', 'AF (original DCS)', |
1199 'tier 1.1', 'tier 1.2', 'tier 2.1', 'tier 2.2', 'tier 2.3', 'tier 2.4', 'tier 2.5', | 1199 'tier 1.1', 'tier 1.2', 'tier 2.1', 'tier 2.2', 'tier 2.3', 'tier 2.4', 'tier 2.5', |
1200 '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', | 1200 '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', |
1201 'AF 1.1-2.3', 'AF 1.1-2.4', 'AF 1.1-2.5', 'AF 1.1-3.1', 'AF 1.1-3.2', 'AF 1.1-4', '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', 'AF 1.1-7') | 1201 'AF 1.1-2.3', 'AF 1.1-2.4', 'AF 1.1-2.5', 'AF 1.1-3.1', 'AF 1.1-3.2', 'AF 1.1-4', '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', 'AF 1.1-7') |
1202 else: | 1202 else: |
1203 header_line2 = ('variant ID', 'cvrg', 'AC alt (all tiers)', 'AF (all tiers)', 'cvrg (tiers 1.1-2.5)', 'AC alt (tiers 1.1-2.5)', 'AF (tiers 1.1-2.5)', 'AC alt (orginal DCS)', 'AF (original DCS)', | 1203 header_line2 = ('variant ID', 'cvrg', 'AC alt (all tiers)', 'AF (all tiers)', 'cvrg (tiers 1.1-2.5)', 'AC alt (tiers 1.1-2.5)', 'AF (tiers 1.1-2.5)', 'AC alt (orginal DCS)', 'AF (original DCS)', |
1238 new_alt = sum(used_tiers[0:7]) - chimeras_all | 1238 new_alt = sum(used_tiers[0:7]) - chimeras_all |
1239 fraction_chimeras = safe_div(chimeras_all, float(sum(used_tiers[0:7]))) | 1239 fraction_chimeras = safe_div(chimeras_all, float(sum(used_tiers[0:7]))) |
1240 if fraction_chimeras is None: | 1240 if fraction_chimeras is None: |
1241 fraction_chimeras = 0. | 1241 fraction_chimeras = 0. |
1242 new_cvrg = (cvrg - sum(used_tiers[-10:])) * (1. - fraction_chimeras) | 1242 new_cvrg = (cvrg - sum(used_tiers[-10:])) * (1. - fraction_chimeras) |
1243 lst.extend([chimeras_all, new_cvrg, safe_div(new_alt, new_cvrg)]) | 1243 lst.extend([new_cvrg, chimeras_all, safe_div(new_alt, new_cvrg)]) |
1244 lst.extend([alt_count, safe_div(alt_count, cvrg)]) | 1244 lst.extend([alt_count, safe_div(alt_count, cvrg)]) |
1245 lst.extend(used_tiers) | 1245 lst.extend(used_tiers) |
1246 lst.extend(cum_af) | 1246 lst.extend(cum_af) |
1247 lst = tuple(lst) | 1247 lst = tuple(lst) |
1248 ws2.write_row(row + 1, 0, lst) | 1248 ws2.write_row(row + 1, 0, lst) |