aboutsummaryrefslogtreecommitdiff
path: root/bh20seqanalyzer/main.py
diff options
context:
space:
mode:
authorPeter Amstutz2020-04-10 15:52:37 -0400
committerPeter Amstutz2020-04-10 15:52:37 -0400
commit925058d0b3db70803d322cc2a33801240899a20a (patch)
tree41e4552336d7d3bf17be8b1df6cbc280ef86eb6a /bh20seqanalyzer/main.py
parenta6ba9a5203a568611a94c043fd13e2ec50f071da (diff)
downloadbh20-seq-resource-925058d0b3db70803d322cc2a33801240899a20a.tar.gz
bh20-seq-resource-925058d0b3db70803d322cc2a33801240899a20a.tar.lz
bh20-seq-resource-925058d0b3db70803d322cc2a33801240899a20a.zip
Fix up fasta/fastq validation
Diffstat (limited to 'bh20seqanalyzer/main.py')
-rw-r--r--bh20seqanalyzer/main.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/bh20seqanalyzer/main.py b/bh20seqanalyzer/main.py
index 1fb51b5..c05b402 100644
--- a/bh20seqanalyzer/main.py
+++ b/bh20seqanalyzer/main.py
@@ -8,6 +8,7 @@ import json
import logging
import ruamel.yaml
from bh20sequploader.qc_metadata import qc_metadata
+from bh20sequploader.qc_fasta import qc_fasta
import pkg_resources
from schema_salad.sourceline import add_lc_filename
@@ -38,7 +39,13 @@ def validate_upload(api, collection, validated_project,
logging.warn("Failed metadata qc")
if valid:
- if "sequence.fasta" not in col:
+ if "sequence.fasta" in col:
+ try:
+ qc_fasta(col.open("sequence.fasta"))
+ except Exception as e:
+ logging.warn(e)
+ valid = False
+ else:
if "reads.fastq" in col:
start_fastq_to_fasta(api, collection, fastq_project, fastq_workflow_uuid)
return False