1#!/usr/bin/env perl
2#
3
4while (<STDIN>) {
5    if ($_ =~ /^#/) {
6        print;
7    } else {
8        $_ =~ /^(.+?)\t(.+?)\t(.+?)\t(.+?)\t(.+?)\t/;
9        $chrom = $1;
10        $pos = $2;
11        $tag = $3;
12        $ref = $4;
13        $alts = $5;
14        $hasnonsnp = 0;
15        $biallelic = 1;
16        if ($alts =~ /,/) {
17            $biallelic = 0;
18        }
19        @alts = split(/,/, $alts);
20        foreach $alt (@alts) {
21            if (!(length($alt)==1 && length($alt) == length($ref))) {
22                $hasnonsnp = 1;
23            }
24        }
25        if ($hasnonsnp || !$biallelic) {
26            print;
27        }
28    }
29}
30