aboutsummaryrefslogtreecommitdiff
path: root/bh20sequploader/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'bh20sequploader/main.py')
-rw-r--r--bh20sequploader/main.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/bh20sequploader/main.py b/bh20sequploader/main.py
index 0d463f7..2cd15c2 100644
--- a/bh20sequploader/main.py
+++ b/bh20sequploader/main.py
@@ -3,6 +3,7 @@ import time
import arvados
import arvados.collection
import json
+import logging
import magic
from pathlib import Path
import urllib.request
@@ -13,6 +14,10 @@ sys.path.insert(0,'.')
from bh20sequploader.qc_metadata import qc_metadata
from bh20sequploader.qc_fasta import qc_fasta
+logging.basicConfig(level=logging.DEBUG)
+log = logging.getLogger(__name__ )
+log.debug("Entering sequence uploader")
+
ARVADOS_API_HOST='lugli.arvadosapi.com'
ARVADOS_API_TOKEN='2fbebpmbo3rw3x05ueu2i6nx70zhrsb1p22ycu3ry34m4x4462'
UPLOAD_PROJECT='lugli-j7d0g-n5clictpuvwk8aa'
@@ -26,13 +31,16 @@ def main():
api = arvados.api(host=ARVADOS_API_HOST, token=ARVADOS_API_TOKEN, insecure=True)
+ log.debug("Checking metadata")
if not qc_metadata(args.metadata.name):
- print("Failed metadata qc")
+ log.warning("Failed metadata qc")
exit(1)
try:
+ log.debug("Checking FASTA QC")
target = qc_fasta(args.sequence)
except ValueError as e:
+ log.warning("Failed FASTA qc")
print(e)
exit(1)