Exemple #1
0
 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))
Exemple #2
0
 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))
Exemple #3
0
 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))
Exemple #4
0
 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))
Exemple #5
0
 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))
Exemple #6
0
 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))