From 76ffb4cf9fffa59d19e89ffb81ace29a5765fe63 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 2 May 2011 09:36:40 +0000 Subject: [PATCH] testing unspecified features git-svn-id: http://biopieces.googlecode.com/svn/trunk@1350 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/analyze_gc | 10 ++++++++-- bp_bin/shuffle_seq | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bp_bin/analyze_gc b/bp_bin/analyze_gc index 4911124..66673ff 100755 --- a/bp_bin/analyze_gc +++ b/bp_bin/analyze_gc @@ -36,7 +36,7 @@ use Maasha::Biopieces; # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -my ( $options, $in, $out, $record, $gc ); +my ( $options, $in, $out, $record, $gc_count, $gc_percent ); $options = Maasha::Biopieces::parse_options(); @@ -45,7 +45,13 @@ $out = Maasha::Biopieces::write_stream( $options->{ "stream_out" } ); while ( $record = Maasha::Biopieces::get_record( $in ) ) { - $record->{ 'GC%' } = sprintf( "%.2f", ( $record->{ "SEQ" } =~ tr/GgCc// / length $record->{ "SEQ" } ) * 100 ) if $record->{ "SEQ" }; + if ( $record->{ "SEQ" } ) + { + $gc_count = $record->{ "SEQ" } =~ tr/GgCc//; + $gc_percent = ( $gc_count / length $record->{ "SEQ" } ) * 100; + $record->{ 'GC%' } = sprintf( "%.2f", $gc_pecent ); +# $record->{ 'GC%' } = int $gc_percent; + } Maasha::Biopieces::put_record( $record, $out ); } diff --git a/bp_bin/shuffle_seq b/bp_bin/shuffle_seq index 165fbda..009a785 100755 --- a/bp_bin/shuffle_seq +++ b/bp_bin/shuffle_seq @@ -44,7 +44,8 @@ $out = Maasha::Biopieces::write_stream( $options->{ "stream_out" } ); while ( $record = Maasha::Biopieces::get_record( $in ) ) { - $record->{ "SEQ" } = Maasha::Seq::seq_shuffle( $record->{ "SEQ" } ) if $record->{ "SEQ" }; + $record->{ "SEQ" } = Maasha::Seq::seq_shuffle( $record->{ "SEQ" } ) if $record->{ "SEQ" }; + # $record->{ "SCORES" } = Maasha::Seq::seq_shuffle( $record->{ "SCORES" } ) if $record->{ "SCORES" }; # Hackery thing Maasha::Biopieces::put_record( $record, $out ); } -- 2.39.2