diff options
author | zsloan | 2021-08-12 22:35:53 +0000 |
---|---|---|
committer | zsloan | 2021-08-12 22:35:53 +0000 |
commit | f4fbb6d53419a19c6ee67977d18605cdcbb09c0e (patch) | |
tree | 0411423e1171c12face0060142d725a61fce415d /wqflask | |
parent | eecaad2dac6efa885540287a7ef5a273c6d18be2 (diff) | |
download | genenetwork2-f4fbb6d53419a19c6ee67977d18605cdcbb09c0e.tar.gz |
add function for reading in JSON file that lists sample lists unique to each study within a group (in this case only BXD Longevity for now)
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/base/data_set.py | 9 | ||||
-rw-r--r-- | wqflask/wqflask/show_trait/show_trait.py | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 4cb82665..b8f2f9fb 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -398,6 +398,15 @@ class DatasetGroup: if maternal and paternal: self.parlist = [maternal, paternal] + def get_study_samplelists(self): + study_sample_file = "%s/study_sample_lists/%s.json" % (webqtlConfig.GENODIR, self.name) + try: + f = open(study_sample_file) + except: + return None + study_samples = json.load(f) + return study_samples + def get_genofiles(self): jsonfile = "%s/%s.json" % (webqtlConfig.GENODIR, self.name) try: diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index c07430dd..d3356bc3 100644 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -192,6 +192,7 @@ class ShowTrait: [self.dataset.species.chromosomes.chromosomes[this_chr].name, i]) self.genofiles = self.dataset.group.get_genofiles() + self.study_samplelists = self.dataset.group.get_study_samplelists() # ZS: No need to grab scales from .geno file unless it's using # a mapping method that reads .geno files |