diff options
author | Pjotr Prins | 2020-07-19 12:49:43 +0100 |
---|---|---|
committer | Pjotr Prins | 2020-07-19 12:49:43 +0100 |
commit | d41ecc84e61048449538fbaabc1a777d95f42618 (patch) | |
tree | 187faf9cbe7a9edd8cf8d85c564d22757fda4efc /bh20simplewebuploader | |
parent | 20cbfb593e89b07d68e6c16106a24e79cea61329 (diff) | |
download | bh20-seq-resource-d41ecc84e61048449538fbaabc1a777d95f42618.tar.gz bh20-seq-resource-d41ecc84e61048449538fbaabc1a777d95f42618.tar.lz bh20-seq-resource-d41ecc84e61048449538fbaabc1a777d95f42618.zip |
EBI form filling
Diffstat (limited to 'bh20simplewebuploader')
-rw-r--r-- | bh20simplewebuploader/main.py | 7 | ||||
-rw-r--r-- | bh20simplewebuploader/static/main.js | 2 | ||||
-rw-r--r-- | bh20simplewebuploader/templates/ebi-sample.xml | 43 |
3 files changed, 18 insertions, 34 deletions
diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py index d524efe..b40db6f 100644 --- a/bh20simplewebuploader/main.py +++ b/bh20simplewebuploader/main.py @@ -937,6 +937,7 @@ def getSEQbyLocationAndSpecimenSource(): result = r.json()['results']['bindings'] return str(result) -@app.route('/api/ebi-sample.xml', methods=['GET']) -def ebi_sample(): - return render_template('ebi-sample.xml') +@app.route('/api/ebi/sample-<id>.xml', methods=['GET']) +def ebi_sample(id): + page = render_template('ebi-sample.xml',**locals()) + return page diff --git a/bh20simplewebuploader/static/main.js b/bh20simplewebuploader/static/main.js index deda6ec..a12311e 100644 --- a/bh20simplewebuploader/static/main.js +++ b/bh20simplewebuploader/static/main.js @@ -24,7 +24,7 @@ function toDIVTable(rows) { html += '<div class="rTableRow">'; html += cell('<a href="'+info+'">'+id+'</a>'); html += cell('<a href="'+seq+'">FASTA</a>'); - html += cell('<a href="/api/ebi-sample.xml?id='+id+'">EBI/ENA export XML</a>'); + html += cell('<a href="/api/ebi/sample-'+id+'.xml">EBI/ENA export XML</a>'); html += '</div>'; }); html += '</div>'; diff --git a/bh20simplewebuploader/templates/ebi-sample.xml b/bh20simplewebuploader/templates/ebi-sample.xml index 694c471..441e29e 100644 --- a/bh20simplewebuploader/templates/ebi-sample.xml +++ b/bh20simplewebuploader/templates/ebi-sample.xml @@ -1,62 +1,46 @@ <?xml version="1.0" encoding="UTF-8"?> <SAMPLE_SET> - <SAMPLE alias="PubSeqSam0001" center_name="PubSeq01"> - <TITLE>human gastric microbiota, mucosal</TITLE> + <SAMPLE alias="{{ id }}" center_name="COVID-19 PubSeq"> + <TITLE>COVID-19 PubSeq Sample</TITLE> <SAMPLE_NAME> - <TAXON_ID>1284369</TAXON_ID> - <SCIENTIFIC_NAME>stomach metagenome</SCIENTIFIC_NAME> - <COMMON_NAME></COMMON_NAME> + <TAXON_ID>2697049</TAXON_ID> + <SCIENTIFIC_NAME>Severe acute respiratory syndrome coronavirus 2</SCIENTIFIC_NAME> + <COMMON_NAME>SARS-CoV-2</COMMON_NAME> </SAMPLE_NAME> <SAMPLE_ATTRIBUTES> <SAMPLE_ATTRIBUTE> <TAG>investigation type</TAG> - <VALUE>mimarks-survey</VALUE> + <VALUE>{{ investigation_type }}</VALUE> </SAMPLE_ATTRIBUTE> <SAMPLE_ATTRIBUTE> <TAG>sequencing method</TAG> - <VALUE>pyrosequencing</VALUE> + <VALUE>{{ sequence_method }}</VALUE> </SAMPLE_ATTRIBUTE> <SAMPLE_ATTRIBUTE> <TAG>collection date</TAG> - <VALUE>2010</VALUE> - </SAMPLE_ATTRIBUTE> - <SAMPLE_ATTRIBUTE> - <TAG>host body site</TAG> - <VALUE>Mucosa of stomach</VALUE> - </SAMPLE_ATTRIBUTE> - <SAMPLE_ATTRIBUTE> - <TAG>human-associated environmental package</TAG> - <VALUE>human-associated</VALUE> + <VALUE>{{ time }}</VALUE> </SAMPLE_ATTRIBUTE> <SAMPLE_ATTRIBUTE> <TAG>geographic location (latitude)</TAG> - <VALUE>1.81</VALUE> + <VALUE>{{ latidude }}</VALUE> <UNITS>DD</UNITS> </SAMPLE_ATTRIBUTE> <SAMPLE_ATTRIBUTE> <TAG>geographic location (longitude)</TAG> - <VALUE>-78.76</VALUE> + <VALUE>{{ longitude }}</VALUE> <UNITS>DD</UNITS> </SAMPLE_ATTRIBUTE> <SAMPLE_ATTRIBUTE> <TAG>geographic location (country and/or sea)</TAG> - <VALUE>Colombia</VALUE> + <VALUE>{{ country }}</VALUE> </SAMPLE_ATTRIBUTE> <SAMPLE_ATTRIBUTE> <TAG>geographic location (region and locality)</TAG> - <VALUE>Tumaco</VALUE> - </SAMPLE_ATTRIBUTE> - <SAMPLE_ATTRIBUTE> - <TAG>environment (biome)</TAG> - <VALUE>coast</VALUE> - </SAMPLE_ATTRIBUTE> - <SAMPLE_ATTRIBUTE> - <TAG>environment (feature)</TAG> - <VALUE>human-associated habitat</VALUE> + <VALUE>{{ locality }}</VALUE> </SAMPLE_ATTRIBUTE> <SAMPLE_ATTRIBUTE> <TAG>environment (material)</TAG> - <VALUE>gastric biopsy</VALUE> + <VALUE>{{ material }}</VALUE> </SAMPLE_ATTRIBUTE> <SAMPLE_ATTRIBUTE> <TAG>ENA-CHECKLIST</TAG> @@ -65,4 +49,3 @@ </SAMPLE_ATTRIBUTES> </SAMPLE> </SAMPLE_SET> - |