aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-09-12 07:38:36 +0300
committerFrederick Muriuki Muriithi2022-09-12 07:38:36 +0300
commit185fc586d0f1c1faee4418805a1788e8d57680d8 (patch)
tree5aeabb10c302332aef0f7222ec29d33bcaab732a /wqflask
parent6341aef0a78f4e9c8c6d753ec799c0bbbd53ff66 (diff)
downloadgenenetwork2-185fc586d0f1c1faee4418805a1788e8d57680d8.tar.gz
Check for species before calling `lower()`
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/correlation/correlation_gn3_api.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/wqflask/wqflask/correlation/correlation_gn3_api.py b/wqflask/wqflask/correlation/correlation_gn3_api.py
index 1a375501..74796383 100644
--- a/wqflask/wqflask/correlation/correlation_gn3_api.py
+++ b/wqflask/wqflask/correlation/correlation_gn3_api.py
@@ -146,10 +146,7 @@ def lit_for_trait_list(corr_results, this_dataset, this_trait):
geneid_dict = {trait_name: geneid for (trait_name, geneid) in geneid_dict.items() if
trait_lists.get(trait_name)}
- conn = database_connector()
-
- with conn:
-
+ with database_connector() as conn:
correlation_results = compute_all_lit_correlation(
conn=conn, trait_lists=list(geneid_dict.items()),
species=species, gene_id=this_trait_geneid)
@@ -238,7 +235,9 @@ def compute_corr_for_top_results(start_vars,
def do_lit_correlation(this_trait, this_dataset):
"""function for fetching lit inputs"""
geneid_dict = this_dataset.retrieve_genes("GeneId")
- species = this_dataset.group.species.lower()
+ species = this_dataset.group.species
+ if species:
+ species = species.lower()
trait_geneid = this_trait.geneid
return (trait_geneid, geneid_dict, species)