aboutsummaryrefslogtreecommitdiff
path: root/bh20sequploader/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'bh20sequploader/main.py')
-rw-r--r--bh20sequploader/main.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/bh20sequploader/main.py b/bh20sequploader/main.py
index e0a6a9a..49d012d 100644
--- a/bh20sequploader/main.py
+++ b/bh20sequploader/main.py
@@ -21,16 +21,25 @@ def main():
parser = argparse.ArgumentParser(description='Upload SARS-CoV-19 sequences for analysis')
parser.add_argument('sequence', type=argparse.FileType('r'), help='sequence FASTA/FASTQ')
parser.add_argument('metadata', type=argparse.FileType('r'), help='sequence metadata json')
+ parser.add_argument("--validate", action="store_true", help="Dry run, validate only")
args = parser.parse_args()
api = arvados.api(host=ARVADOS_API_HOST, token=ARVADOS_API_TOKEN, insecure=True)
- target = qc_fasta(args.sequence)
+ try:
+ target = qc_fasta(args.sequence)
+ except ValueError as e:
+ print(e)
+ exit(1)
if not qc_metadata(args.metadata.name):
print("Failed metadata qc")
exit(1)
+ if args.validate:
+ print("Valid")
+ exit(0)
+
col = arvados.collection.Collection(api_client=api)
with col.open(target, "w") as f: