diff options
author | zsloan | 2020-06-04 14:23:30 -0500 |
---|---|---|
committer | zsloan | 2020-06-04 14:23:30 -0500 |
commit | 1a663f987bf3a640d21c2c89402318d5433efd9e (patch) | |
tree | 07314f422059ce6e502feb9827f574af7512e73d /wqflask/utility/helper_functions.py | |
parent | c562bd7cd68735ded82d39868cf1af36c35a7920 (diff) | |
download | genenetwork2-1a663f987bf3a640d21c2c89402318d5433efd9e.tar.gz |
Really should have split this into many more commits:
- Now use proxy to pull trait data and hide traits/results that the user
doesn't have view permission for
- Created a factory method for creating trait ob so it can return None
when user doesn't have view permissions (this is why such a large number
of files are changed)
- Added metadata to permutation export
- Added current group management code
- Added fixed password verification e-mail code
Diffstat (limited to 'wqflask/utility/helper_functions.py')
-rw-r--r-- | wqflask/utility/helper_functions.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/wqflask/utility/helper_functions.py b/wqflask/utility/helper_functions.py index e7c04fef..9ce809b6 100644 --- a/wqflask/utility/helper_functions.py +++ b/wqflask/utility/helper_functions.py @@ -1,7 +1,7 @@ from __future__ import absolute_import, print_function, division -from base.trait import GeneralTrait from base import data_set +from base.trait import create_trait from base.species import TheSpecies from utility import hmac @@ -11,7 +11,6 @@ from flask import Flask, g import logging logger = logging.getLogger(__name__ ) - def get_species_dataset_trait(self, start_vars): #assert type(read_genotype) == type(bool()), "Expecting boolean value for read_genotype" if "temp_trait" in start_vars.keys(): @@ -24,7 +23,7 @@ def get_species_dataset_trait(self, start_vars): logger.debug("After creating dataset") self.species = TheSpecies(dataset=self.dataset) logger.debug("After creating species") - self.this_trait = GeneralTrait(dataset=self.dataset, + self.this_trait = create_trait(dataset=self.dataset, name=start_vars['trait_id'], cellid=None, get_qtl_info=True) @@ -34,7 +33,6 @@ def get_species_dataset_trait(self, start_vars): #self.dataset.group.read_genotype_file() #self.genotype = self.dataset.group.genotype - def get_trait_db_obs(self, trait_db_list): if isinstance(trait_db_list, basestring): trait_db_list = trait_db_list.split(",") @@ -49,10 +47,11 @@ def get_trait_db_obs(self, trait_db_list): dataset_ob = data_set.create_dataset(dataset_name=dataset_name, dataset_type="Temp", group_name=trait_name.split("_")[2]) else: dataset_ob = data_set.create_dataset(dataset_name) - trait_ob = GeneralTrait(dataset=dataset_ob, + trait_ob = create_trait(dataset=dataset_ob, name=trait_name, cellid=None) - self.trait_list.append((trait_ob, dataset_ob)) + if trait_ob: + self.trait_list.append((trait_ob, dataset_ob)) def get_species_groups(): |