Skip to content

Commit

Permalink
Merge pull request #2 from simpsonlab/add_mixture_qc_flag
Browse files Browse the repository at this point in the history
Add mixture qc flag
  • Loading branch information
rdeborja authored Dec 15, 2020
2 parents 36f3608 + 30ab738 commit 0ec04b4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions bin/collect_qc_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 15 additions & 0 deletions bin/get_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='<sample>.consensus.fasta file to process')
Expand All @@ -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',
Expand Down Expand Up @@ -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':

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@

setuptools.setup(
name="ncov_parser",
version="0.6.0",
version="0.6.1",
author="Richard J. de Borja",
author_email="[email protected]",
description="A nCoV package for parsing analysis files",
long_description=long_description,
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",
Expand Down

0 comments on commit 0ec04b4

Please sign in to comment.