X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fread_fastq;h=eb926618efdeae2dff7bd5ddc50fab0fd1771b43;hb=b0b818d9a5cd88c597d99afbc102dfbbf8782f94;hp=df2ad6e088d786fa12bce015627d0ce89a3a250e;hpb=e6d927577f0e4b46ccd4f978f6c5dcbf334c25aa;p=biopieces.git diff --git a/bp_bin/read_fastq b/bp_bin/read_fastq index df2ad6e..eb92661 100755 --- a/bp_bin/read_fastq +++ b/bp_bin/read_fastq @@ -42,8 +42,9 @@ $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 => 'quality', short => 'q', type => 'uint', mandatory => 'no', default => 20, allowed => undef, disallowed => undef }, - { long => 'skip_scores', short => 's', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef }, + { 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 }, ] ); @@ -64,13 +65,8 @@ if ( $options->{ 'data_in' } ) { if ( $record = Maasha::Fastq::fastq2biopiece( $entry ) ) { - if ( not $options->{ 'skip_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_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 ); }