def testGetUpdateCounts(self): kmerList = ['TTAATATTT', 'TTTTTATTT'] maxKmerLen, kmerDictList = splitKmerInDict.createKmerDictList(kmerList) aList, tList, gList, cList = splitKmerInDict.getUpdatedCounts(maxKmerLen, kmerDictList); expectedAList = [ 0, 0, 1, 1, 0, 2, 0, 0, 0] expectedTList = [2, 2, 1, 1, 2, 0, 2, 2, 2] self.assertTrue(len(set(expectedAList).intersection(aList)) > 0) self.assertTrue(len(set(expectedTList).intersection(tList)) > 0)
def testGetUpdateCountsLargeKmerList(self): kmerList = ['TTTTATTAT', 'TTCTATTTA', 'ATTTATTTT', 'TTAATATTT', 'TTTATTTTT', 'TAATTATTT', 'TTATTTTTA', 'TATTATTTT', 'TATTTATTA', 'CTTATTTAT', 'ATTTTATTT', 'TTTTTATTT', 'TATATTTAT', 'TATTTTATT'] maxKmerLen, kmerDictList = splitKmerInDict.createKmerDictList(kmerList) aList, tList, gList, cList = splitKmerInDict.getUpdatedCounts(maxKmerLen, kmerDictList); expectedAList = [2, 5, 3, 4, 4, 5, 1, 3, 3] expectedTList = [11, 9, 10, 10, 10, 9, 13, 11, 11] expectedGList = [0, 0, 0, 0, 0, 0, 0, 0, 0] expectedCList = [1, 0, 1, 0, 0, 0, 0, 0, 0] self.assertTrue(len(set(expectedAList).intersection(aList)) > 0) self.assertTrue(len(set(expectedTList).intersection(tList)) > 0) self.assertTrue(len(set(expectedGList).intersection(gList)) > 0) self.assertTrue(len(set(expectedCList).intersection(cList)) > 0)