Exemple #1
0
 def testMedianScoreOfTwo(self):
     """
     The medianScore function must return the median score for the HSPs in
     all the alignments matching a title when given 2 scores.
     """
     hsp1 = HSP(7)
     hsp2 = HSP(15)
     titleAlignments = TitleAlignments('subject title', 55)
     read = Read('id1', 'AAA')
     titleAlignment = TitleAlignment(read, [hsp1, hsp2])
     titleAlignments.addAlignment(titleAlignment)
     self.assertEqual(11, titleAlignments.medianScore())
 def testMedianScoreOfTwo(self):
     """
     The medianScore function must return the median score for the HSPs in
     all the alignments matching a title when given 2 scores.
     """
     hsp1 = HSP(7)
     hsp2 = HSP(15)
     titleAlignments = TitleAlignments('subject title', 55)
     read = Read('id1', 'AAA')
     titleAlignment = TitleAlignment(read, [hsp1, hsp2])
     titleAlignments.addAlignment(titleAlignment)
     self.assertEqual(11, titleAlignments.medianScore())
 def testMedianScoreOfThree(self):
     """
     The medianScore function must return the median score for the HSPs in
     all the alignments matching a title when given 3 scores.
     """
     hsp1 = HSP(7)
     hsp2 = HSP(15)
     hsp3 = HSP(21)
     titleAlignments = TitleAlignments("subject title", 55)
     read = Read("id1", "AAA")
     titleAlignment = TitleAlignment(read, [hsp1, hsp2])
     titleAlignments.addAlignment(titleAlignment)
     read = Read("id2", "AAA")
     titleAlignment = TitleAlignment(read, [hsp3])
     titleAlignments.addAlignment(titleAlignment)
     self.assertEqual(15, titleAlignments.medianScore())