예제 #1
0
 def load_traits(self):
     hdf_store = fsutils.create_h5file_path(path=self.hdf_path,
                                            file_name="phen_meta",
                                            dir_name=self.trait_dir)
     dftrait = pd.read_csv(self.trait_file, sep="\t")
     self.write_traitfile_to_hdf(hdf_store,
                                 os.path.basename(self.trait_file))
예제 #2
0
 def _get_traversed_size(self, retrieved_index, trait):
     if retrieved_index == 0:
         h5file = fsutils.create_h5file_path(self.search_path, dir_name=self.trait_dir, file_name=trait)
         service = trait_service.TraitService(h5file)
         trait_size = service.get_trait_size(trait)
         service.close_file()
         return trait_size
     return retrieved_index
예제 #3
0
 def get_list_of_studies_for_trait(self, trait):
     h5file = fsutils.create_h5file_path(self.search_path, self.trait_dir,
                                         trait)
     if not isfile(h5file):
         raise NotFoundError("Trait " + trait)
     service = study_service.StudyService(h5file=h5file)
     studies = service.list_studies()
     service.close_file()
     return sorted(studies)
예제 #4
0
    def __init__(self, chromosome, start, size, config_properties=None):
        self.chromosome = chromosome
        self.start = start
        self.size = size

        self.properties = properties_handler.get_properties(config_properties)
        self.search_path = properties_handler.get_search_path(self.properties)
        self.chr_dir = self.properties.chr_dir

        self.datasets = utils.create_dictionary_of_empty_dsets(TO_QUERY_DSETS)
        self.index_marker = 0

        self.h5file = fsutils.create_h5file_path(path=self.search_path, dir_name=self.chr_dir, file_name=chromosome)

        if not os.path.isfile(self.h5file):
            raise NotFoundError("Chromosome " + str(chromosome))
        self.service = chromosome_service.ChromosomeService(self.h5file)
예제 #5
0
    def __init__(self, trait, start, size, config_properties=None):
        self.trait = trait
        self.start = start
        self.size = size

        self.properties = properties_handler.get_properties(config_properties)
        self.search_path = properties_handler.get_search_path(self.properties)
        self.trait_dir = self.properties.trait_dir

        self.datasets = utils.create_dictionary_of_empty_dsets(TO_QUERY_DSETS)
        # index marker will be returned along with the datasets
        # it is the number that when added to the 'start' value that we started the query with
        # will pinpoint where the next search needs to continue from
        self.index_marker = 0

        self.h5file = fsutils.create_h5file_path(self.search_path,
                                                 dir_name=self.trait_dir,
                                                 file_name=trait)
        if not os.path.isfile(self.h5file):
            raise NotFoundError("Trait " + trait)
        self.service = study_service.StudyService(self.h5file)