]> git.donarmstrong.com Git - biopieces.git/commitdiff
polished plot_scores
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 13 Oct 2010 08:28:36 +0000 (08:28 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 13 Oct 2010 08:28:36 +0000 (08:28 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1122 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/plot_scores

index bfe87ccacd6fba8da2f24436665ca4d7382d4b75..5ef16b409b7734e424ebf93a9dbb4bc831b5970d 100755 (executable)
@@ -37,17 +37,15 @@ use Maasha::Calc;
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
-my ( $options, $in, $out, $default, $terminals, $formats, $record, %count_hash, %sum_hash, $i, @scores, @data_list, $result, $fh, $tmp_dir );
+my ( $options, $in, $out, $default, $terminals, $record, %count_hash, %sum_hash, $i, @scores, @data_list, $result, $fh, $tmp_dir );
 
 $default   = "Quality Scores";
 $terminals = "dumb,x11,aqua,post,svg";
-$formats   = "solexa,phred,decimal";
 
 $options = Maasha::Biopieces::parse_options(
     [
         { long => 'no_stream',  short => 'x', type => 'flag',   mandatory => 'no',  default => undef,    allowed => undef,      disallowed => undef },
         { long => 'data_out',   short => 'o', type => 'file',   mandatory => 'no',  default => undef,    allowed => undef,      disallowed => undef },
-        { long => 'format'  ,   short => 'f', type => 'string', mandatory => 'no',  default => "solexa", allowed => $formats,   disallowed => undef },
         { long => 'terminal',   short => 't', type => 'string', mandatory => 'no',  default => 'dumb',   allowed => $terminals, disallowed => undef },
         { long => 'title',      short => 'T', type => 'string', mandatory => 'no',  default => $default, allowed => undef,      disallowed => undef },
         { long => 'xlabel',     short => 'X', type => 'string', mandatory => 'no',  default => undef,    allowed => undef,      disallowed => undef },
@@ -62,31 +60,10 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 {
     if ( $record->{ 'SCORES' } )
     {
-        if ( $options->{ 'format' } eq "solexa" )
+        for ( $i = 0; $i < length $record->{ 'SCORES' }; $i++ )
         {
-            for ( $i = 0; $i < length $record->{ 'SCORES' }; $i++ )
-            {
-                $count_hash{ $i }++;
-                $sum_hash{ $i } += Maasha::Fastq::solexa2dec( substr $record->{ "SCORES" }, $i, 1 );
-            }
-        }
-        elsif ( $options->{ 'format' } eq "phred" )
-        {
-            for ( $i = 0; $i < length $record->{ 'SCORES' }; $i++ )
-            {
-                $count_hash{ $i }++;
-                $sum_hash{ $i } += Maasha::Fastq::phred2dec( substr $record->{ "SCORES" }, $i, 1 );
-            }
-        }
-        else
-        {
-            @scores = split ";", $record->{ 'SCORES' };
-
-            for ( $i = 0; $i < @scores; $i++ )
-            {
-                $count_hash{ $i }++;
-                $sum_hash{ $i } += $scores[ $i ];
-            }
+            $count_hash{ $i }++;
+            $sum_hash{ $i } += Maasha::Fastq::solexa2dec( substr $record->{ "SCORES" }, $i, 1 );
         }
     }