def test_fastq_to_alignment(self): for valid_files, kwargs, components in self.valid_configurations: for valid in valid_files: for observed_kwargs in kwargs: _drop_kwargs(observed_kwargs, 'seq_num') constructor = observed_kwargs.get('constructor', Sequence) # Can't use partials for this because the read # function below can't operate on partials expected_kwargs = {} if hasattr(constructor, 'lowercase'): expected_kwargs['lowercase'] = 'introns' observed_kwargs['lowercase'] = 'introns' expected = Alignment( [constructor( c[2], metadata={'id': c[0], 'description': c[1]}, positional_metadata={'quality': np.array(c[3], dtype=np.uint8)}, **expected_kwargs) for c in components]) observed = _fastq_to_alignment(valid, **observed_kwargs) self.assertEqual(observed, expected)
def test_fastq_to_alignment(self): for valid, kwargs, components in self.valid_files: for kwarg in kwargs: _drop_kwargs(kwarg, 'seq_num') constructor = kwarg.get('constructor', BiologicalSequence) expected = Alignment( [constructor(c[2], id=c[0], description=c[1], quality=c[3]) for c in components]) observed = _fastq_to_alignment(valid, **kwarg) # TODO remove when #656 is resolved self.assertEqual(observed, expected) for o, e in zip(observed, expected): self.assertTrue(o.equals(e))
def test_fastq_to_alignment(self): for valid, kwargs, components in self.valid_files: for kwarg in kwargs: _drop_kwargs(kwarg, 'seq_num') constructor = kwarg.get('constructor', BiologicalSequence) expected = Alignment([ constructor(c[2], id=c[0], description=c[1], quality=c[3]) for c in components ]) observed = _fastq_to_alignment(valid, **kwarg) # TODO remove when #656 is resolved self.assertEqual(observed, expected) for o, e in zip(observed, expected): self.assertTrue(o.equals(e))
def test_fastq_to_alignment(self): for valid_files, kwargs, components in self.valid_configurations: for valid in valid_files: for kwarg in kwargs: _drop_kwargs(kwarg, 'seq_num') constructor = kwarg.get('constructor', Sequence) expected = Alignment( [constructor( c[2], metadata={'id': c[0], 'description': c[1]}, positional_metadata={'quality': np.array(c[3], dtype=np.uint8)}) for c in components]) observed = _fastq_to_alignment(valid, **kwarg) self.assertEqual(observed, expected)