From 8427ddfd7b60d74f4be3a453dd0b21ce7bfdb6f3 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 21 Nov 2019 14:55:50 -0600 Subject: Added 3-letter codes to unpublished phenotype traits and fixed issue with ordering phenotype results from searches --- wqflask/base/trait.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'wqflask/base/trait.py') diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index 322fb252..5fae34cf 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -352,7 +352,7 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False): if dataset.type == 'Publish': query = """ SELECT - PublishXRef.Id, Publication.PubMed_ID, + PublishXRef.Id, InbredSet.InbredSetCode, Publication.PubMed_ID, Phenotype.Pre_publication_description, Phenotype.Post_publication_description, Phenotype.Original_description, Phenotype.Pre_publication_abbreviation, Phenotype.Post_publication_abbreviation, Phenotype.Lab_code, Phenotype.Submitter, Phenotype.Owner, Phenotype.Authorized_Users, @@ -361,12 +361,13 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False): Publication.Month, Publication.Year, PublishXRef.Sequence, Phenotype.Units, PublishXRef.comments FROM - PublishXRef, Publication, Phenotype, PublishFreeze + PublishXRef, Publication, Phenotype, PublishFreeze, InbredSet WHERE PublishXRef.Id = %s AND Phenotype.Id = PublishXRef.PhenotypeId AND Publication.Id = PublishXRef.PublicationId AND PublishXRef.InbredSetId = PublishFreeze.InbredSetId AND + PublishXRef.InbredSetId = InbredSet.Id AND PublishFreeze.Id = %s """ % (trait.name, dataset.id) @@ -428,6 +429,7 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False): # holder = unicode(trait_info[i], "utf-8", "ignore") setattr(trait, field, holder) + trait.display_name = trait.name if dataset.type == 'Publish': trait.confidential = 0 if trait.pre_publication_description and not trait.pubmed_id: @@ -462,6 +464,9 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False): if trait.pubmed_id: trait.pubmed_link = webqtlConfig.PUBMEDLINK_URL % trait.pubmed_id + else: + if trait.group_code: + trait.display_name = trait.group_code + "_" + str(trait.name) if dataset.type == 'ProbeSet' and dataset.group: description_string = unicode(str(trait.description).strip(codecs.BOM_UTF8), 'utf-8') -- cgit v1.2.3