aboutsummaryrefslogtreecommitdiff
path: root/bh20simplewebuploader
diff options
context:
space:
mode:
authorPjotr Prins2020-05-16 10:18:36 -0500
committerPjotr Prins2020-05-16 10:18:36 -0500
commitfe56e0ddd8bf91b7cfb4be7562e6aa1ee4c9a285 (patch)
tree4960e738b88f0ea2b7497afd6dabe0646e764ef2 /bh20simplewebuploader
parent0e09fafd9e0cbc762a89302ccf4a3567d45297b4 (diff)
parent6dc16e60eb16cddb3ca1528561734e44507bf1cc (diff)
downloadbh20-seq-resource-fe56e0ddd8bf91b7cfb4be7562e6aa1ee4c9a285.tar.gz
bh20-seq-resource-fe56e0ddd8bf91b7cfb4be7562e6aa1ee4c9a285.tar.lz
bh20-seq-resource-fe56e0ddd8bf91b7cfb4be7562e6aa1ee4c9a285.zip
Merge branch 'master' of github.com:pjotrp/bh20-seq-resource
Diffstat (limited to 'bh20simplewebuploader')
-rw-r--r--bh20simplewebuploader/main.py19
-rw-r--r--bh20simplewebuploader/templates/form.html2
2 files changed, 6 insertions, 15 deletions
diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py
index 865af97..1dff207 100644
--- a/bh20simplewebuploader/main.py
+++ b/bh20simplewebuploader/main.py
@@ -439,12 +439,15 @@ def getAllaccessions():
@app.route('/api/getDetailsForSeq', methods=['GET'])
def getDetailsForSeq():
seq_id = request.args.get('seq')
- query="""SELECT DISTINCT ?key ?value WHERE {<placeholder> ?x [?key ?value]}"""
+ query="""SELECT DISTINCT ?key ?key_label ?value WHERE {
+ <http://arvados.org/keep:00a6af865453564f6a59b3d2c81cc7c1+123/sequence.fasta> ?x [?key ?value] .
+ OPTIONAL {?key <http://www.w3.org/2000/01/rdf-schema#label> ?key_tmp_label } .
+ BIND(IF(BOUND(?key_tmp_label),?key_tmp_label, ?key) as ?key_label)}"""
query=query.replace("placeholder", seq_id)
payload = {'query': query, 'format': 'json'}
r = requests.get(baseURL, params=payload)
result = r.json()['results']['bindings']
- return jsonify([{'uri': x['key']['value'],
+ return jsonify([{'uri': x['key']['value'], 'key_label': x['key_label']['value'],
'value': x['value']['value']} for x in result])
@@ -463,18 +466,6 @@ def getSEQCountbytech():
'tech': x['tech']['value'],
'Label': x['tech_label']['value']} for x in result])
-## Is this one really necessary or should we just use getSEQCountbytech instead?
-@app.route('/api/getAvailableTech', methods=['GET'])
-def getAvailableTech():
- query="""SELECT distinct ?tech ?tech_label WHERE
- {?fasta ?x [<http://purl.obolibrary.org/obo/OBI_0600047> ?tech]
- BIND (concat(?tech,"_label") as ?tech_label)
- } """
- payload = {'query': query, 'format': 'json'}
- r = requests.get(baseURL, params=payload)
- result = r.json()['results']['bindings']
- return str(result)
-
## List all Sequences/submissions by a given tech, as example e.g. http://purl.obolibrary.org/obo/OBI_0000759
## Has to be encoded again so should be --> http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FOBI_0000759
@app.route('/api/getSEQbytech', methods=['GET'])
diff --git a/bh20simplewebuploader/templates/form.html b/bh20simplewebuploader/templates/form.html
index 37a7b72..7d7cef8 100644
--- a/bh20simplewebuploader/templates/form.html
+++ b/bh20simplewebuploader/templates/form.html
@@ -146,7 +146,7 @@
{{ 'placeholder=http://www.wikidata.org/entity/Q30' if record['id']=='metadata.sample.collection_location'}}
{{ 'placeholder=MyUniqueSampleId.1' if record['id']=='metadata.sample.sample_id'}}
{{ 'value=http://purl.obolibrary.org/obo/NCBITaxon_2697049' if record['id']=='metadata.virus.virus_species'}}
- {{ 'readonly=1 value=http://identifiers.org/insdc/MT334571.1#sequence' if record['id']=='metadata.id'}}
+ {{ 'readonly=1 value=http://genenetwork.org/submission' if record['id']=='metadata.id'}}
name="{{ record['id'] }}{{ '[0]' if record['list'] else ''}}"
{{ "required" if record['required'] else "" }} {{ ("step=" + record['step']) if 'step' in record else ""}}>
{% endif %}