From 22490fc014575840c99f46e4ecae884f59c16d9d Mon Sep 17 00:00:00 2001 From: "Richard J. de Borja" Date: Sat, 21 Nov 2020 07:26:33 -0500 Subject: [PATCH 1/4] sort final qc list before outputting --- bin/collect_qc_summary.py | 1 + 1 file changed, 1 insertion(+) 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: From 3ac3aec785f3bc706a1a8159cf228c75cbbd96ab Mon Sep 17 00:00:00 2001 From: "Richard J. de Borja" Date: Sat, 21 Nov 2020 07:27:02 -0500 Subject: [PATCH 2/4] updated license to MIT in setup script, updated minor version number --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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", From a0af77a679c9f25e7113b6d974cac3ff53b894e1 Mon Sep 17 00:00:00 2001 From: Richard de Borja Date: Fri, 4 Dec 2020 16:39:57 -0500 Subject: [PATCH 3/4] added support for mixture report --- bin/get_qc.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/get_qc.py b/bin/get_qc.py index ad6e502..6658346 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,17 @@ 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.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': From 30ab73863b0660853e69dee2d1eb2f7197b4fd27 Mon Sep 17 00:00:00 2001 From: Richard de Borja Date: Tue, 15 Dec 2020 08:25:44 -0500 Subject: [PATCH 4/4] checks if args.mixture is passed, if not then skip the mixture check --- bin/get_qc.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/get_qc.py b/bin/get_qc.py index 6658346..1400ddc 100644 --- a/bin/get_qc.py +++ b/bin/get_qc.py @@ -85,14 +85,15 @@ # the mixture report is currently generated for illuina runs, ont is # not supported at this time -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") +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':