Пример #1
0
    def test_can_handle_single_run_plus_other(self):
        content = '...HHHHHEEE'

        results = parse._extract_secondary_runs(content, ss_type='H', run_length=5, at_least=5)

        self.assertEqual(len(results), 1)
        result = results[0]
        self.assertEqual(result.start, 3)
        self.assertEqual(result.end, 8)
Пример #2
0
    def test_can_handle_multiple_runs(self):
        content = '...HHHHH...HHHHH...'

        results = parse._extract_secondary_runs(content, ss_type='H', run_length=5, at_least=5)

        self.assertEqual(len(results), 2)
        self.assertEqual(results[0].start, 3)
        self.assertEqual(results[0].end, 8)
        self.assertEqual(results[1].start, 11)
        self.assertEqual(results[1].end, 16)
Пример #3
0
    def test_can_handle_single_run(self):
        content = "HHHHH"

        results = parse._extract_secondary_runs(
            content, ss_type="H", run_length=5, at_least=5, first_residue=0
        )

        self.assertEqual(len(results), 1)
        result = results[0]
        self.assertEqual(result.start, 0)
        self.assertEqual(result.end, 5)
Пример #4
0
    def test_can_handle_single_run_plus_other(self):
        content = "...HHHHHEEE"

        results = parse._extract_secondary_runs(
            content, ss_type="H", run_length=5, at_least=5, first_residue=0
        )

        self.assertEqual(len(results), 1)
        result = results[0]
        self.assertEqual(result.start, 3)
        self.assertEqual(result.end, 8)
Пример #5
0
    def test_can_handle_single_run(self):
        content = 'HHHHH'

        results = parse._extract_secondary_runs(content,
                                                ss_type='H',
                                                run_length=5,
                                                at_least=5)

        self.assertEqual(len(results), 1)
        result = results[0]
        self.assertEqual(result.start, 0)
        self.assertEqual(result.end, 5)
Пример #6
0
    def test_can_handle_multiple_runs(self):
        content = "...HHHHH...HHHHH..."

        results = parse._extract_secondary_runs(
            content, ss_type="H", run_length=5, at_least=5, first_residue=0
        )

        self.assertEqual(len(results), 2)
        self.assertEqual(results[0].start, 3)
        self.assertEqual(results[0].end, 8)
        self.assertEqual(results[1].start, 11)
        self.assertEqual(results[1].end, 16)
Пример #7
0
    def test_can_handle_at_least(self):
        content = "...HHHHH..."

        results = parse._extract_secondary_runs(
            content, ss_type="H", run_length=5, at_least=4, first_residue=0
        )

        self.assertEqual(len(results), 3)
        self.assertEqual(results[0].start, 2)
        self.assertEqual(results[0].end, 7)
        self.assertEqual(results[1].start, 3)
        self.assertEqual(results[1].end, 8)
        self.assertEqual(results[2].start, 4)
        self.assertEqual(results[2].end, 9)
Пример #8
0
    def test_can_handle_at_least(self):
        content = '...HHHHH...'

        results = parse._extract_secondary_runs(content,
                                                ss_type='H',
                                                run_length=5,
                                                at_least=4)

        self.assertEqual(len(results), 3)
        self.assertEqual(results[0].start, 2)
        self.assertEqual(results[0].end, 7)
        self.assertEqual(results[1].start, 3)
        self.assertEqual(results[1].end, 8)
        self.assertEqual(results[2].start, 4)
        self.assertEqual(results[2].end, 9)