def testNoExtrema(self): """ If an alpha helix has no extrema, the analysis must be as expected. """ read = AARead('id', 'GGG') self.assertEqual( { 'consecutivePeaks': [], 'consecutiveTroughs': [], 'extremaCount': 0, 'final': None, 'initial': None, }, analyzeAlphaHelix(read))
def testEmptyRead(self): """ The analysis of an empty alpha helix must be as expected. """ read = AARead('id', '') self.assertEqual( { 'consecutivePeaks': [], 'consecutiveTroughs': [], 'extremaCount': 0, 'final': None, 'initial': None, }, analyzeAlphaHelix(read))
def testTwoPeaksEachContainingOneAA(self): """ If an alpha helix has two peaks, each made up of one amino acid, the analysis must be as expected. """ read = AARead('id', 'GGFGRG') self.assertEqual( { 'consecutivePeaks': [1], 'consecutiveTroughs': [1], 'extremaCount': 2, 'final': 1, 'initial': 2, }, analyzeAlphaHelix(read))
def testOnePeakContainingTwoAAsWithIntermediate(self): """ If an alpha helix has one peak made up of two amino acids separated by a non-peak AA, the analysis must be as expected. """ read = AARead('id', 'GFGFGG') self.assertEqual( { 'consecutivePeaks': [2], 'consecutiveTroughs': [], 'extremaCount': 2, 'final': 2, 'initial': 1, }, analyzeAlphaHelix(read))
def testZeroInitialAndFinal(self): """ If an alpha helix has no leading non-extrema AAs, the 'initial' and 'final' values in the analysis must be zero. """ read = AARead('id', 'F') self.assertEqual( { 'consecutivePeaks': [1], 'consecutiveTroughs': [], 'extremaCount': 1, 'final': 0, 'initial': 0, }, analyzeAlphaHelix(read))
def testThreePeaksEachContainingMultipleAAsWithIntermediates(self): """ If an alpha helix has three peaks, each made up of multiple amino acids with non-extrema intermediates, the analysis must be as expected. """ read = AARead('id', 'GGGFGFFFGRRRGGRRFFGFGGGG') self.assertEqual( { 'consecutivePeaks': [4, 3], 'consecutiveTroughs': [5], 'extremaCount': 12, 'final': 4, 'initial': 3, }, analyzeAlphaHelix(read))