aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2015-05-12 16:01:59 +0000
committerzsloan2015-05-12 16:01:59 +0000
commit12b4663b495fed487d52c76656b64ca08273e9a9 (patch)
tree3fc351427b62ad114f30fd22c78ca7e988ce8a28
parent34382319b10b1a6c36cc5f7f33c8aeec23307b86 (diff)
parent2eeaf2f6df9deb3f89db0b5821d784b93eb4bc36 (diff)
downloadgenenetwork2-12b4663b495fed487d52c76656b64ca08273e9a9.tar.gz
Merge branch 'master' of github.com:genenetwork/genenetwork2
-rwxr-xr-xwqflask/base/trait.py28
-rwxr-xr-xwqflask/wqflask/templates/show_trait.html10
-rwxr-xr-xwqflask/wqflask/templates/show_trait_details.html6
3 files changed, 34 insertions, 10 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index f3648b80..8930c917 100755
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -53,7 +53,8 @@ class GeneralTrait(object):
self.pvalue = None
self.mean = None
self.num_overlap = None
-
+ self.strand_probe = None
+ self.symbol = None
if kw.get('fullname'):
name2 = value.split("::")
@@ -533,12 +534,27 @@ class GeneralTrait(object):
return setDescription
@property
+ def name_header_fmt(self):
+ '''Return a human-readable name for use in page header'''
+ if self.dataset.type == 'ProbeSet':
+ return self.symbol
+ elif self.dataset.type == 'Geno':
+ return self.name
+ elif self.dataset.type == 'Publish':
+ return self.post_publication_abbreviation
+ else:
+ return "unnamed"
+
+ @property
def description_fmt(self):
'''Return a text formated description'''
- if self.description:
- formatted = self.description
- if self.probe_target_description:
- formatted += "; " + self.probe_target_description
+ if self.dataset.type == 'ProbeSet':
+ if self.description:
+ formatted = self.description
+ if self.probe_target_description:
+ formatted += "; " + self.probe_target_description
+ elif self.dataset.type == 'Publish':
+ formatted = self.post_publication_description
else:
formatted = "Not available"
return formatted.capitalize()
@@ -652,4 +668,4 @@ def get_sample_data():
# jsonable_sample_data[sample] = trait_ob.data[sample].value
#
#return jsonable_sample_data
- \ No newline at end of file
+
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
index a1723ef8..d6f22f41 100755
--- a/wqflask/wqflask/templates/show_trait.html
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -13,8 +13,12 @@
{% endblock %}
{% block content %} <!-- Start of body -->
- {{ header("{}".format(this_trait.symbol),
- '{}: {}'.format(this_trait.name, this_trait.description_fmt)) }}
+ {% if this_trait.dataset.type != 'Geno' %}
+ {{ header("{}".format(this_trait.name_header_fmt),
+ '{}: {}'.format(this_trait.name, this_trait.description_fmt)) }}
+ {% else %}
+ {{ header("{}".format(this_trait.name_header_fmt)) }}
+ {% endif %}
<form method="post" action="/corr_compute" name="trait_page" id="trait_data_form"
@@ -31,7 +35,7 @@
<div class="page-header">
<h1>{{ dataset.group.species.capitalize() }} -
{{ dataset.group.name }} -
- {{ this_trait.symbol }}
+ {{ this_trait.name_header_fmt }}
</h1>
</div>
diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html
index 0afac1f7..e1780e42 100755
--- a/wqflask/wqflask/templates/show_trait_details.html
+++ b/wqflask/wqflask/templates/show_trait_details.html
@@ -1,9 +1,13 @@
<dl class="dl-horizontal">
+ {% if this_trait.dataset.type == 'ProbeSet' %}
<dt>Aliases</dt>
<dd>{{ this_trait.alias_fmt }}</dd>
+ {% endif %}
+ {% if this_trait.dataset.type != 'Publish' %}
<dt>Location</dt>
<dd>{{ this_trait.location_fmt }}</dd>
+ {% endif %}
<dt>Database</dt>
<dd>
@@ -16,7 +20,7 @@
<dt>
<a href="/blatInfo.html" target="_blank"
title="Values higher than 2 for the specificity are good">
- BLAT Specifity
+ BLAT Specificity
</a>
</dt>
<dd>{{ "%0.3f" | format(this_trait.probe_set_specificity|float) }}</dd>