예제 #1
0
    def setUp(self):

        super(TestProfileHMMSegment, self).setUp()

        self.hmm = build_hmm()
        self.segment = ProfileHMMSegment(self.hmm, 1, 2)
        self.string = self.config.getContent('test2.hhm')
예제 #2
0
    def testConstructor(self):

        self.segment.convert_scores(ScoreUnits.Probability)

        self.assertEqual(self.hmm.segment(1, 1).layers.length, 1)
        self.assertEqual(self.segment.layers.length, 2)
        self.assertEqual(
            self.segment.start.transitions[States.Match].probability, 1)
        self.assertEqual(
            self.segment.layers[1][States.Match].emission[ProteinAlphabet.CYS],
            0.5)
        self.assertRaises(IndexError, self.hmm.segment, 1, 3)

        self.hmm.convert_scores(ScoreUnits.LogScales)
        segment = ProfileHMMSegment(self.hmm, 1, 2)
        self.assertEqual(segment.source_start, 1)