def CompareTextMotifKmers(realKmerDict, predictedKmers, posFile, negFile): numFP = numTP = numFN = 0 if len(predictedKmers) == 0: numFN = compareKmerCommon.getTotalFNKmerNotFound(realKmerDict); else: numTP, numFP, numFN = compareKmerCommon.GetTotalNumbers(realKmerDict, posFile, negFile, None, None, predictedKmers) return numTP, numFP, numFN;
def ComparePSSMKmers(realKmerDict, predictedDremeFile, posFile, negFile, pssmList): numTP = numFP = numFN = 0; if len(pssmList) == 0: numFP = compareKmerCommon.getTotalFNKmerNotFound(realKmerDict); else: numTP, numFP, numFN = compareKmerCommon.GetTotalNumbers(realKmerDict, posFile, negFile, pssmList, None, None) return numTP, numFP, numFN;
def test_getTotalFPWhenPredictedIsEmpty(self): realKmerDict = dict(); realKmerDict['0'] = ['ATTTA', 10] realKmerDict['1'] = ['ATTTTA', 10] realKmerDict['2'] = ['ATTTTTA', 10] realKmerDict['3'] = ['ATTTAAAA', 10] totalFN = compareKmerCommon.getTotalFNKmerNotFound(realKmerDict); self.assertEqual(totalFN, 26);
def ComparePWMKmers(realKmerDict, predictedKspectrumFile, posFile, negFile, pssmList): numFP = numTP = numFN = 0 pwm = splitKmerInDict.GetKspectrumPWM(predictedKspectrumFile); if len(pwm) == 0: numFP = compareKmerCommon.getTotalFNKmerNotFound(realKmerDict); else: numTP, numFP, numFN = compareKmerCommon.GetTotalNumbers(realKmerDict, posFile, negFile, None, pwm, None) return numTP, numFP, numFN;
def CompareKspectrumPredictedKmers(realCsvFile, predictedKspectrumFile, posFile, negFile, numKmers): realKmerDict = parseRealKmers.GetRealKmerDict(realCsvFile); predictedKmerDict = parseKspectrum.FindKspectrumKmers(predictedKspectrumFile, numKmers); numTP = 0 numFP = 0 numFN = 0 if len(predictedKmerDict) == 0: numFP = compareKmerCommon.getTotalFNKmerNotFound(realKmerDict); else: numTP, numFP, numFN = compareKmerCommon.GetTotalNumbers(realKmerDict, posFile, negFile, None, None, None, predictedKmerDict) return numTP, numFP, numFN