Ejemplo n.º 1
0
    def test_sequence_collection_to_fastq_kwargs_passed(self):
        for components, kwargs_expected_fp in self.valid_files:
            for kwargs, expected_fp in kwargs_expected_fp:
                obj = SequenceCollection([
                    NucleotideSequence(c[2], id=c[0], description=c[1],
                                       quality=c[3]) for c in components])

                fh = StringIO()
                _sequence_collection_to_fastq(obj, fh, **kwargs)
                observed = fh.getvalue()
                fh.close()

                with open(expected_fp, 'U') as f:
                    expected = f.read()

                self.assertEqual(observed, expected)
Ejemplo n.º 2
0
    def test_sequence_collection_to_fastq_kwargs_passed(self):
        for components, kwargs_expected_fp in self.valid_files:
            for kwargs, expected_fp in kwargs_expected_fp:
                obj = SequenceCollection([
                    DNA(c[2], metadata={'id': c[0], 'description': c[1]},
                        positional_metadata={'quality': c[3]})
                    for c in components])

                fh = StringIO()
                _sequence_collection_to_fastq(obj, fh, **kwargs)
                observed = fh.getvalue()
                fh.close()

                with open(expected_fp, 'U') as f:
                    expected = f.read()

                self.assertEqual(observed, expected)
Ejemplo n.º 3
0
    def test_sequence_collection_to_fastq_kwargs_passed(self):
        for components, kwargs_expected_fp in self.valid_files:
            for kwargs, expected_fp in kwargs_expected_fp:
                obj = SequenceCollection([
                    NucleotideSequence(c[2],
                                       id=c[0],
                                       description=c[1],
                                       quality=c[3]) for c in components
                ])

                fh = StringIO()
                _sequence_collection_to_fastq(obj, fh, **kwargs)
                observed = fh.getvalue()
                fh.close()

                with open(expected_fp, 'U') as f:
                    expected = f.read()

                self.assertEqual(observed, expected)
Ejemplo n.º 4
0
    def test_sequence_collection_to_fastq_kwargs_passed(self):
        for components, kwargs_expected_fp in self.valid_files:
            for kwargs, expected_fp in kwargs_expected_fp:
                obj = SequenceCollection([
                    DNA(c[2], metadata={'id': c[0], 'description': c[1]},
                        positional_metadata={'quality': c[3]},
                        lowercase='introns')
                    for c in components])

                fh = StringIO()
                kwargs['lowercase'] = 'introns'
                _sequence_collection_to_fastq(obj, fh, **kwargs)
                observed = fh.getvalue()
                fh.close()

                with open(expected_fp, 'U') as f:
                    expected = f.read()

                self.assertEqual(observed, expected)