aboutsummaryrefslogtreecommitdiff
path: root/gn3/api/correlation.py
diff options
context:
space:
mode:
authorBonfaceKilz2021-05-05 12:50:19 +0300
committerGitHub2021-05-05 12:50:19 +0300
commit402c21508f47a486dab6b2a9daa9e006f26beb61 (patch)
tree11457fecd5b454962f1db4320f244554b13ce6e1 /gn3/api/correlation.py
parent31ac939f58bf7b6d353ced995ca395376203b25f (diff)
parent82a75b3efd23a8dba1c8eea15c4fc450219a1f86 (diff)
downloadgenenetwork3-402c21508f47a486dab6b2a9daa9e006f26beb61.tar.gz
Merge pull request #9 from genenetwork/Feature/speed-up-correlation
Feature/speed up correlation
Diffstat (limited to 'gn3/api/correlation.py')
-rw-r--r--gn3/api/correlation.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/gn3/api/correlation.py b/gn3/api/correlation.py
index 2339088..e7e89cf 100644
--- a/gn3/api/correlation.py
+++ b/gn3/api/correlation.py
@@ -23,7 +23,6 @@ def compute_sample_integration(corr_method="pearson"):
this_trait_data = correlation_input.get("trait_data")
results = map_shared_keys_to_values(target_samplelist, target_data_values)
-
correlation_results = compute_all_sample_correlation(corr_method=corr_method,
this_trait=this_trait_data,
target_dataset=results)
@@ -33,9 +32,10 @@ def compute_sample_integration(corr_method="pearson"):
@correlation.route("/sample_r/<string:corr_method>", methods=["POST"])
def compute_sample_r(corr_method="pearson"):
- """correlation endpoint for computing sample r correlations\
+ """Correlation endpoint for computing sample r correlations\
api expects the trait data with has the trait and also the\
- target_dataset data"""
+ target_dataset data
+ """
correlation_input = request.get_json()
# xtodo move code below to compute_all_sampl correlation
@@ -53,9 +53,10 @@ def compute_sample_r(corr_method="pearson"):
@correlation.route("/lit_corr/<string:species>/<int:gene_id>", methods=["POST"])
def compute_lit_corr(species=None, gene_id=None):
- """api endpoint for doing lit correlation.results for lit correlation\
+ """Api endpoint for doing lit correlation.results for lit correlation\
are fetched from the database this is the only case where the db\
- might be needed for actual computing of the correlation results"""
+ might be needed for actual computing of the correlation results
+ """
conn, _cursor_object = database_connector()
target_traits_gene_ids = request.get_json()
@@ -72,7 +73,7 @@ def compute_lit_corr(species=None, gene_id=None):
@correlation.route("/tissue_corr/<string:corr_method>", methods=["POST"])
def compute_tissue_corr(corr_method="pearson"):
- """api endpoint fr doing tissue correlation"""
+ """Api endpoint fr doing tissue correlation"""
tissue_input_data = request.get_json()
primary_tissue_dict = tissue_input_data["primary_tissue"]
target_tissues_dict = tissue_input_data["target_tissues_dict"]