コード例 #1
0
 def testMatchAtEndOfFirstRange(self):
     """
     If the start location in the DIAMOND match is at the very end of
     the first range, the correct offset must be returned.
     """
     # The offset is 20 because the match starts 15 nucleotides into the
     # protein (15 = (6 - 1 ) * 3) and the protein starts at position 5 in
     # the genome. So the match begins at nucleotide 15 + 5 = 20.
     ranges = GenomeRanges('[5:21](+)')
     self.assertEqual(20, ranges.startInGenome({'sstart': 6}))
コード例 #2
0
 def testInFirstRange(self):
     """
     If the start location in the DIAMOND match is in the first range,
     the correct offset must be returned.
     """
     # The offset is 32 because the match starts 27 nucleotides into the
     # protein (27 = (10 - 1 ) * 3) and the protein starts at position 5 in
     # the genome. So the match begins at nucleotide 27 + 5 = 32.
     ranges = GenomeRanges('[5:35](+)')
     self.assertEqual(32, ranges.startInGenome({'sstart': 10}))
コード例 #3
0
 def testMatchAtStartOfFirstRange(self):
     """
     If the start location in the DIAMOND match is at the very beginning of
     the first range, the correct offset must be returned.
     """
     # The offset is 5 because the match starts 0 nucleotides into the
     # protein (0 = (1 - 1 ) * 3) and the protein starts at position 5 in
     # the genome. So the match begins at nucleotide 0 + 5 = 5.
     ranges = GenomeRanges('[5:35](+)')
     self.assertEqual(5, ranges.startInGenome({'sstart': 1}))
コード例 #4
0
 def testInSecondRange(self):
     """
     If the start location in the DIAMOND match is in the second range,
     the correct offset must be returned.
     """
     # The offset is 65 because the match starts 45 nucleotides into the
     # protein (45 = (16 - 1 ) * 3) and the protein has a range of 30
     # nucleotides (35 - 5 = 30) and then a range of 35 nucleotides (85 -
     # 50 = 35). So the match begins 15 (45 - 30 = 15) nucleotides into
     # the second range (which starts at 50), and 15 + 50 = 65.
     ranges = GenomeRanges('join{[5:35](+), [50:85](+)}')
     self.assertEqual(65, ranges.startInGenome({'sstart': 16}))
コード例 #5
0
 def testInThirdRange(self):
     """
     If the start location in the DIAMOND match is in the third range,
     the correct offset must be returned.
     """
     # The offset is 2900 because the match starts 1200 nucleotides into
     # the protein (1200 = (401 - 1 ) * 3) and the protein has a range of
     # 100 nucleotides (100 - 0 = 100), then a range of 200 nucleotides
     # (600 - 400 = 200), then a range of 1000 nucleotides. So the match
     # begins 900 (1200 - 300 = 900) nucleotides into the third range
     # (which starts at 2000), and 2000 + 900 = 2900.
     ranges = GenomeRanges('join{[0:100](+), [400:600](+), [2000:3000](+)}')
     self.assertEqual(2900, ranges.startInGenome({'sstart': 401}))