diff --git a/bin/collect_qc_summary.py b/bin/collect_qc_summary.py index 8c93d6b..bb45d61 100755 --- a/bin/collect_qc_summary.py +++ b/bin/collect_qc_summary.py @@ -21,6 +21,7 @@ args = parser.parse_args() summary_data = collect_qc_summary_data(path=args.path) +summary_data.sort() write_qc_summary_header() for summary_line in summary_data: diff --git a/bin/get_qc.py b/bin/get_qc.py index ad6e502..1400ddc 100644 --- a/bin/get_qc.py +++ b/bin/get_qc.py @@ -7,6 +7,7 @@ import sys import ncov.parser.qc as qc import ncov.parser +import csv parser = argparse.ArgumentParser(description="Tool for summarizing QC data") parser.add_argument('-c', '--consensus', help='.consensus.fasta file to process') @@ -22,6 +23,8 @@ help='full path to the alleles.tsv file') parser.add_argument('-s', '--sample', help='name of sample being processed') +parser.add_argument('-x', '--mixture', default=None, + help='full path to the mixture report') parser.add_argument('-p', '--platform', default='illumina', help='sequencing platform used') parser.add_argument('-r', '--run_name', @@ -80,6 +83,18 @@ if qc_line['num_consensus_iupac'] > 5: qc_flags.append("EXCESS_AMBIGUITY") +# the mixture report is currently generated for illuina runs, ont is +# not supported at this time +if args.mixture: + if args.platform == 'illumina': + mixture = set() + with open(args.mixture, 'r') as mfh: + reader = csv.DictReader(mfh, delimiter='\t') + for record in reader: + mixture.add(record['sample_a']) + if args.sample in mixture: + qc_flags.append("POSSIBLE_MIXTURE") + # Calculate number of variants per week, while accounting for incompleteness if qc_line['num_weeks'] != 'NA': diff --git a/setup.py b/setup.py index 0eb3249..58816e5 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name="ncov_parser", - version="0.6.0", + version="0.6.1", author="Richard J. de Borja", author_email="richard.deborja@oicr.on.ca", description="A nCoV package for parsing analysis files", @@ -16,6 +16,7 @@ long_description_content_type="text/markdown", url="https://github.com/rdeborja/ncov_parser", packages=setuptools.find_packages(), + license="MIT", classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License",