]> git.donarmstrong.com Git - biopieces.git/commitdiff
updated rescan_seq
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 18 Aug 2009 09:59:12 +0000 (09:59 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 18 Aug 2009 09:59:12 +0000 (09:59 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@638 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/rescan_seq

index 22e0596480f8b654ab3b8e5f3edf41c057224227..0e431eeae95b759cf58dd3e0cfc788e6c2cc1e1f 100755 (executable)
@@ -37,7 +37,7 @@ use Maasha::Patscan;
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
-my ( $options, $in, $out, $record, $re_data, $re, $matches, $match, %re_hash, $res_enz );
+my ( $options, $in, $out, $record, $re_data, $re, $matches, $match, %re_hash, $res_enz, $new_record );
 
 $options = Maasha::Biopieces::parse_options(
     [
@@ -70,15 +70,15 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 
             $matches = Maasha::RestrictEnz::re_scan( $record->{ 'SEQ' }, $re );
 
-            if ( scalar @{ $matches } > 0 )
-            {
-                $record->{ $re->{ 'name' } . "_COUNT" }   = scalar @{ $matches };
-                $record->{ $re->{ 'name' } . "_MATCHES" } = join( ";", @{ $matches } ) if not $options->{ 'no_matches' };
-            }
+            $new_record->{ 'RE' }         = $re->{ 'name' };
+            $new_record->{ 'RE_COUNT' }   = scalar @{ $matches };
+            $new_record->{ 'RE_MATCHES' } = join( ";", @{ $matches } ) if not $options->{ 'no_matches' };
+
+            Maasha::Biopieces::put_record( $new_record, $out );
         }
     }
 
-    Maasha::Biopieces::put_record( $record, $out );
+    Maasha::Biopieces::put_record( $record, $out );
 }
 
 Maasha::Biopieces::close_stream( $in );