aboutsummaryrefslogtreecommitdiff
path: root/gn3/db/correlations.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2021-10-29 06:59:57 +0300
committerBonfaceKilz2021-11-04 12:45:57 +0300
commit5a9db2162a0a694a76a256996bb296ff06c75126 (patch)
tree616f4adcde786d59f2b1b03ca3fea92a91dfe406 /gn3/db/correlations.py
parenta85db849660a63b09e5c40f7753d861f47eaaaeb (diff)
downloadgenenetwork3-5a9db2162a0a694a76a256996bb296ff06c75126.tar.gz
Move `correlations_of_all_tissue_traits`
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: new function (`correlations_of_all_tissue_traits`). * gn3/db/correlations.py: delete function (`correlations_of_all_tissue_traits`). Move the function to `gn3.computations.partial_correlations` module and comment out the db-access code. Rework it to receive, as arguments, the data it previously fetched from the database, and add comments on future rework to get the function working again.
Diffstat (limited to 'gn3/db/correlations.py')
-rw-r--r--gn3/db/correlations.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/gn3/db/correlations.py b/gn3/db/correlations.py
index f43b8a5..39ed499 100644
--- a/gn3/db/correlations.py
+++ b/gn3/db/correlations.py
@@ -281,26 +281,6 @@ def fetch_gene_symbol_tissue_value_dict_for_trait(
return fetch_gene_symbol_tissue_value_dict(xref_info[0], xref_info[2], conn)
return {}
-def correlations_of_all_tissue_traits(
- trait_symbol: str, probeset_freeze_id: int,
- method: str, conn: Any) -> Tuple[dict, dict]:
- """
- Computes and returns the correlation of all tissue traits.
-
- This is a migration of the
- `web.webqtl.correlation.correlationFunction.calculateCorrOfAllTissueTrait`
- function in GeneNetwork1.
- """
- primary_trait_symbol_value_dict = fetch_gene_symbol_tissue_value_dict_for_trait(
- (trait_symbol,), probeset_freeze_id, conn)
- primary_trait_value = primary_trait_symbol_value_dict.vlaues()[0]
- symbol_value_dict = fetch_gene_symbol_tissue_value_dict_for_trait(
- tuple(), probeset_freeze_id, conn)
- if method == "1":
- return batch_computed_tissue_correlation(
- primaryTraitValue,SymbolValueDict,method='spearman')
- return batch_computed_tissue_correlation(primaryTraitValue,SymbolValueDict)
-
def build_temporary_tissue_correlations_table(
trait_symbol: str, probeset_freeze_id: int, method: str,
return_number: int, conn: Any) -> str: