aboutsummaryrefslogtreecommitdiff
path: root/bh20simplewebuploader
diff options
context:
space:
mode:
Diffstat (limited to 'bh20simplewebuploader')
-rw-r--r--bh20simplewebuploader/main.py6
-rw-r--r--bh20simplewebuploader/templates/form.html6
2 files changed, 7 insertions, 5 deletions
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 8ce6f6f..afae4c7 100644
--- a/bh20simplewebuploader/templates/form.html
+++ b/bh20simplewebuploader/templates/form.html
@@ -123,9 +123,9 @@
This tool can be used to upload sequenced genomes of SARS-CoV-2 samples to the <a href="https://workbench.lugli.arvadosapi.com/collections/lugli-4zz18-z513nlpqm03hpca">Public SARS-CoV-2 Sequence Resource</a>. Your uploaded sequence will automatically be processed and incorporated into the public pangenome.
</p>
<div class="fasta-file-select">
- <label for="fasta">Select FASTA file for assembled genome (max 1MB):</label>
+ <label for="fasta">Select FASTA file of assembled genome, or FASTQ of reads (max 50MB):</label>
<br>
- <input type="file" id="fasta" name="fasta" accept=".fa,.fasta,.fna" required>
+ <input type="file" id="fasta" name="fasta" accept=".fa,.fasta,.fna,.fq" required>
<br>
</div>
@@ -181,7 +181,7 @@
</form>
</section>
<hr>
- <small><a href="https://github.com/adamnovak/bh20-simple-web-uploader">Source</a> &middot; Made for <a href="https://github.com/virtual-biohackathons/covid-19-bh20">COVID-19-BH20</a></small>
+ <small><a href="https://github.com/arvados/bh20-seq-resource">Source</a> &middot; Made for <a href="https://github.com/virtual-biohackathons/covid-19-bh20">COVID-19-BH20</a></small>
<script type="text/javascript">
let uploadForm = document.getElementById('metadata_upload_form')