aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Amstutz2020-07-03 20:55:16 +0000
committerPeter Amstutz2020-07-03 20:55:16 +0000
commitc50e611f7be281a3b7955254be097c01e6461c20 (patch)
tree6f3165c6dd214c324c358673460a6a535bb71817
parent535b8017ddd27a9db683f6d29368258b5c48cf5a (diff)
downloadbh20-seq-resource-c50e611f7be281a3b7955254be097c01e6461c20.tar.gz
bh20-seq-resource-c50e611f7be281a3b7955254be097c01e6461c20.tar.lz
bh20-seq-resource-c50e611f7be281a3b7955254be097c01e6461c20.zip
Fix qc_fasta bug closing stream.
-rw-r--r--bh20sequploader/qc_fasta.py4
1 files changed, 4 insertions, 0 deletions
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")