From 2eda56348a97abaf61760c732dcc2032232f00aa Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 17 Mar 2021 21:33:06 +0000 Subject: Fixed the logic for creating the RRID links to account for the fact that the rat IDs don't have any prefix with a colon --- wqflask/wqflask/show_trait/SampleList.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/wqflask/wqflask/show_trait/SampleList.py b/wqflask/wqflask/show_trait/SampleList.py index 6017f895..112298a1 100644 --- a/wqflask/wqflask/show_trait/SampleList.py +++ b/wqflask/wqflask/show_trait/SampleList.py @@ -71,12 +71,15 @@ class SampleList(object): #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": + if self.dataset.group.species == "mouse": + if len(sample.extra_attributes['rrid'].split(":")) > 1: + the_rrid = sample.extra_attributes['rrid'].split(":")[1] + sample.extra_attributes['rrid'] = [sample.extra_attributes['rrid']] sample.extra_attributes['rrid'].append(webqtlConfig.RRID_MOUSE_URL % the_rrid) - elif self.dataset.group.species == "rat": + elif self.dataset.group.species == "rat": + if len(str(sample.extra_attributes['rrid'])): + the_rrid = sample.extra_attributes['rrid'] + sample.extra_attributes['rrid'] = [sample.extra_attributes['rrid']] sample.extra_attributes['rrid'].append(webqtlConfig.RRID_RAT_URL % the_rrid) self.sample_list.append(sample) -- cgit v1.2.3