def test_group_in_filter_packets(self): items = list(range(10)) packets = list(group_in_filter_packets(items, 4)) res = [{FILTERED_OUT: [], PASSED: (0, 1, 2, 3)}, {FILTERED_OUT: [], PASSED: (4, 5, 6, 7)}, {FILTERED_OUT: [], PASSED: (8, 9)}] assert res == packets
def test_group_in_filter_packets(self): items = list(range(10)) packets = list(group_in_filter_packets(items, 4)) res = [{ FILTERED_OUT: [], PASSED: (0, 1, 2, 3) }, { FILTERED_OUT: [], PASSED: (4, 5, 6, 7) }, { FILTERED_OUT: [], PASSED: (8, 9) }] assert res == packets
def filter_vcf(vcf_fhand, filter_): snps = VCFReader(vcf_fhand, min_calls_for_pop_stats=1).parse_snvs() packet = list(group_in_filter_packets(snps, 10))[0] filtered_packet = filter_(packet) return filtered_packet