aboutsummaryrefslogtreecommitdiff
path: root/gn3/app.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2021-09-16 13:06:04 +0300
committerFrederick Muriuki Muriithi2021-09-16 13:06:04 +0300
commit056171a0a2f127e90ab803b74635495fb0c079a2 (patch)
treeb14c46a89f26bc695427c1eef561757fb9d9b4dc /gn3/app.py
parent2cc9f382e199dbdbaab98c7e06deabd72e244adb (diff)
downloadgenenetwork3-056171a0a2f127e90ab803b74635495fb0c079a2.tar.gz
Intergrate the heatmap generation with the API
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Intergrate the heatmap generation code on the /api/heatmaps/clustered endpoint. The endpoint should take a json query of the form: {"traits_names": [ ... ] } where the "traits_name" value is a list of the full names of traits. A sample query to the endpoint could be something like the following: curl -i -X POST "http://localhost:8080/api/heatmaps/clustered" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "traits_names": [ "UCLA_BXDBXH_CARTILAGE_V2::ILM103710672", "UCLA_BXDBXH_CARTILAGE_V2::ILM2260338", "UCLA_BXDBXH_CARTILAGE_V2::ILM3140576", "UCLA_BXDBXH_CARTILAGE_V2::ILM5670577", "UCLA_BXDBXH_CARTILAGE_V2::ILM2070121", "UCLA_BXDBXH_CARTILAGE_V2::ILM103990541", "UCLA_BXDBXH_CARTILAGE_V2::ILM1190722", "UCLA_BXDBXH_CARTILAGE_V2::ILM6590722", "UCLA_BXDBXH_CARTILAGE_V2::ILM4200064", "UCLA_BXDBXH_CARTILAGE_V2::ILM3140463" ] }' which should respond with a json response containing the raw binary string for the png format and possibly another for the svg format.
Diffstat (limited to 'gn3/app.py')
-rw-r--r--gn3/app.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/gn3/app.py b/gn3/app.py
index 046b5de..b4b08d0 100644
--- a/gn3/app.py
+++ b/gn3/app.py
@@ -7,6 +7,7 @@ from flask import Flask
from gn3.api.gemma import gemma
from gn3.api.rqtl import rqtl
from gn3.api.general import general
+from gn3.api.heatmaps import heatmaps
from gn3.api.correlation import correlation
from gn3.api.data_entry import data_entry
@@ -30,6 +31,7 @@ def create_app(config: Union[Dict, str, None] = None) -> Flask:
app.register_blueprint(general, url_prefix="/api/")
app.register_blueprint(gemma, url_prefix="/api/gemma")
app.register_blueprint(rqtl, url_prefix="/api/rqtl")
+ app.register_blueprint(heatmaps, url_prefix="/api/heatmaps")
app.register_blueprint(correlation, url_prefix="/api/correlation")
app.register_blueprint(data_entry, url_prefix="/api/dataentry")
return app