Exemplo n.º 1
0
 def testFindOneClusterEnd(self):
     """
     The find method must find a cluster at the end of a sequence.
     """
     read = AARead('id', 'AAAAAAAAKKAH')
     finder = ClusterAlphaHelix()
     result = list(finder.find(read))
     self.assertEqual([Landmark('ClusterAlphaHelix', 'CAH', 8, 4, '1131')],
                      result)
Exemplo n.º 2
0
 def testFindOneClusterBeginning(self):
     """
     The find method must find one cluster at the beginning of a sequence.
     """
     read = AARead('id', 'KKAHFFFFFFFFF')
     finder = ClusterAlphaHelix()
     result = list(finder.find(read))
     self.assertEqual([Landmark('ClusterAlphaHelix', 'CAH', 0, 4, '1131')],
                      result)
Exemplo n.º 3
0
 def testFindWithoutCluster(self):
     """
     The find method must return an empty generator when no alpha helix
     cluster is present.
     """
     read = AARead('id', 'FFFFFFFFFFFFFFFFFFFFFFFFFFF')
     finder = ClusterAlphaHelix()
     result = list(finder.find(read))
     self.assertEqual([], result)
Exemplo n.º 4
0
 def testFindTwoIdenticalAAClustersNonIdenticalAAAdjacent(self):
     """
     The find method must find two identical clusters with a different AA
     sequence.
     """
     read = AARead('id', 'KKAHRKMH')
     finder = ClusterAlphaHelix()
     result = list(finder.find(read))
     self.assertEqual([
         Landmark('ClusterAlphaHelix', 'CAH', 0, 4, '1131'),
         Landmark('ClusterAlphaHelix', 'CAH', 4, 4, '1131')
     ], result)
Exemplo n.º 5
0
 def testFindTwoIdenticalClustersNonIdenticalAANotAdjacent(self):
     """
     The find method must find repeating identical clusters that come from
     a different AA sequence.
     """
     read = AARead('id', 'KKAHAAAAAAAARKMH')
     finder = ClusterAlphaHelix()
     result = list(finder.find(read))
     self.assertEqual([
         Landmark('ClusterAlphaHelix', 'CAH', 0, 4, '1131'),
         Landmark('ClusterAlphaHelix', 'CAH', 12, 4, '1131')
     ], result)
Exemplo n.º 6
0
 def testThreeDifferentClustersTwoOccurences(self):
     """
     The find method must find three different clusters with two occurences
     each.
     """
     read = AARead('id', 'KKAHGHLVKVIGKKAHGHLVKVIG')
     finder = ClusterAlphaHelix()
     result = list(finder.find(read))
     self.assertEqual([
         Landmark('ClusterAlphaHelix', 'CAH', 0, 4, '1131'),
         Landmark('ClusterAlphaHelix', 'CAH', 4, 4, '2144'),
         Landmark('ClusterAlphaHelix', 'CAH', 8, 4, '1442'),
         Landmark('ClusterAlphaHelix', 'CAH', 12, 4, '1131'),
         Landmark('ClusterAlphaHelix', 'CAH', 16, 4, '2144'),
         Landmark('ClusterAlphaHelix', 'CAH', 20, 4, '1442')
     ], result)