예제 #1
0
 def search_chromosome(self, study=None, pval_interval=None):
     logger.info("Searching for chromosome %s", str(self.chromosome))
     max_size = self.service.get_chromosome_size(chromosome=self.chromosome)
     method_arguments = {'chromosome': self.chromosome}
     restrictions = {'pval_interval': pval_interval, 'study': study}
     return search.general_search(search_obj=self, max_size=max_size,
                                  arguments=method_arguments, restriction_dictionary=restrictions)
예제 #2
0
 def search_chromosome_block(self, bp_interval, study=None, pval_interval=None):
     logger.info("Searching for chromosome %s / block floor %s, block ceil %s", str(self.chromosome),
                 str(bp_interval.floor()), str(bp_interval.ceil()))
     max_size = self.service.get_block_range_size(chromosome=self.chromosome, bp_interval=bp_interval)
     method_arguments = {'chromosome': self.chromosome, 'bp_interval': bp_interval}
     restrictions = {'pval_interval': pval_interval, 'study': study}
     return search.general_search(search_obj=self, max_size=max_size,
                                  arguments=method_arguments, restriction_dictionary=restrictions)
예제 #3
0
 def search_snp(self, study=None, pval_interval=None):
     logger.info("Searching for variant %s", self.snp)
     max_size = self.service.get_snp_size(self.snp)
     method_arguments = {'snp': self.snp}
     restrictions = {'pval_interval': pval_interval, 'study': study}
     return search.general_search(search_obj=self,
                                  max_size=max_size,
                                  arguments=method_arguments,
                                  restriction_dictionary=restrictions)
예제 #4
0
 def search_trait(self, pval_interval=None):
     """
     Search for the data of the TraitSearch object's trait
     :param pval_interval: optional p-value interval of type FloatInterval
     :return: a tuple (datasets, index_marker) where 'datasets' is a dictionary with the names of the datasets and
     the data to be returned (the result of the query after applying restrictions) and index_marker is an integer indicating
     up to where the query went in the dataset so that the next query can calculate it's next start base on the index_marker.
     """
     logger.info("Searching for trait %s with pval_interval %s", self.trait,
                 str(pval_interval))
     method_arguments = {'trait': self.trait}
     restrictions = {'pval_interval': pval_interval}
     return search.general_search(search_obj=self,
                                  max_size=self.max_size_of_trait,
                                  arguments=method_arguments,
                                  restriction_dictionary=restrictions)
예제 #5
0
 def search_study(self, study, pval_interval=None):
     """
     Search for the data of a study that lives under the StudySearch object's trait
     :param study: name of the study we are searching for (str)
     :param pval_interval: optional p-value interval of type FloatInterval
     :return: a tuple (datasets, index_marker) where 'datasets' is a dictionary with the names of the datasets and
     the data to be returned (the result of the query after applying restrictions) and index_marker is an integer indicating
     up to where the query went in the dataset so that the next query can calculate it's next start base on the index_marker.
     """
     logger.info("Searching for study %s with pval_interval %s", study,
                 str(pval_interval))
     method_arguments = {'trait': self.trait, 'study': study}
     total_study_size = self.service.get_study_size(self.trait, study)
     restrictions = {'pval_interval': pval_interval}
     return search.general_search(search_obj=self,
                                  max_size=total_study_size,
                                  arguments=method_arguments,
                                  restriction_dictionary=restrictions)