]> git.donarmstrong.com Git - biopieces.git/commitdiff
testing unspecified features
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 2 May 2011 09:36:40 +0000 (09:36 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 2 May 2011 09:36:40 +0000 (09:36 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1350 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/analyze_gc
bp_bin/shuffle_seq

index 491112459f7f8829f45edd0cbc7f4ebdc6bcd6f2..66673ff3711386417deb54d1f8cbcc66b38cb84d 100755 (executable)
@@ -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 );
 }
index 165fbda967f8ac5a510e670ecf6192cb7d6a0c55..009a785e4d728e2fb83daef080ebac44836a6a21 100755 (executable)
@@ -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 );
 }