# HG changeset patch # User mheinzl # Date 1614162067 0 # Node ID b14b69697cf6186c3ddd3bd8d4b19a8fbf97fb8c # Parent afda74e874ac5e78f587602209845e057b97e564 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8 diff -r afda74e874ac -r b14b69697cf6 read2mut.py --- a/read2mut.py Wed Feb 24 09:39:24 2021 +0000 +++ b/read2mut.py Wed Feb 24 10:21:07 2021 +0000 @@ -237,13 +237,13 @@ else: pure_tags_dict_short = pure_tags_dict - #csv_data = open(outputFile_csv, "w") - #csv_writer = csv.writer(csv_data, delimiter=",") + csv_data = open(outputFile_csv, "wb") + csv_writer = csv.writer(csv_data, delimiter=",") # output summary with threshold workbook = xlsxwriter.Workbook(outfile) - workbook2 = xlsxwriter.Workbook(outfile2, {'in_memory': True}) - workbook3 = xlsxwriter.Workbook(outfile3, {'in_memory': True}) + workbook2 = xlsxwriter.Workbook(outfile2) + workbook3 = xlsxwriter.Workbook(outfile3) ws1 = workbook.add_worksheet("Results") ws2 = workbook2.add_worksheet("Allele frequencies") ws3 = workbook3.add_worksheet("Tiers") @@ -268,7 +268,7 @@ 'SSCS alt.ab', 'SSCS alt.ba', 'SSCS ref.ab', 'SSCS ref.ba', 'in phase', 'chimeric tag') ws1.write_row(0, 0, header_line) - #csv_writer.writerow(header_line) + csv_writer.writerow(header_line) counter_tier11 = 0 counter_tier12 = 0 counter_tier21 = 0 @@ -733,10 +733,10 @@ read_pos3 = read_len_median3 = None line = (var_id, tier, key2[:-5], 'ab1.ba2', read_pos1, read_pos4, read_len_median1, read_len_median4, dcs_median) + details1 + (sscs_mut_ab, sscs_mut_ba, sscs_ref_ab, sscs_ref_ba, add_mut14, chimera) ws1.write_row(row, 0, line) - #csv_writer.writerow(line) + csv_writer.writerow(line) line = ("", "", key2[:-5], 'ab2.ba1', read_pos2, read_pos3, read_len_median2, read_len_median3, dcs_median) + details2 + (sscs_mut_ab, sscs_mut_ba, sscs_ref_ab, sscs_ref_ba, add_mut23, chimera) ws1.write_row(row + 1, 0, line) - #csv_writer.writerow(line) + csv_writer.writerow(line) ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2), {'type': 'formula', @@ -974,6 +974,7 @@ workbook.close() workbook2.close() workbook3.close() + csv_data.close()