]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/read_solexa
modified split_seq
[biopieces.git] / bp_bin / read_solexa
index c1b4f0ba1be06dbb945ceec512ee389ff7cef67b..f594d8079427432e644f1e2674cbe39461a20ca8 100755 (executable)
@@ -42,11 +42,11 @@ my ( $options, $in, $out, $record, $data_in, $num, $entry, @seqs, @scores, $i );
 
 $options = Maasha::Biopieces::parse_options(
     [
-        { long => 'data_in',      short => 'i', type => 'files!', mandatory => 'no', default => undef,   allowed => undef,           disallowed => undef },
-        { long => 'num',          short => 'n', type => 'uint',   mandatory => 'no', default => undef,   allowed => undef,           disallowed => '0' },
-        { long => 'format',       short => 'f', type => 'string', mandatory => 'no', default => 'octal', allowed => 'octal,decimal', disallowed => undef },
-        { long => 'quality',      short => 'q', type => 'uint',   mandatory => 'no', default => 20,      allowed => undef,           disallowed => undef },
-        { long => 'skip_quality', short => 's', type => 'flag',   mandatory => 'no', default => undef,   allowed => undef,           disallowed => undef },
+        { long => 'data_in',     short => 'i', type => 'files!', mandatory => 'no', default => undef,   allowed => undef, disallowed => undef },
+        { long => 'num',         short => 'n', type => 'uint',   mandatory => 'no', default => undef,   allowed => undef, disallowed => '0' },
+        { long => 'convert2dec', short => 'c', type => 'flag',   mandatory => 'no', default => undef,   allowed => undef, disallowed => undef },
+        { long => 'cutoff',      short => 'C', type => 'int',    mandatory => 'no', default => 20,      allowed => undef, disallowed => undef },
+        { long => 'soft_mask',   short => 's', type => 'flag',   mandatory => 'no', default => undef,   allowed => undef, disallowed => undef },
     ]   
 );
 
@@ -67,15 +67,8 @@ if ( $options->{ 'data_in' } )
     {
         if ( $record = Maasha::Fastq::fastq2biopiece( $entry ) )
         {
-            if ( not $options->{ 'skip_quality' } )
-            {
-                $record->{ 'SCORES' } =~ s/(\d+) ?/Maasha::Fastq::score2phred( $1 )/ge if $options->{ 'format' } eq 'decimal';
-                Maasha::Fastq::solexa2phred( $record->{ 'SCORES' } );
-                Maasha::Fastq::lowercase_low_scores( $record->{ 'SEQ' }, $record->{ 'SCORES' }, $options->{ 'quality' } );
-
-                $record->{ 'SCORES' }     =~ s/(.)/ord( $1 ) - 33 . ";"/ge; # http://maq.sourceforge.net/fastq.shtml
-                $record->{ 'SCORE_MEAN' } = sprintf( "%.2f", Maasha::Calc::mean( [ split /;/, $record->{ 'SCORES' } ] ) );
-            }
+            Maasha::Fastq::softmask_solexa_str( $record->{ 'SEQ' }, $record->{ 'SCORES' }, $options->{ 'cutoff' } ) if $options->{ 'soft_mask' };
+            $record->{ 'SCORES' } = Maasha::Fastq::solexa_str2dec_str( $record->{ 'SCORES' } ) if $options->{ 'convert2dec' };
 
             Maasha::Biopieces::put_record( $record, $out );
         }