aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2020-05-20 14:17:17 -0500
committerzsloan2020-05-20 14:17:17 -0500
commitdc002daace320135b4d32ac08de2ee568e68ba51 (patch)
treec0528cbbb7668f101530e26728375e55debf5b37 /wqflask
parent80709f6573a85f2d1195f938006f46044651320b (diff)
downloadgenenetwork2-dc002daace320135b4d32ac08de2ee568e68ba51.tar.gz
Fixed issue when some case attribute values don't exist + added phenogen link to trait page
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/show_trait/show_trait.py9
-rw-r--r--wqflask/wqflask/templates/show_trait_details.html6
2 files changed, 12 insertions, 3 deletions
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index 072d7f8c..29b2f77e 100644
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -294,7 +294,7 @@ class ShowTrait(object):
if check_if_attr_exists(self.this_trait, 'uniprotid'):
self.uniprot_link = webqtlConfig.UNIPROT_URL % self.this_trait.uniprotid
- self.genotation_link = self.rgd_link = self.gtex_link = self.genebridge_link = self.ucsc_blat_link = self.biogps_link = self.protein_atlas_link = None
+ self.genotation_link = self.rgd_link = self.phenogen_link = self.gtex_link = self.genebridge_link = self.ucsc_blat_link = self.biogps_link = self.protein_atlas_link = None
self.string_link = self.panther_link = self.aba_link = self.ebi_gwas_link = self.wiki_pi_link = self.genemania_link = self.ensembl_link = None
if self.this_trait.symbol:
self.genotation_link = webqtlConfig.GENOTATION_URL % self.this_trait.symbol
@@ -332,6 +332,7 @@ class ShowTrait(object):
if self.dataset.group.species == "rat":
self.rgd_link = webqtlConfig.RGD_URL % (self.this_trait.symbol, self.dataset.group.species.capitalize())
+ self.phenogen_link = webqtlConfig.PHENOGEN_URL % (self.this_trait.symbol)
self.genemania_link = webqtlConfig.GENEMANIA_URL % ("rattus-norvegicus", self.this_trait.symbol)
query = """SELECT kgID, chromosome, txStart, txEnd
@@ -603,8 +604,10 @@ def get_categorical_variables(this_trait, sample_list):
for attribute in sample_list.attributes:
attribute_vals = []
for sample_name in this_trait.data.keys():
- attribute_vals.append(this_trait.data[sample_name].extra_attributes[sample_list.attributes[attribute].name])
-
+ if sample_list.attributes[attribute].name in this_trait.data[sample_name].extra_attributes:
+ attribute_vals.append(this_trait.data[sample_name].extra_attributes[sample_list.attributes[attribute].name])
+ else:
+ attribute_vals.append("N/A")
num_distinct = len(set(attribute_vals))
if num_distinct < 10:
diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html
index 62268a54..878b6ced 100644
--- a/wqflask/wqflask/templates/show_trait_details.html
+++ b/wqflask/wqflask/templates/show_trait_details.html
@@ -141,6 +141,12 @@
GTEx Portal
</a>
&nbsp;&nbsp;
+ {% if phenogen_link %}
+ <a href="{{ phenogen_link }}" target="_blank">
+ PhenoGen
+ </a>
+ &nbsp;&nbsp;
+ {% endif %}
{% if genebridge_link %}
<a href="{{ genebridge_link }}" target="_blank">
GeneBridge