Solução de Perl:
#!/usr/bin/perl
use warnings;
use strict;
use feature qw{ say };
my %values;
while (<>) {
next if /^$/; # Skip empty lines
my ($lane, $sample, $var, $val) = split;
die "Duplicate $lane $sample $var\n" if $values{$lane}{$var}{$val}{$sample};
$values{$lane}{$var}{$val}{$sample} = 1;
}
my %results;
for my $lane (keys %values) {
for my $var (keys %{ $values{$lane} }) {
my $count = keys %{ $values{$lane}{$var} };
if (1 == $count) {
++$results{$lane}{consistent};
} else {
++$results{$lane}{inconsistent};
}
}
say join "\t", $lane, @{ $results{$lane} }{qw{ consistent inconsistent }};
}