]> git.donarmstrong.com Git - samtools.git/commitdiff
* removed a comment line in kaln.c
authorHeng Li <lh3@live.co.uk>
Tue, 5 Oct 2010 18:05:18 +0000 (18:05 +0000)
committerHeng Li <lh3@live.co.uk>
Tue, 5 Oct 2010 18:05:18 +0000 (18:05 +0000)
 * vcfutils.pl fillac works when GT is not the first field

bcftools/vcfutils.pl
kaln.c

index 371e8d84181dd5bc55aa5cfa0777ae7535ff4f69..cdb96cb53ee287fbbc3b541baa50c7778ec176bb 100755 (executable)
@@ -70,12 +70,21 @@ sub fillac {
          print;
        } else {
          my @t = split;
-         my @c;
+         my @c = (0);
          my $n = 0;
-         $c[1] = 0;
+         my $s = -1;
+         @_ = split(":", $t[8]);
+         for (0 .. $#_) {
+               if ($_[$_] eq 'GT') { $s = $_; last; }
+         }
+         if ($s < 0) {
+               print join("\t", @t), "\n";
+               next;
+         }
          for (9 .. $#t) {
-               if ($t[$_] =~ /^(\d+).(\d+)/) {
-                 ++$c[$1]; ++$c[$2];
+               if ($t[$_] =~ /^0,0,0/) {
+               } elsif ($t[$_] =~ /^([^\s:]+:){$s}(\d+).(\d+)/) {
+                 ++$c[$2]; ++$c[$3];
                  $n += 2;
                }
          }
diff --git a/kaln.c b/kaln.c
index 3aca09cc9a484528610d3db03c1d26b934e7d039..331fbb0aba6b803f4163e6d1acec46a31f6ec99d 100644 (file)
--- a/kaln.c
+++ b/kaln.c
@@ -392,7 +392,6 @@ ka_probpar_t ka_probpar_def = { 0.001, 0.1, 10 };
                 \      \/        \/      \/      /
                  \     /\        /\      /\     /
                        -> D[k-1] -> D[k] ->
-                          \/        \/
 
    M[0] points to every {M,I}[k] and every {M,I}[k] points M[L+1].