From: Tim Reddy Tim Date: Thu, 23 Apr 2009 22:33:28 +0000 (+0000) Subject: patched to handle new pf file format with generality to old format. X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=9b4ce769daadb41d19425f4caacfdd276633c89a patched to handle new pf file format with generality to old format. --- diff --git a/htswanalysis/scripts/count_bases.pm b/htswanalysis/scripts/count_bases.pm index a4f357d..9049b9c 100755 --- a/htswanalysis/scripts/count_bases.pm +++ b/htswanalysis/scripts/count_bases.pm @@ -8,22 +8,28 @@ my @a = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 my @c = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); my @g = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); my @t = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +my @n = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); $calls{'A'} = \@a; $calls{'C'} = \@c; $calls{'G'} = \@g; $calls{'T'} = \@t; +$calls{'N'} = \@t; my $count = 0; my $length; while( my $read = <>) { chomp $read; + my @a = split(/\s+/,$read); + $read = $a[0]; $length = length($read); $count++; for(0..$length-1) { my $base = uc(substr($read,$_,1)); - $calls{$base}[$_] += 1; + if($base eq 'A' || $base eq 'C' || $base eq 'G' || $base eq 'T' || $base eq 'N') { + $calls{$base}[$_] += 1; + } } }