예제 #1
0
파일: vtm_test.py 프로젝트: TGenNorth/NASP
    def test__index_contig_sorts_samples_by_identifier(self):
        expected = (
            'a::b',
            'a::b,c',
            'a::c',
            'a::c,b',
            'b::a',
            'b::a,c',
            'b::c',
            'b::c,a',
            'c::a',
            'c::a,b',
            'c::b',
            'c::b,a'
        )

        (reference, dups, sample_groups) = vtm._index_contigs(
            testdata.REFERENCE_FASTA,
            testdata.REFERENCE_DUPS,
            self.frankenfastas,
            self.vcfs
        )

        for expect, observe in itertools.zip_longest(expected, itertools.chain.from_iterable(sample_groups)):
            self.assertEqual(expect, observe.identifier)
예제 #2
0
파일: vtm_test.py 프로젝트: SemiQuant/NASP
    def test__index_contig_sorts_samples_by_identifier(self):
        expected = ('a::b', 'a::b,c', 'a::c', 'a::c,b', 'b::a', 'b::a,c',
                    'b::c', 'b::c,a', 'c::a', 'c::a,b', 'c::b', 'c::b,a')

        (reference, dups,
         sample_groups) = vtm._index_contigs(testdata.REFERENCE_FASTA,
                                             testdata.REFERENCE_DUPS,
                                             self.frankenfastas, self.vcfs)

        for expect, observe in itertools.zip_longest(
                expected, itertools.chain.from_iterable(sample_groups)):
            self.assertEqual(expect, observe.identifier)
예제 #3
0
파일: vtm_test.py 프로젝트: SemiQuant/NASP
    def test__index_contig(self):
        (reference, dups,
         sample_groups) = vtm._index_contigs(testdata.REFERENCE_FASTA,
                                             testdata.REFERENCE_DUPS,
                                             self.frankenfastas, self.vcfs)

        self.assertIsInstance(reference, Fasta)
        self.assertIsInstance(dups, Fasta)

        # The individual sample analyses should be grouped by sample name; in this case a, b, and c
        # In this test, each sample should have 4 analyses
        for expected_sample_name, sample in zip(('a', 'b', 'c'),
                                                sample_groups):
            self.assertEqual(4, len(sample))
            for analysis in sample:
                self.assertEqual(expected_sample_name, analysis.name)
예제 #4
0
파일: vtm_test.py 프로젝트: TGenNorth/NASP
    def test__index_contig(self):
        (reference, dups, sample_groups) = vtm._index_contigs(
            testdata.REFERENCE_FASTA,
            testdata.REFERENCE_DUPS,
            self.frankenfastas,
            self.vcfs
        )

        self.assertIsInstance(reference, Fasta)
        self.assertIsInstance(dups, Fasta)

        # The individual sample analyses should be grouped by sample name; in this case a, b, and c
        # In this test, each sample should have 4 analyses
        for expected_sample_name, sample in zip(('a', 'b', 'c'), sample_groups):
            self.assertEqual(4, len(sample))
            for analysis in sample:
                self.assertEqual(expected_sample_name, analysis.name)