def test_iter_vrt_gzipped(self): reader = VCFReader(pkg_file('genomvar.test', 'data/example2.vcf.gz'), index=True) self.assertEqual(list(reader.chroms), ['chr23', 'chr24']) for vrt in reader.iter_vrt(): self.assertIn(vrt.chrom, ['chr24', 'chr23']) self.assertEqual(len(list(reader.find_vrt(chrom='chr24'))), 4) self.assertEqual(len(list(reader.find_vrt('chr23', 7464, 7465))), 3)
def test_check_getting_vrt_is_sorted(self): reader = VCFReader(pkg_file('genomvar.test', 'data/example_gnomad_2.vcf.gz'), index=True) starts = [v.start for v in reader.iter_vrt()] self.assertEqual(starts, sorted(starts)) starts2 = [ v.start for v in reader.find_vrt('chr15', 74719587, 74824401) ] self.assertEqual(starts2, sorted(starts2))