# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-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(
[
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' } = "MIN";
+
+ Maasha::Biopieces::put_record( $new_record, $fh );
+}
close $fh;
-Maasha::Biopieces::close_stream( $in );
-Maasha::Biopieces::close_stream( $out );
-
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<