#!/usr/bin/python

import re

for line in open('bushmen_chr7_all_snps.txt'):
    line = line.rstrip()
    columns = re.split('\t', line)

    #  columns[3] = reference; columns[5] = KB1
    #  columns[7] = NB1,       columns[13] = ABT
    #  Find instances where both reference and
    #  ABT are different from KB1 and NB1

    if      columns[3] != 'N' and columns[5]  != 'N' \
	and columns[7] != 'N' and columns[13] != 'N' \
	and columns[3] != columns[5] \
        and columns[3]  != columns[7] and columns[13] != columns[5] \
        and columns[13] != columns[7]:

        print line