X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=bp_bin%2Fsplit_seq;h=790aa7cc3c7e32fb1fa86f2339bc534b8c062f2a;hb=b75be26637f894573f1dbf5ebe31c5d651a4bb83;hp=f6dbb16b96e11e16afca55a48386bc0aa1e49646;hpb=b0b818d9a5cd88c597d99afbc102dfbbf8782f94;p=biopieces.git diff --git a/bp_bin/split_seq b/bp_bin/split_seq index f6dbb16..790aa7c 100755 --- a/bp_bin/split_seq +++ b/bp_bin/split_seq @@ -34,7 +34,7 @@ use Maasha::Biopieces; # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -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( [ @@ -58,10 +58,12 @@ while ( $record = Maasha::Biopieces::get_record( $in ) ) { 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 );