aboutsummaryrefslogtreecommitdiff
path: root/bh20simplewebuploader
diff options
context:
space:
mode:
authorPeter Amstutz2020-11-09 17:30:16 -0500
committerPeter Amstutz2020-11-09 17:30:16 -0500
commit98a80bd64d8a495b8fddffdef6e07e5a3fbea1e3 (patch)
tree57c7df946e1aa1f2054eb49379439ebee4d4c0e6 /bh20simplewebuploader
parent1082b907d816f5da52aba6233073737632d0242f (diff)
downloadbh20-seq-resource-98a80bd64d8a495b8fddffdef6e07e5a3fbea1e3.tar.gz
bh20-seq-resource-98a80bd64d8a495b8fddffdef6e07e5a3fbea1e3.tar.lz
bh20-seq-resource-98a80bd64d8a495b8fddffdef6e07e5a3fbea1e3.zip
Extract PDH from result and construct URIs from thatfasta-subset-from-query
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
Diffstat (limited to 'bh20simplewebuploader')
-rw-r--r--bh20simplewebuploader/main.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py
index 405544c..51048a4 100644
--- a/bh20simplewebuploader/main.py
+++ b/bh20simplewebuploader/main.py
@@ -713,8 +713,9 @@ union
logging.info("^^^^^^^^^^^^^^^^^^^^^^^^^^^^")
# return jsonify({'sequences': int(result[0]["num"]["value"])})
sequenceuri=sample['sequenceuri']['value']
- collectionuri=sequenceuri.split('sequence.fasta')[0]
- metauri=collectionuri+'metadata.yaml'
+ m = re.match(r"http://collections.lugli.arvadosapi.com/c=([^/]*)/sequence.fasta|http://covid19.genenetwork.org/resource/(.*)", sequenceuri)
+ fastauri = "http://collections.lugli.arvadosapi.com/c=%s/sequence.fasta" % m.group(1)
+ metauri = "http://collections.lugli.arvadosapi.com/c=%s/metadata.yaml" % m.group(1)
locationuri=sample['geo']['value']
location=sample['geoname']['value']
date=sample['date']['value']
@@ -729,7 +730,18 @@ union
institute=''
if 'institute' in sample:
institute=sample['institute']['value']
- return render_template('permalink.html',id=id,menu='',uri=f"http://covid19.genenetwork.org/resource/{id}",sequenceuri=sequenceuri,locationuri=locationuri,location=location,date=date,source=source,sampletype=sampletype,institute=institute,collectionuri=collectionuri,metauri=metauri)
+ return render_template('permalink.html',
+ id=id,
+ menu='',
+ uri=f"http://covid19.genenetwork.org/resource/{id}",
+ sequenceuri=fastauri,
+ locationuri=locationuri,
+ location=location,
+ date=date,
+ source=source,
+ sampletype=sampletype,
+ institute=institute,
+ metauri=metauri)
# http://covid19.genenetwork.org/location?label=http://www.wikidata.org/entity/Q114
# http://localhost:5067/location?label=http://www.wikidata.org/entity/Q114