X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Ffind_gaps;h=ade831ad9c9e1d28060050bec35a850a8cb4572a;hb=5de6112b70b59420b245ce636a8b2e3c90acbe00;hp=f885f82ff74a99d496230c2029e545441cdf73ba;hpb=5f2f9dd540ce9aacb7951661d15125d6795656d3;p=biopieces.git diff --git a/bp_bin/find_gaps b/bp_bin/find_gaps index f885f82..ade831a 100755 --- a/bp_bin/find_gaps +++ b/bp_bin/find_gaps @@ -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++; }