X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fmax_vals;h=f45b3cac2817941b55d79c9292e50cdde7d41016;hb=da9fc300ec207fce5d21e883781dab839b378fc7;hp=d25bee4d4c9ec6fe9ed3587fc8cf5a73885fbd2f;hpb=bcc615d3a5fa95dd8f5bf86a5e4aabf022879ac8;p=biopieces.git diff --git a/bp_bin/max_vals b/bp_bin/max_vals index d25bee4..f45b3ca 100755 --- a/bp_bin/max_vals +++ b/bp_bin/max_vals @@ -35,7 +35,7 @@ use Maasha::Calc; # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -my ( $options, $in, $out, $record, $key, $fh, %max_hash, $max_record ); +my ( $options, $in, $out, $record, $key, $fh, %max_hash, $new_record ); $options = Maasha::Biopieces::parse_options( [ @@ -74,20 +74,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" } } ) -{ - $max_record->{ $key . "_MAX" } = $max_hash{ $key }; +foreach $key ( @{ $options->{ "keys" } } ) { + $new_record->{ $key . "_MAX" } = $max_hash{ $key }; } -Maasha::Biopieces::put_record( $max_record, $fh ); +if ( $options->{ "keys" } and $new_record ) +{ + $new_record->{ 'REC_TYPE' } = "MAX"; + + Maasha::Biopieces::put_record( $new_record, $fh ); +} close $fh; -Maasha::Biopieces::close_stream( $in ); -Maasha::Biopieces::close_stream( $out ); - # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<