def getTFBSbyRatio(self, sequence, minscore_percent=0.1): """returns the hits, which are better then log2(minscore_percent*maxprod) These are possible Transcription Factor Binding Sites. The formula is equal to log2(minscore_percent)+maxscore""" minscore=log2(minscore_percent) #self.setBG(sequence) print "Max Score: %f Cutoff: %f"%(self.maxscore,minscore+self.maxscore) #seqIO=StringIO(sequence) #seqIO.seek(0) #seqIO=open("/home/kpalin/tyot/comparative/mabs/iso.tmp.fa") #seqIO.seek(1) ret=_c_matrix.getTFBSwithBg(self.M_weight, sequence, minscore+self.maxscore,Matrix.backGround) if not ret: ret={} if ret.has_key("NEXT_SEQ"): print "NEXT_SEQ",ret["NEXT_SEQ"] del ret["NEXT_SEQ"] return ret
def getTFBSbyAbsolute(self,sequence,cutoff): """Returns the hits that are better than cutoff""" #self.setBG(sequence) #self.initWeights() print "Max Score: %f Cutoff: %f"%(self.maxscore,cutoff) #seqIO=StringIO(sequence) #seqIO.seek(0) #self.initWeights(0) if self.maxscore>cutoff: #bg=matrix.BackGround(open("/home/kpalin/tyot/comparative/humanGenome/chr1.fa")) ret=_c_matrix.getTFBSwithBg(self.M_weight,sequence,cutoff,Matrix.backGround) #ret=matrix.getTFBS(self.M_weight,sequence,cutoff) if ret.has_key("NEXT_SEQ"): print "NEXT_SEQ",ret["NEXT_SEQ"] del ret["NEXT_SEQ"] else: ret={} return ret