aboutsummaryrefslogtreecommitdiff
path: root/bh20sequploader/qc_fasta.py
diff options
context:
space:
mode:
authorPeter Amstutz2020-07-03 17:08:25 -0400
committerPeter Amstutz2020-07-03 17:08:25 -0400
commit04df498f5cd85015afce79e1e87a3979e596dcc6 (patch)
tree98f7e65d10b41dc438189f704aedde13133a77a7 /bh20sequploader/qc_fasta.py
parentc50e611f7be281a3b7955254be097c01e6461c20 (diff)
downloadbh20-seq-resource-04df498f5cd85015afce79e1e87a3979e596dcc6.tar.gz
bh20-seq-resource-04df498f5cd85015afce79e1e87a3979e596dcc6.tar.lz
bh20-seq-resource-04df498f5cd85015afce79e1e87a3979e596dcc6.zip
Adding --skip-qc
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
Diffstat (limited to 'bh20sequploader/qc_fasta.py')
-rw-r--r--bh20sequploader/qc_fasta.py7
1 files changed, 5 insertions, 2 deletions
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")