예제 #1
0
    def __init__(self, function_id, cmrun, seqtype):
        """creates a ScoringFunction"""
        scoring.ScoringFunctionBase.__init__(self, function_id, cmrun)
        # attributes accessible by subclasses
        self.seqtype = seqtype
        self.__setup_meme_suite(cmrun.config_params)
        self.num_motif_func = util.get_iter_fun(
            cmrun.config_params['MEME'], "nmotifs",
            cmrun.config_params['num_iterations'])

        self.__last_motif_infos = None
        self.__last_iteration_result = {}
        self.all_pvalues = None
        self.last_result = None

        self.update_log = scoring.RunLog(("%s-score-" % function_id) + seqtype,
                                         cmrun.dbsession(),
                                         cmrun.config_params)
        self.motif_log = scoring.RunLog(("%s-motif-" % function_id) + seqtype,
                                        cmrun.dbsession(), cmrun.config_params)

        used_genes = sorted(cmrun.ratios.row_names)
        self.used_seqs = cmrun.organism().sequences_for_genes_scan(
            used_genes, seqtype=self.seqtype)

        logging.debug("building reverse map...")
        start_time = util.current_millis()
        self.reverse_map = self.__build_reverse_map(cmrun.ratios)
        logging.debug("reverse map built in %d ms.",
                      util.current_millis() - start_time)

        self.__last_results = None  # caches the results of the previous meme run
예제 #2
0
 def __init__(self, organism, membership, ratios, config_params=None):
     """Create scoring function instance"""
     scoring.ScoringFunctionBase.__init__(self, "SetEnrichment", organism,
                                          membership, ratios, config_params)
     self.__set_types = read_set_types(config_params, organism.thesaurus(),
                                       ratios.row_names)
     self.run_log = scoring.RunLog('set_enrichment', config_params)
예제 #3
0
 def __init__(self, function_id, cmrun):
     """Create scoring function instance"""
     scoring.ScoringFunctionBase.__init__(self, function_id, cmrun)
     self.__set_types = read_set_types(self.config_params,
                                       self.organism.thesaurus(),
                                       self.ratios.row_names)
     self.run_log = scoring.RunLog(function_id, cmrun.dbsession(),
                                   self.config_params)
예제 #4
0
 def __init__(self, organism, membership, ratios, config_params):
     """Create scoring function instance"""
     scoring.ScoringFunctionBase.__init__(self, "Rows", organism,
                                          membership, ratios, config_params)
     self.run_log = scoring.RunLog("row_scoring", config_params)
예제 #5
0
 def __init__(self, organism, membership, ratios, config_params):
     """Create scoring function instance"""
     scoring.ScoringFunctionBase.__init__(self, "Networks", organism, membership,
                                          ratios, config_params)
     self.__networks = None
     self.run_log = scoring.RunLog("network", config_params)
예제 #6
0
 def __init__(self, function_id, cmrun):
     """Create scoring function instance"""
     scoring.ScoringFunctionBase.__init__(self, function_id, cmrun)
     self.run_log = scoring.RunLog(function_id, cmrun.dbsession(),
                                   cmrun.config_params)