# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-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 },
{
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 );
}
}