# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-my ( $options, $in, $out, $record, $new_record, $i, $step, $subseq );
+my ( $options, $in, $out, $record, $new_record, $i, $step, $subseq, $subqual );
$options = Maasha::Biopieces::parse_options(
[
{
for ( $i = 0; $i < length( $record->{ "SEQ" } ) - $options->{ "word_size" } + 1; $i += $step )
{
- $subseq = substr $record->{ "SEQ" }, $i, $options->{ "word_size" };
+ $subseq = substr $record->{ "SEQ" }, $i, $options->{ "word_size" };
+ $subqual = substr $record->{ "SCORES" }, $i, $options->{ "word_size" } if $record->{ "SCORES" };
$new_record->{ "SEQ_NAME" } = $record->{ "SEQ_NAME" } . "[" . ( $i + 1 ) . "-" . ( $i + $options->{ "word_size" } ) . "]";
$new_record->{ "SEQ" } = $subseq;
+ $new_record->{ "SCORES" } = $subqual if $record->{ "SCORES" };
$new_record->{ "SEQ_LEN" } = $options->{ "word_size" };
Maasha::Biopieces::put_record( $new_record, $out );