From 31c8f14df9f354ea3cef82c28ce3d9006d424b65 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 22 May 2024 19:58:50 +0000 Subject: Check if case attribute for RRID is a list, to prevent it being added twice in situations where a sample appears in both the parent/f1 file and the .geno file --- gn2/wqflask/show_trait/SampleList.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gn2') diff --git a/gn2/wqflask/show_trait/SampleList.py b/gn2/wqflask/show_trait/SampleList.py index 64fc8fe6..64909d6e 100644 --- a/gn2/wqflask/show_trait/SampleList.py +++ b/gn2/wqflask/show_trait/SampleList.py @@ -81,7 +81,8 @@ class SampleList: sample.extra_attributes['36'].append( webqtlConfig.RRID_MOUSE_URL % the_rrid) elif self.dataset.group.species == "rat": - if len(rrid_string): + # Check if it's a list just in case a parent/f1 strain also shows up in the .geno file, to avoid being added twice + if len(rrid_string) and not isinstance(sample.extra_attributes['36'], list): the_rrid = rrid_string.split("_")[1] sample.extra_attributes['36'] = [ rrid_string] -- cgit 1.4.1