From 04df498f5cd85015afce79e1e87a3979e596dcc6 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Fri, 3 Jul 2020 17:08:25 -0400 Subject: Adding --skip-qc Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- bh20sequploader/qc_fasta.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bh20sequploader/qc_fasta.py') diff --git a/bh20sequploader/qc_fasta.py b/bh20sequploader/qc_fasta.py index 1587def..944b52c 100644 --- a/bh20sequploader/qc_fasta.py +++ b/bh20sequploader/qc_fasta.py @@ -25,7 +25,7 @@ def read_fasta(sequence): raise ValueError("FASTA file contains multiple entries") return label, bases -def qc_fasta(arg_sequence): +def qc_fasta(arg_sequence, check_with_clustalw=True): log.debug("Starting qc_fasta") schema_resource = pkg_resources.resource_stream(__name__, "validation/formats") with tempfile.NamedTemporaryFile() as tmp: @@ -64,6 +64,9 @@ def qc_fasta(arg_sequence): refbp = 0 similarity = 0 try: + if not check_with_clustalw: + raise Exception("skipping QC") + cmd = ["clustalw", "-infile="+tmp1.name, "-quicktree", "-iteration=none", "-type=DNA"] print("QC checking similarity to reference") @@ -81,7 +84,7 @@ def qc_fasta(arg_sequence): print(g2.group(0)) print(g3.group(0)) except Exception as e: - logging.warn("Error trying to QC against reference sequence using 'clustalw': %s", e) + logging.warn("QC against reference sequence using 'clustalw': %s", e) if refbp and (subbp/refbp) < .7: raise ValueError("QC fail: submit sequence length is shorter than 70% reference") -- cgit v1.2.3