diff options
author | zsloan | 2021-03-17 21:03:17 +0000 |
---|---|---|
committer | zsloan | 2021-03-17 21:03:17 +0000 |
commit | f9bb77224092c38b8a14c9bca1044dcb843bcbae (patch) | |
tree | f01048b995bd5711f52d6fb6d9062f0d809b9791 /wqflask | |
parent | 8ca8eb18ed8aa35177008bb92d805b9d603aec66 (diff) | |
download | genenetwork2-f9bb77224092c38b8a14c9bca1044dcb843bcbae.tar.gz |
Added URL as second value for RRID case attributes, so it can be displayed in the trait page sample table
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/show_trait/SampleList.py | 13 | ||||
-rw-r--r-- | wqflask/wqflask/show_trait/show_trait.py | 1 |
2 files changed, 12 insertions, 2 deletions
diff --git a/wqflask/wqflask/show_trait/SampleList.py b/wqflask/wqflask/show_trait/SampleList.py index ece485ae..6017f895 100644 --- a/wqflask/wqflask/show_trait/SampleList.py +++ b/wqflask/wqflask/show_trait/SampleList.py @@ -2,13 +2,12 @@ import re import itertools from flask import g -from base import webqtlCaseData +from base import webqtlCaseData, webqtlConfig from pprint import pformat as pf from utility import Plot from utility import Bunch - class SampleList(object): def __init__(self, dataset, @@ -70,6 +69,16 @@ class SampleList(object): sample.extra_attributes = self.sample_attribute_values.get( sample_name, {}) + #ZS: Add a url so RRID case attributes can be displayed as links + if 'rrid' in sample.extra_attributes: + if len(sample.extra_attributes['rrid'].split(":")) > 1: + the_rrid = sample.extra_attributes['rrid'].split(":")[1] + sample.extra_attributes['rrid'] = [sample.extra_attributes['rrid']] + if self.dataset.group.species == "mouse": + sample.extra_attributes['rrid'].append(webqtlConfig.RRID_MOUSE_URL % the_rrid) + elif self.dataset.group.species == "rat": + sample.extra_attributes['rrid'].append(webqtlConfig.RRID_RAT_URL % the_rrid) + self.sample_list.append(sample) self.se_exists = any(sample.variance for sample in self.sample_list) diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index cf3accaa..878c41c0 100644 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -269,6 +269,7 @@ class ShowTrait(object): short_description = short_description, unit_type = trait_units, dataset_type = self.dataset.type, + species = self.dataset.group.species, scales_in_geno = self.scales_in_geno, data_scale = self.dataset.data_scale, sample_group_types = self.sample_group_types, |