From e26444f8af23fbfad30c31cf9fcb3770e3da508a Mon Sep 17 00:00:00 2001 From: aineniamh Date: Thu, 23 Jul 2020 10:49:05 +0100 Subject: [PATCH] exit w code 0 if no seqs pass qc --- pangolin/command.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pangolin/command.py b/pangolin/command.py index 753477d..c13574f 100644 --- a/pangolin/command.py +++ b/pangolin/command.py @@ -128,6 +128,7 @@ def main(sysargs = sys.argv[1:]): print(f"{record.id}\thas an N content of {prop_N}") else: run.append(record) + if not args.legacy: if run == []: with open(outfile, "w") as fw: @@ -139,8 +140,9 @@ def main(sysargs = sys.argv[1:]): if item.startswith("fail="): reason = item.split("=")[1] fw.write(f"{record.id},None,0,{pangoLEARN.__version__},fail,{reason}\n") - sys.stderr.write(f'Note: no query sequences have passed the qc\n') - sys.exit(-1) + print(f'Note: no query sequences have passed the qc\n') + sys.exit(0) + post_qc_query = os.path.join(tempdir, 'query.post_qc.fasta') with open(post_qc_query,"w") as fw: SeqIO.write(run, fw, "fasta")