diff options
author | Alexander Kabui | 2021-04-15 02:15:39 +0300 |
---|---|---|
committer | Alexander Kabui | 2021-04-15 02:15:39 +0300 |
commit | ff80b5228e741c24d66d1d1c13702a34aac77a78 (patch) | |
tree | ba6b0b8590f949d134c5d21abcc28c287fff5e6f /gn3/api/datasets.py | |
parent | 941ac598f7c15161c4e8da2f1f279bb6b6f73d80 (diff) | |
download | genenetwork3-ff80b5228e741c24d66d1d1c13702a34aac77a78.tar.gz |
test endpoint for fetching probeset data types
Diffstat (limited to 'gn3/api/datasets.py')
-rw-r--r-- | gn3/api/datasets.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gn3/api/datasets.py b/gn3/api/datasets.py index 3d6518e..2d13120 100644 --- a/gn3/api/datasets.py +++ b/gn3/api/datasets.py @@ -4,6 +4,8 @@ from flask import jsonify from gn3.computations.datasets import create_dataset from gn3.computations.datasets import get_traits_data +from gn3.computations.datasets import get_probeset_trait_data + from gn3.db_utils import database_connector @@ -42,3 +44,21 @@ def fetch_traits_data(dataset_name, dataset_type): conn.close() return jsonify({"results": results}) + + +@dataset.route("/fetch_probeset_data/<dataset_name>") +def fetch_probeset_data(dataset_name): + """Endpoint for fetching probeset trait data""" + trait_sample_ids = [4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, + 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 29, 30, 31, + 35, 36, 37, 39, 98, 99, 100, 103, 487, 105, 106, 110, 115, + 116, 117, 118, 119, 120, 919, 147, + 121, 40, 41, 124, 125, 128, 135, 129, 130, 131, + 132, 134, 138, 139, 140, 141, 142, 144, + 145, 148, 149, 920, 922, 2, 3, 1, 1100] + + conn, _cursor = database_connector() + + results = get_probeset_trait_data(trait_sample_ids, conn, dataset_name) + + return jsonify({"results": results}) |