# HG changeset patch # User mheinzl # Date 1682442398 0 # Node ID 1a5974404d4fb3b95ba1f1c7b6f0e22c60b06756 # Parent 63e4e5d9a98f5a2539c9dbd5010cc43d4c0f684c planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8-dirty diff -r 63e4e5d9a98f -r 1a5974404d4f read2mut.py --- a/read2mut.py Sat Apr 22 10:06:51 2023 +0000 +++ b/read2mut.py Tue Apr 25 17:06:38 2023 +0000 @@ -383,7 +383,6 @@ ws3 = workbook3.add_worksheet("Tiers") current_result_sheet = ws1 - format1 = workbook.add_format({'bg_color': '#BCF5A9'}) # green format2 = workbook.add_format({'bg_color': '#FFC7CE'}) # red format3 = workbook.add_format({'bg_color': '#FACC2E'}) # yellow @@ -403,7 +402,7 @@ 'na.ab', 'na.ba', 'lowq.ab', 'lowq.ba', 'trim.ab', 'trim.ba', 'SSCS alt.ab', 'SSCS alt.ba', 'SSCS ref.ab', 'SSCS ref.ba', 'in phase', 'chimeric tag') - ws1.write_row(0, 0, header_line) + current_result_sheet.write_row(0, 0, header_line) csv_writer.writerow(header_line) counter_tier11 = 0 @@ -697,6 +696,7 @@ count_sheet += 1 ws_new = workbook.add_worksheet("Results" + str(count_sheet)) current_result_sheet = ws_new + current_result_sheet.write_row(0, 0, header_line) row = 1 if variant_type == "alt": @@ -1295,14 +1295,14 @@ half1_mate2 = array2_half2 half2_mate2 = array2_half # calculate HD of "a" in the tag to all "a's" or "b" in the tag to all "b's" - dist = np.array([sum(itertools.imap(operator.ne, half1_mate1, c)) for c in half1_mate2]) + dist = np.array([sum(itertools.map(operator.ne, half1_mate1, c)) for c in half1_mate2]) min_index = np.where(dist == dist.min()) # get index of min HD # get all "b's" of the tag or all "a's" of the tag with minimum HD min_tag_half2 = half2_mate2[min_index] min_tag_array2 = array2[min_index] # get whole tag with min HD min_value = dist.min() # calculate HD of "b" to all "b's" or "a" to all "a's" - dist_second_half = np.array([sum(itertools.imap(operator.ne, half2_mate1, e)) + dist_second_half = np.array([sum(itertools.map(operator.ne, half2_mate1, e)) for e in min_tag_half2]) dist2 = dist_second_half.max() max_index = np.where(dist_second_half == dist_second_half.max())[0] # get index of max HD diff -r 63e4e5d9a98f -r 1a5974404d4f read2mut.xml --- a/read2mut.xml Sat Apr 22 10:06:51 2023 +0000 +++ b/read2mut.xml Tue Apr 25 17:06:38 2023 +0000 @@ -1,5 +1,5 @@ - + Looks for reads with a mutation at known positions and calculates frequencies and stats. va_macros.xml