]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/find_gaps
removed debug message
[biopieces.git] / bp_bin / find_gaps
index f885f82ff74a99d496230c2029e545441cdf73ba..ade831ad9c9e1d28060050bec35a850a8cb4572a 100755 (executable)
@@ -47,6 +47,8 @@ $out = Maasha::Biopieces::write_stream( $options->{ "stream_out" } );
 
 while ( $record = Maasha::Biopieces::get_record( $in ) )
 {
+    Maasha::Biopieces::put_record( $record, $out );
+
     if ( exists $record->{ 'SEQ' } )
     {
         $gaps = find_gaps( $record->{ 'SEQ' }, $options->{ 'min_len' } );
@@ -58,8 +60,6 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
             Maasha::Biopieces::put_record( $gap, $out ); 
         }
     }
-
-    Maasha::Biopieces::put_record( $record, $out );
 }
 
 Maasha::Biopieces::close_stream( $in );
@@ -83,11 +83,13 @@ sub find_gaps
 
     # Returns a list.
 
-    my ( @gaps, $block, $beg, $end );
+    my ( $gap_char, @gaps, $block, $beg, $end );
+
+    $gap_char = 'N';
 
     $seq = uc $seq;
 
-    $block = 'N' x $min;
+    $block = $gap_char x $min;
 
     $beg = 0;
 
@@ -99,7 +101,7 @@ sub find_gaps
 
         $end = $beg;
 
-        while ( substr( $seq, $end, 1 ) eq 'N' ) {
+        while ( substr( $seq, $end, 1 ) eq $gap_char ) {
             $end++;
         }