aboutsummaryrefslogtreecommitdiff
path: root/gn3/api/traits.py
diff options
context:
space:
mode:
authorAlexander Kabui2021-05-02 23:54:56 +0300
committerAlexander Kabui2021-05-02 23:54:56 +0300
commit9f24b15064bcebcda9cf2164ab7b7e89644e3103 (patch)
tree7c36e4fd5b08720cfd0805352d56ca7cb1fc757b /gn3/api/traits.py
parentf0ccff2a90d760fc0b268e715e0c6c673ff64e15 (diff)
downloadgenenetwork3-9f24b15064bcebcda9cf2164ab7b7e89644e3103.tar.gz
delete dataset and trait files
Diffstat (limited to 'gn3/api/traits.py')
-rw-r--r--gn3/api/traits.py53
1 files changed, 0 insertions, 53 deletions
diff --git a/gn3/api/traits.py b/gn3/api/traits.py
deleted file mode 100644
index 002a281..0000000
--- a/gn3/api/traits.py
+++ /dev/null
@@ -1,53 +0,0 @@
-"""this module contains the all endpoints for traits"""
-from unittest import mock
-
-from flask import Blueprint
-from flask import jsonify
-from flask import request
-
-from gn3.computations.traits import fetch_trait
-from gn3.computations.traits import get_trait_info_data
-from gn3.db_utils import database_connector
-
-trait = Blueprint("trait", __name__)
-
-
-@trait.route("/<string:trait_name>/<string:dataset_name>")
-def create_trait(trait_name, dataset_name):
- """Endpoint for creating trait and fetching strain\
- values"""
-
- # xtodo replace the object at most this endpoint
- # requires dataset_type,dataset_name ,dataset_id
- trait_dataset = {
- "name": dataset_name,
- "id": 12,
- "type": "ProbeSet" # temp values
- }
- conn, _cursor = database_connector()
-
- trait_results = fetch_trait(dataset=trait_dataset,
- trait_name=trait_name,
- database=conn)
-
- conn.close()
-
- return jsonify(trait_results)
-
-
-@trait.route("/trait_info/<string:trait_name>", methods=["POST"])
-def fetch_trait_info(trait_name):
- """Api endpoint for fetching the trait info \
- expects the trait and trait dataset to have\
- been created """
- data = request.get_json()
-
- trait_dataset = data["trait_dataset"]
- trait_data = data["trait"]
- _trait_name = trait_name # should be used as key to return results
-
- database_instance = mock.Mock()
-
- results = get_trait_info_data(trait_dataset, trait_data, database_instance)
-
- return jsonify(results)