From: martinahansen Date: Tue, 24 Apr 2012 12:28:24 +0000 (+0000) Subject: added split of quality scores to split_seq X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d3691e42dfead189e6b8d0150c086e1f74678120;p=biopieces.git added split of quality scores to split_seq git-svn-id: http://biopieces.googlecode.com/svn/trunk@1810 74ccb610-7750-0410-82ae-013aeee3265d --- 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 );