X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fmin_vals;h=11410e3f68d7f726351544c04981e2996f8d7157;hb=5de6112b70b59420b245ce636a8b2e3c90acbe00;hp=1f73ed0fd46bbbfa80501c583dfbb7f609b7bab1;hpb=bcc615d3a5fa95dd8f5bf86a5e4aabf022879ac8;p=biopieces.git diff --git a/bp_bin/min_vals b/bp_bin/min_vals index 1f73ed0..11410e3 100755 --- a/bp_bin/min_vals +++ b/bp_bin/min_vals @@ -35,7 +35,7 @@ use Maasha::Calc; # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -my ( $options, $in, $out, $record, $key, $fh, %min_hash, $min_record ); +my ( $options, $in, $out, $record, $new_record, $key, $fh, %min_hash ); $options = Maasha::Biopieces::parse_options( [ @@ -73,20 +73,24 @@ while ( $record = Maasha::Biopieces::get_record( $in ) ) Maasha::Biopieces::put_record( $record, $out ) if not $options->{ "no_stream" }; } +Maasha::Biopieces::close_stream( $in ); +Maasha::Biopieces::close_stream( $out ); + $fh = Maasha::Biopieces::write_stream( $options->{ "data_out" } ); -foreach $key ( @{ $options->{ "keys" } } ) -{ - $min_record->{ $key . "_MIN" } = $min_hash{ $key }; +foreach $key ( @{ $options->{ "keys" } } ) { + $new_record->{ $key . "_MIN" } = $min_hash{ $key }; } -Maasha::Biopieces::put_record( $min_record, $fh ); +if ( $options->{ "keys" } and $new_record ) +{ + $new_record->{ 'REC_TYPE' } = "MIN"; + + Maasha::Biopieces::put_record( $new_record, $fh ); +} close $fh; -Maasha::Biopieces::close_stream( $in ); -Maasha::Biopieces::close_stream( $out ); - # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<