aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2023-02-17 19:00:49 +0000
committerzsloan2023-02-17 19:00:49 +0000
commitedeae35d520ba26c0b0fd19136271892e605d0e3 (patch)
tree79feb23239d0fb22e49e145baa09ee395ae8968f
parent00a8f9996f19a95d8f5840993d504e06cb585dfa (diff)
downloadgenenetwork2-edeae35d520ba26c0b0fd19136271892e605d0e3.tar.gz
Default trait abbreviation to N/A and only set to pre/post_publication_abbreviation if they're not None
-rw-r--r--wqflask/base/trait.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 7501306a..e1eca9d9 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -487,12 +487,15 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
# phenotype traits, then display the pre-publication description instead
# of the post-publication description
trait.description_display = "N/A"
+ trait.abbreviation = "N/A"
if not trait.pubmed_id:
- trait.abbreviation = trait.pre_publication_abbreviation
+ if trait.pre_publication_abbreviation:
+ trait.abbreviation = trait.pre_publication_abbreviation
if trait.pre_publication_description:
trait.description_display = trait.pre_publication_description
else:
- trait.abbreviation = trait.post_publication_abbreviation
+ if trait.post_publication_abbreviation:
+ trait.abbreviation = trait.post_publication_abbreviation
if description:
trait.description_display = description.strip()