comparison read2mut.py @ 14:bcdb63df70ce draft

planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
author mheinzl
date Mon, 22 Feb 2021 14:26:13 +0000
parents 02bf6425fc25
children 30aec05d04d3
comparison
equal deleted inserted replaced
13:02bf6425fc25 14:bcdb63df70ce
61 help='Integer threshold for Phred score. Only reads higher than this threshold are considered. Default 20.') 61 help='Integer threshold for Phred score. Only reads higher than this threshold are considered. Default 20.')
62 parser.add_argument('--trim', type=int, default=10, 62 parser.add_argument('--trim', type=int, default=10,
63 help='Integer threshold for assigning mutations at start and end of reads to lower tier. Default 10.') 63 help='Integer threshold for assigning mutations at start and end of reads to lower tier. Default 10.')
64 parser.add_argument('--chimera_correction', action="store_true", 64 parser.add_argument('--chimera_correction', action="store_true",
65 help='Count chimeric variants and correct the variant frequencies') 65 help='Count chimeric variants and correct the variant frequencies')
66 parser.add_argument('--delim_csv', type=str, default=",",
67 help='Deliminator in csv summary file. Default comma.')
66 68
67 69
68 return parser 70 return parser
69 71
70 72
87 outputFile_csv = args.outputFile_csv 89 outputFile_csv = args.outputFile_csv
88 thresh = args.thresh 90 thresh = args.thresh
89 phred_score = args.phred 91 phred_score = args.phred
90 trim = args.trim 92 trim = args.trim
91 chimera_correction = args.chimera_correction 93 chimera_correction = args.chimera_correction
94 delim_csv = args.delim_csv
92 95
93 if os.path.isfile(file1) is False: 96 if os.path.isfile(file1) is False:
94 sys.exit("Error: Could not find '{}'".format(file1)) 97 sys.exit("Error: Could not find '{}'".format(file1))
95 if os.path.isfile(file2) is False: 98 if os.path.isfile(file2) is False:
96 sys.exit("Error: Could not find '{}'".format(file2)) 99 sys.exit("Error: Could not find '{}'".format(file2))
233 pure_tags_dict_short[key] = value 236 pure_tags_dict_short[key] = value
234 else: 237 else:
235 pure_tags_dict_short = pure_tags_dict 238 pure_tags_dict_short = pure_tags_dict
236 239
237 csv_data = open(outputFile_csv, "w") 240 csv_data = open(outputFile_csv, "w")
238 csv_writer = csv.writer(csv_data) 241 csv_writer = csv.writer(csv_data, delimiter=delim_csv)
239 242
240 # output summary with threshold 243 # output summary with threshold
241 workbook = xlsxwriter.Workbook(outfile) 244 workbook = xlsxwriter.Workbook(outfile)
242 workbook2 = xlsxwriter.Workbook(outfile2) 245 workbook2 = xlsxwriter.Workbook(outfile2)
243 workbook3 = xlsxwriter.Workbook(outfile3) 246 workbook3 = xlsxwriter.Workbook(outfile3)