aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/trait.py
diff options
context:
space:
mode:
authorPjotr Prins2020-07-25 08:24:33 +0100
committerPjotr Prins2020-07-25 08:24:33 +0100
commit9f8beacddb71aac9905c896b9d81caf45b4735a0 (patch)
tree1f3ea2b1bdb6835a6c172b739e6872bf59af6181 /wqflask/base/trait.py
parentc249ba2ef7d691227da8864838dfc97db68d4084 (diff)
parentf66da35a09cbb8da13cfb142cbe3ff208404970b (diff)
downloadgenenetwork2-9f8beacddb71aac9905c896b9d81caf45b4735a0.tar.gz
Merge branch 'testing' of github.com:genenetwork/genenetwork2 into testing
Diffstat (limited to 'wqflask/base/trait.py')
-rw-r--r--wqflask/base/trait.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 8e11c11d..7666348e 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -152,7 +152,7 @@ class GeneralTrait(object):
'''Return a text formatted alias'''
alias = 'Not available'
- if self.alias:
+ if getattr(self, "alias", None):
alias = string.replace(self.alias, ";", " ")
alias = string.join(string.split(alias), ", ")
@@ -395,20 +395,24 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
query = """
SELECT
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, PublishXRef.mean,
+ CAST(Phenotype.Pre_publication_description AS BINARY),
+ CAST(Phenotype.Post_publication_description AS BINARY),
+ CAST(Phenotype.Original_description AS BINARY),
+ CAST(Phenotype.Pre_publication_abbreviation AS BINARY),
+ CAST(Phenotype.Post_publication_abbreviation AS BINARY), PublishXRef.mean,
Phenotype.Lab_code, Phenotype.Submitter, Phenotype.Owner, Phenotype.Authorized_Users,
- Publication.Authors, Publication.Title, Publication.Abstract,
- Publication.Journal, Publication.Volume, Publication.Pages,
+ CAST(Publication.Authors AS BINARY), CAST(Publication.Title AS BINARY), CAST(Publication.Abstract AS BINARY),
+ CAST(Publication.Journal AS BINARY), Publication.Volume, Publication.Pages,
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)
@@ -462,9 +466,6 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
trait.haveinfo = True
for i, field in enumerate(dataset.display_fields):
holder = trait_info[i]
- # if isinstance(trait_info[i], basestring):
- # holder = unicode(holder.strip(codecs.BOM_UTF8), 'utf-8', "ignore")
-
setattr(trait, field, holder)
if dataset.type == 'Publish':