def __call__(self, threshold, alphabet_len=None, use_loose=True): """Returns a MotifResults object containing a list of significant Motifs - When a Module is found that is less than the threshold, a new Motif object is created and added to the list of significant motifs. """ #Create new MotifResults object k_word_results = MotifResults() k_word_results.Modules = [] k_word_results.Motifs = [] #Add alignment to MotifResults k_word_results.Alignment = self.Alignment #Give each module a unique ID module_id = 0 #For each module for i, module in enumerate(self.Modules): if use_loose: p_curr = self.getPValueLoose(module, alphabet_len) else: p_curr = self.getPValueStrict(module, alphabet_len) #If the P value is less than or equal to the threshold if p_curr <= threshold: #Add the P value to the current module module.Pvalue = p_curr module.ID = module_id module_id += 1 #Append the module to the k_word_results Modules list k_word_results.Modules.append(module) #Create a Motif from the module and append to Motifs list k_word_results.Motifs.append(Motif(module)) return k_word_results
def __call__(self, threshold, alphabet_len=None, use_loose=True): """Returns a MotifResults object containing a list of significant Motifs - When a Module is found that is less than the threshold, a new Motif object is created and added to the list of significant motifs. """ # Create new MotifResults object k_word_results = MotifResults() k_word_results.Modules = [] k_word_results.Motifs = [] # Add alignment to MotifResults k_word_results.Alignment = self.Alignment # Give each module a unique ID module_id = 0 # For each module for i, module in enumerate(self.Modules): if use_loose: p_curr = self.getPValueLoose(module, alphabet_len) else: p_curr = self.getPValueStrict(module, alphabet_len) # If the P value is less than or equal to the threshold if p_curr <= threshold: # Add the P value to the current module module.Pvalue = p_curr module.ID = module_id module_id += 1 # Append the module to the k_word_results Modules list k_word_results.Modules.append(module) # Create a Motif from the module and append to Motifs list k_word_results.Motifs.append(Motif(module)) return k_word_results