From 04912c58cdab27962429be56971afde189d702c4 Mon Sep 17 00:00:00 2001 From: Adam Novak Date: Fri, 10 Apr 2020 16:43:05 -0700 Subject: Clarify supported formats and make web UI take FASTQ --- README.md | 4 ++-- bh20simplewebuploader/main.py | 6 ++++-- bh20simplewebuploader/templates/form.html | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2a1657d..db4fe52 100644 --- a/README.md +++ b/README.md @@ -126,10 +126,10 @@ For running/developing the uploader with GNU Guix see [INSTALL.md](./doc/INSTALL # Usage -Run the uploader with a FASTA file and accompanying metadata file in [JSON-LD format](https://json-ld.org/): +Run the uploader with a FASTA or FASTQ file and accompanying metadata file in JSON or YAML: ```sh -bh20-seq-uploader example/sequence.fasta example/metadata.json +bh20-seq-uploader example/sequence.fasta example/metadata.yaml ``` ## Workflow for Generating a Pangenome diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py index bfc7762..383ef84 100644 --- a/bh20simplewebuploader/main.py +++ b/bh20simplewebuploader/main.py @@ -184,15 +184,17 @@ def receive_files(): # We're going to work in one directory per request dest_dir = tempfile.mkdtemp() + # The uploader will happily accept a FASTQ with this name fasta_dest = os.path.join(dest_dir, 'fasta.fa') metadata_dest = os.path.join(dest_dir, 'metadata.json') try: if 'fasta' not in request.files: return (render_template('error.html', - error_message="You did not include a FASTA file."), 403) + error_message="You did not include a FASTA or FASTQ file."), 403) try: with open(fasta_dest, 'wb') as out_stream: - copy_with_limit(request.files.get('fasta').stream, out_stream) + # Use a plausible file size limit for a little FASTQ + copy_with_limit(request.files.get('fasta').stream, out_stream, limit=50*1024*1024) except FileTooBigError as e: # Delegate to the 413 error handler return handle_large_file(e) diff --git a/bh20simplewebuploader/templates/form.html b/bh20simplewebuploader/templates/form.html index 2934a7c..e722ab3 100644 --- a/bh20simplewebuploader/templates/form.html +++ b/bh20simplewebuploader/templates/form.html @@ -13,9 +13,9 @@


- +
- +
-- cgit v1.2.3