]> git.donarmstrong.com Git - samtools.git/blobdiff - bcftools/vcfutils.pl
* optionally drop phase ambiguous reads
[samtools.git] / bcftools / vcfutils.pl
index e38f1ca5ef660eca6aa223d4ab4cfbd359408a2f..6ced66a2893e9b98884774e88607e9f2060af3d1 100755 (executable)
@@ -246,6 +246,7 @@ Note: Some of the filters rely on annotations generated by SAMtools\/BCFtools.
          print; next;
        }
        next if ($t[4] eq '.'); # skip non-var sites
+    next if ($t[3] eq 'N'); # skip sites with unknown ref ('N')
        # check if the site is a SNP
        my $type = 1; # SNP
        if (length($t[3]) > 1) {
@@ -511,7 +512,7 @@ Options: -d INT    minimum depth          [$opts{d}]
          $q = chr($q <= 126? $q : 126);
          $seq .= $b;
          $qual .= $q;
-       } else { # an INDEL
+       } elsif ($t[4] ne '.') { # an INDEL
          push(@gaps, [$t[1], length($t[3])]);
        }
        $last_pos = $t[1];