From c50e611f7be281a3b7955254be097c01e6461c20 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Fri, 3 Jul 2020 20:55:16 +0000 Subject: Fix qc_fasta bug closing stream. --- bh20sequploader/qc_fasta.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bh20sequploader') diff --git a/bh20sequploader/qc_fasta.py b/bh20sequploader/qc_fasta.py index e198430..1587def 100644 --- a/bh20sequploader/qc_fasta.py +++ b/bh20sequploader/qc_fasta.py @@ -51,6 +51,8 @@ def qc_fasta(arg_sequence): if seq_type == "text/fasta": # ensure that contains only one entry submitlabel, submitseq = read_fasta(sequence) + sequence.seek(0) + sequence.detach() with tempfile.NamedTemporaryFile() as tmp1: refstring = pkg_resources.resource_string(__name__, "SARS-CoV-2-reference.fasta") @@ -92,6 +94,8 @@ def qc_fasta(arg_sequence): return ("sequence.fasta"+gz, seqlabel) elif seq_type == "text/fastq": + sequence.seek(0) + sequence.detach() return ("reads.fastq"+gz, seqlabel) else: raise ValueError("Sequence file does not look like a DNA FASTA or FASTQ") -- cgit v1.2.3