]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/read_fastq
added usearch_seq biopiece
[biopieces.git] / bp_bin / read_fastq
index ce1db6d69ac2d277d988474c347930f4c8726fbf..eb926618efdeae2dff7bd5ddc50fab0fd1771b43 100755 (executable)
@@ -40,8 +40,11 @@ my ( $options, $in, $out, $record, $data_in, $num, $entry );
 
 $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 => '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 },
     ]   
 );
 
@@ -60,7 +63,11 @@ if ( $options->{ 'data_in' } )
 
     while ( $entry = Maasha::Fastq::get_entry( $data_in ) ) 
     {
-        if ( $record = Maasha::Fastq::fastq2biopiece( $entry ) ) {
+        if ( $record = Maasha::Fastq::fastq2biopiece( $entry ) )
+        {
+            Maasha::Fastq::softmask_phred_str( $record->{ 'SEQ' }, $record->{ 'SCORES' }, $options->{ 'cutoff' } ) if $options->{ 'soft_mask' };
+            $record->{ 'SCORES' } = Maasha::Fastq::phred_str2dec_str( $record->{ 'SCORES' } ) if $options->{ 'convert2dec' };
+
             Maasha::Biopieces::put_record( $record, $out );
         }