diff options
author | zsloan | 2021-06-16 21:58:00 +0000 |
---|---|---|
committer | zsloan | 2021-06-16 21:58:00 +0000 |
commit | 4f06f22071898171cb7bbc12f5dfd42b05dc3208 (patch) | |
tree | 9cbb223aeb73638276de5a188804fbb084c5728c /wqflask/base/data_set.py | |
parent | f5a7a54741cef7285e8862ceb2493fe3f451fb84 (diff) | |
download | genenetwork2-4f06f22071898171cb7bbc12f5dfd42b05dc3208.tar.gz |
Added function as_dict to data_set.py for situations where we don't want to pass around the whole dataset object
Diffstat (limited to 'wqflask/base/data_set.py')
-rw-r--r-- | wqflask/base/data_set.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 75ddf278..dc338971 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -559,6 +559,7 @@ class DataSet: self.fullname = None self.type = None self.data_scale = None # ZS: For example log2 + self.accession_id = None self.setup() @@ -575,6 +576,17 @@ class DataSet: self.group.get_samplelist() self.species = species.TheSpecies(self) + def as_dict(self): + return { + 'name': self.name, + 'shortname': self.shortname, + 'fullname': self.fullname, + 'type': self.type, + 'data_scale': self.data_scale, + 'group': self.group.name, + 'accession_id': self.accession_id + } + def get_accession_id(self): if self.type == "Publish": results = g.db.execute("""select InfoFiles.GN_AccesionId from InfoFiles, PublishFreeze, InbredSet where |