Mercurial > repos > mheinzl > variant_analyzer2
comparison read2mut.py @ 4:386438cd4c3b draft
planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
author | mheinzl |
---|---|
date | Tue, 27 Oct 2020 12:39:21 +0000 |
parents | 4fc62ab6e9e8 |
children | d9cbf833624e |
comparison
equal
deleted
inserted
replaced
3:4fc62ab6e9e8 | 4:386438cd4c3b |
---|---|
229 'read median length.ba', 'DCS median length', | 229 'read median length.ba', 'DCS median length', |
230 'FS.ab', 'FS.ba', 'FSqc.ab', 'FSqc.ba', 'ref.ab', 'ref.ba', 'alt.ab', 'alt.ba', | 230 'FS.ab', 'FS.ba', 'FSqc.ab', 'FSqc.ba', 'ref.ab', 'ref.ba', 'alt.ab', 'alt.ba', |
231 'rel. ref.ab', 'rel. ref.ba', 'rel. alt.ab', 'rel. alt.ba', | 231 'rel. ref.ab', 'rel. ref.ba', 'rel. alt.ab', 'rel. alt.ba', |
232 'na.ab', 'na.ba', 'lowq.ab', 'lowq.ba', 'trim.ab', 'trim.ba', | 232 'na.ab', 'na.ba', 'lowq.ab', 'lowq.ba', 'trim.ab', 'trim.ba', |
233 'SSCS alt.ab', 'SSCS alt.ba', 'SSCS ref.ab', 'SSCS ref.ba', | 233 'SSCS alt.ab', 'SSCS alt.ba', 'SSCS ref.ab', 'SSCS ref.ba', |
234 'other mut', 'chimeric tag') | 234 'in phase', 'chimeric tag') |
235 ws1.write_row(0, 0, header_line) | 235 ws1.write_row(0, 0, header_line) |
236 | 236 |
237 counter_tier11 = 0 | 237 counter_tier11 = 0 |
238 counter_tier12 = 0 | 238 counter_tier12 = 0 |
239 counter_tier21 = 0 | 239 counter_tier21 = 0 |
318 k1 = mut_read_dict[(key2[:-5] + '.ab.1')].keys() | 318 k1 = mut_read_dict[(key2[:-5] + '.ab.1')].keys() |
319 add_mut1 = len(k1) | 319 add_mut1 = len(k1) |
320 if add_mut1 > 1: | 320 if add_mut1 > 1: |
321 for k, v in mut_read_dict[(key2[:-5] + '.ab.1')].items(): | 321 for k, v in mut_read_dict[(key2[:-5] + '.ab.1')].items(): |
322 if k != key1: | 322 if k != key1: |
323 new_mut = str(k).split("#")[0] + "-" + str(int(str(k).split("#")[1]) + 1) + "-" + v[1] + "-" + v[0] | |
323 if len(add_mut14) == 0: | 324 if len(add_mut14) == 0: |
324 add_mut14 = str(k) + "_" + v | 325 add_mut14 = new_mut |
325 else: | 326 else: |
326 add_mut14 = add_mut14 + ", " + str(k) + "_" + v | 327 add_mut14 = add_mut14 + ", " + new_mut |
327 else: | 328 else: |
328 k1 = [] | 329 k1 = [] |
329 else: | 330 else: |
330 total1 = total1new = na1 = lowq1 = 0 | 331 total1 = total1new = na1 = lowq1 = 0 |
331 ref1 = alt1 = ref1f = alt1f = 0 | 332 ref1 = alt1 = ref1f = alt1f = 0 |
360 k2 = mut_read_dict[(key2[:-5] + '.ab.2')].keys() | 361 k2 = mut_read_dict[(key2[:-5] + '.ab.2')].keys() |
361 add_mut2 = len(k2) | 362 add_mut2 = len(k2) |
362 if add_mut2 > 1: | 363 if add_mut2 > 1: |
363 for k, v in mut_read_dict[(key2[:-5] + '.ab.2')].items(): | 364 for k, v in mut_read_dict[(key2[:-5] + '.ab.2')].items(): |
364 if k != key1: | 365 if k != key1: |
366 new_mut = str(k).split("#")[0] + "-" + str(int(str(k).split("#")[1]) + 1) + "-" + v[1] + "-" + v[0] | |
365 if len(add_mut23) == 0: | 367 if len(add_mut23) == 0: |
366 add_mut23 = str(k) + "_" + v | 368 add_mut23 = new_mut |
367 else: | 369 else: |
368 add_mut23 = add_mut23 + ", " + str(k) + "_" + v | 370 add_mut23 = add_mut23 + ", " + new_mut |
369 else: | 371 else: |
370 k2 = [] | 372 k2 = [] |
371 else: | 373 else: |
372 total2 = total2new = na2 = lowq2 = 0 | 374 total2 = total2new = na2 = lowq2 = 0 |
373 ref2 = alt2 = ref2f = alt2f = 0 | 375 ref2 = alt2 = ref2f = alt2f = 0 |
401 if (key2[:-5] + '.ba.1') in mut_read_dict.keys(): | 403 if (key2[:-5] + '.ba.1') in mut_read_dict.keys(): |
402 add_mut3 = len(mut_read_dict[(key2[:-5] + '.ba.1')].keys()) | 404 add_mut3 = len(mut_read_dict[(key2[:-5] + '.ba.1')].keys()) |
403 if add_mut3 > 1: | 405 if add_mut3 > 1: |
404 for k, v in mut_read_dict[(key2[:-5] + '.ba.1')].items(): | 406 for k, v in mut_read_dict[(key2[:-5] + '.ba.1')].items(): |
405 if k != key1 and k not in k2: | 407 if k != key1 and k not in k2: |
408 new_mut = str(k).split("#")[0] + "-" + str(int(str(k).split("#")[1]) + 1) + "-" + v[1] + "-" + v[0] | |
406 if len(add_mut23) == 0: | 409 if len(add_mut23) == 0: |
407 add_mut23 = str(k) + "_" + v | 410 add_mut23 = new_mut |
408 else: | 411 else: |
409 add_mut23 = add_mut23 + ", " + str(k) + "_" + v | 412 add_mut23 = add_mut23 + ", " + new_mut |
410 else: | 413 else: |
411 total3 = total3new = na3 = lowq3 = 0 | 414 total3 = total3new = na3 = lowq3 = 0 |
412 ref3 = alt3 = ref3f = alt3f = 0 | 415 ref3 = alt3 = ref3f = alt3f = 0 |
413 | 416 |
414 if key2[:-5] + '.ba.2' in mut_dict[key1].keys(): | 417 if key2[:-5] + '.ba.2' in mut_dict[key1].keys(): |
439 if (key2[:-5] + '.ba.2') in mut_read_dict.keys(): | 442 if (key2[:-5] + '.ba.2') in mut_read_dict.keys(): |
440 add_mut4 = len(mut_read_dict[(key2[:-5] + '.ba.2')].keys()) | 443 add_mut4 = len(mut_read_dict[(key2[:-5] + '.ba.2')].keys()) |
441 if add_mut4 > 1: | 444 if add_mut4 > 1: |
442 for k, v in mut_read_dict[(key2[:-5] + '.ba.2')].items(): | 445 for k, v in mut_read_dict[(key2[:-5] + '.ba.2')].items(): |
443 if k != key1 and k not in k1: | 446 if k != key1 and k not in k1: |
447 new_mut = str(k).split("#")[0] + "-" + str(int(str(k).split("#")[1]) + 1) + "-" + v[1] + "-" + v[0] | |
444 if len(add_mut14) == 0: | 448 if len(add_mut14) == 0: |
445 add_mut14 = str(k) + "_" + v | 449 add_mut14 = new_mut |
446 else: | 450 else: |
447 add_mut14 = add_mut14 + ", " + str(k) + "_" + v | 451 add_mut14 = add_mut14 + ", " + new_mut |
448 else: | 452 else: |
449 total4 = total4new = na4 = lowq4 = 0 | 453 total4 = total4new = na4 = lowq4 = 0 |
450 ref4 = alt4 = ref4f = alt4f = 0 | 454 ref4 = alt4 = ref4f = alt4f = 0 |
451 | 455 |
452 read_pos1 = read_pos2 = read_pos3 = read_pos4 = -1 | 456 read_pos1 = read_pos2 = read_pos3 = read_pos4 = -1 |