Beispiel #1
0
 def testFindWithoutMotif(self):
     """
     The find method must return an empty generator when no motif is
     present.
     """
     read = AARead('id', 'FFFFFFFFFFFFFFFFFFFFFFFFFFF')
     finder = EukaryoticLinearMotif()
     result = list(finder.find(read))
     self.assertEqual([], result)
Beispiel #2
0
 def testFindOneMotifMiddle(self):
     """
     The find method must find a motif in the middle of a sequence.
     """
     read = AARead('id', 'AAAAAAAAEKENLGYAAAAAAAA')
     finder = EukaryoticLinearMotif()
     result = list(finder.find(read))
     self.assertEqual([
         Landmark('EukaryoticLinearMotif', 'ELM', 8, 5, 'DEG_APCC_KENBOX_2')
     ], result)
Beispiel #3
0
 def testFindOneMotifBeginning(self):
     """
     The find method must find one motif at the beginning of a sequence.
     """
     read = AARead('id', 'EKENLGYAAAAAAAA')
     finder = EukaryoticLinearMotif()
     result = list(finder.find(read))
     self.assertEqual([
         Landmark('EukaryoticLinearMotif', 'ELM', 0, 5, 'DEG_APCC_KENBOX_2')
     ], result)
Beispiel #4
0
 def testFindOneMotifEnd(self):
     """
     The find method must find a motif at the end of a sequence.
     """
     read = AARead('id', 'AAAAAAAAEGGKENY')
     finder = EukaryoticLinearMotif()
     result = list(finder.find(read))
     self.assertEqual([
         Landmark('EukaryoticLinearMotif', 'ELM', 10, 5,
                  'DEG_APCC_KENBOX_2')
     ], result)
Beispiel #5
0
 def testFindTwoIdenticalMotifsAdjacent(self):
     """
     The find method must find two identical motifs next to each other.
     """
     read = AARead('id', 'EKENLGKENG')
     finder = EukaryoticLinearMotif()
     result = list(finder.find(read))
     self.assertEqual([
         Landmark('EukaryoticLinearMotif', 'ELM', 0, 5,
                  'DEG_APCC_KENBOX_2'),
         Landmark('EukaryoticLinearMotif', 'ELM', 5, 5, 'DEG_APCC_KENBOX_2')
     ], result)
Beispiel #6
0
 def testFindTwoIdenticalMotifsNotAdjacent(self):
     """
     The find method must find repeating identical motifs.
     """
     read = AARead('id', 'EKENLGYAAAAAAAAEGKENGY')
     finder = EukaryoticLinearMotif()
     result = list(finder.find(read))
     self.assertEqual([
         Landmark('EukaryoticLinearMotif', 'ELM', 0, 5,
                  'DEG_APCC_KENBOX_2'),
         Landmark('EukaryoticLinearMotif', 'ELM', 16, 5,
                  'DEG_APCC_KENBOX_2')
     ], result)
Beispiel #7
0
 def testThreeDifferentMotifs(self):
     """
     The find method must find two different motifs.
     """
     read = AARead('id', 'EKENLGKENGWWWPWWP')
     finder = EukaryoticLinearMotif()
     result = list(finder.find(read))
     self.assertEqual([
         Landmark('EukaryoticLinearMotif', 'ELM', 0, 5,
                  'DEG_APCC_KENBOX_2'),
         Landmark('EukaryoticLinearMotif', 'ELM', 5, 5,
                  'DEG_APCC_KENBOX_2'),
         Landmark('EukaryoticLinearMotif', 'ELM', 10, 4, 'LIG_CSL_BTD_1'),
         Landmark('EukaryoticLinearMotif', 'ELM', 10, 7, 'LIG_SH3_3')
     ], result)
Beispiel #8
0
    def testMatchAlteration(self):
        """
        The find method must work on a regex that contains alternation (e.g.,
        [ABC]).
        """
        # Make sure we know what pattern is actually being matched.
        self.assertEqual('.P[TS]AP.', _DATABASE[22]['pattern'].pattern)
        self.assertEqual('LIG_PTAP_UEV_1', _DATABASE[22]['identifier'])

        finder = EukaryoticLinearMotif()

        result = list(finder.find(AARead('id', 'SPTAPS')))
        self.assertEqual(
            [Landmark('EukaryoticLinearMotif', 'ELM', 0, 6, 'LIG_PTAP_UEV_1')],
            result)

        result = list(finder.find(AARead('id', 'SPSAPS')))
        self.assertEqual(
            [Landmark('EukaryoticLinearMotif', 'ELM', 0, 6, 'LIG_PTAP_UEV_1')],
            result)