19/bushmen.pl


#!/usr/bin/perl -w

use strict;

my $infile = 'bushmen_chr7_all_snps.txt';
open(IN, $infile) or die "Could not open $infile\n";
while (<IN>) {
    my $line = $_;
    chomp;
    my @columns = split("\t");

    #  Columns used are 4 = reference
    #  6 = KB1; 8 = NB1; 14 = ABT
    #  Find instances where both reference and 
    #  ABT are different from KB1 and NB1

    if (
           ( $columns[3]  ne 'N' )
        && ( $columns[5]  ne 'N' )
        && ( $columns[7]  ne 'N' )
        && ( $columns[13] ne 'N' )

        && ( $columns[3]  ne $columns[5] )
        && ( $columns[3]  ne $columns[7] )
        && ( $columns[13] ne $columns[5] )
        && ( $columns[13] ne $columns[7] )
      )
    {
        print "$line";
    }
}
close IN;