aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/trait.py
diff options
context:
space:
mode:
authorPjotr Prins2016-10-31 19:55:56 +0000
committerPjotr Prins2016-10-31 19:55:56 +0000
commit55bbc368c6a02ebfb8f754dfbe7ee5f60edea66b (patch)
tree29e5cbb7b6b30f1dde153c57821ddc54e92dc76c /wqflask/base/trait.py
parent0748bb92fe326330114d2051d959fb4d09977e53 (diff)
parent684f461b815e3920419874fccb036c359cae35d8 (diff)
downloadgenenetwork2-55bbc368c6a02ebfb8f754dfbe7ee5f60edea66b.tar.gz
Merge branch 'master' of github.com:zsloan/genenetwork2 into zsloan
Diffstat (limited to 'wqflask/base/trait.py')
-rw-r--r--wqflask/base/trait.py36
1 files changed, 31 insertions, 5 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 32032ba7..276c624a 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -78,11 +78,37 @@ class GeneralTrait(object):
"""Return a dict suitable for using as json
Actual turning into json doesn't happen here though"""
- return dict(name=self.name,
- dataset=self.dataset.name,
- description=self.description_display,
- mean=self.mean)
-
+
+ if self.dataset.type == "ProbeSet":
+ return dict(name=self.name,
+ symbol=self.symbol,
+ dataset=self.dataset.name,
+ description=self.description_display,
+ mean=self.mean,
+ location=self.location_repr,
+ lrs_score=self.LRS_score_repr,
+ lrs_location=self.LRS_location_repr,
+ additive=self.additive
+ )
+ elif self.dataset.type == "Publish":
+ return dict(name=self.name,
+ dataset=self.dataset.name,
+ description=self.description_display,
+ authors=self.authors,
+ pubmed_text=self.pubmed_text,
+ pubmed_link=self.pubmed_link,
+ lrs_score=self.LRS_score_repr,
+ lrs_location=self.LRS_location_repr,
+ additive=self.additive
+ )
+ elif self.dataset.type == "Geno":
+ return dict(name=self.name,
+ dataset=self.dataset.name,
+ location=self.location_repr
+ )
+ else:
+ return dict()
+
def get_name(self):
stringy = ""