<commit_before>#!/usr/bin/env python
"""Print stats and sample call sites between two VCF files.

Usage:
    ./diff_vcfs.py caller1.vcf caller2.vcf
"""

import sys
import vcf
import random


# In PyVCF, a [] for FILTER means the filter was PASS.
# c.f. https://github.com/jamescasbon/PyVCF/issues/153
PASS = []


def call_key(call):
    return '%s:%s' % (call.CHROM, call.POS)


def is_ok(call):
    return call.FILTER == PASS or not call.FILTER


def main(args):
    assert len(args) == 2
    vcfs = [vcf.Reader(open(path)) for path in args]

    calls = [set([call_key(call) for call in reader if is_ok(call)])
             for reader in vcfs]

    a = calls[0]
    b = calls[1]
    r = random.Random()
    print '''Sources:
A: %s
B: %s
<commit_msg>Address ihodes review comments<commit_after>#!/usr/bin/env python
"""Print stats and sample call sites between two VCF files.

Usage:
    ./diff_vcfs.py caller1.vcf caller2.vcf
"""

import sys
import random

import vcf


# In PyVCF, a [] for FILTER means the filter was PASS.
# c.f. https://github.com/jamescasbon/PyVCF/issues/153
PASS = []


def call_key(call):
    return '%s:%s' % (call.CHROM, call.POS)


def is_ok(call):
    return call.FILTER == PASS or not call.FILTER


def main(args):
    assert len(args) == 2
    vcfs = [vcf.Reader(open(path)) for path in args]

    a, b = [{call_key(call) for call in reader if is_ok(call)}
            for reader in vcfs]

    r = random.Random()
    print '''Sources:
A: %s
B: %s

{'fraction_non_alphanumeric': 0.13725490196078433, 'fraction_numerical': 0.009465855307640297, 'mean_word_length': 3.0326975476839237, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4685695', 'n_tokens_mistral': 565, 'n_tokens_neox': 541, 'n_words': 168}