parser.add_argument('--mask_start', default=100, help='number of bases to mask at start of genome') parser.add_argument('--mask_end', default=50, help='number of bases to mask at end of genome') if len(sys.argv) == 1: parser.print_help(sys.stderr) sys.exit(1) args = parser.parse_args() qc_line = {} qc_line.update( qc.get_total_variants(file=args.variants, reference=args.reference, indel=args.indel, mask_start=int(args.mask_start), mask_end=int(args.mask_end))) qc_line.update(qc.get_qc_data(file=args.qc)) qc_line.update(qc.get_coverage_stats(file=args.coverage)) qc_line.update(qc.count_iupac_in_fasta(fasta=args.fasta)) try: meta_data = qc.import_metadata(file=args.meta) qc_line['ct'] = meta_data[qc_line['sample_name']]['ct'] qc_line['date'] = meta_data[qc_line['sample_name']]['date'] except: qc_line['ct'] = 'NA' qc_line['date'] = 'NA' qc.write_qc_summary_header() qc.write_qc_summary(summary=qc_line)
import sys from ncov.parser.qc import create_qc_summary_line, write_qc_summary, \ write_qc_summary_header, import_ct_data parser = argparse.ArgumentParser(description="Tool for summarizing QC data") parser.add_argument('-c', '--qc', help='<sample>.qc.csv file to process') parser.add_argument('-v', '--variants', \ help='<sample>.variants.tsv file to process') parser.add_argument('-e', '--coverage', \ help='<sample>.per_base_coverage.bed file to process') parser.add_argument('-i', '--indel', action='store_true', \ help='flag to determine whether to count indels') parser.add_argument('-m', '--meta', \ help='full path to the metadata YAML file') if len(sys.argv) == 1: parser.print_help(sys.stderr) sys.exit(1) args = parser.parse_args() ct_data = import_ct_data(file=args.meta) qc_line = create_qc_summary_line(var_file=args.variants, qc_file=args.qc, cov_file=args.coverage, meta_file=args.meta, indel=args.indel) write_qc_summary_header() write_qc_summary(summary=qc_line)