# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-my ( $options, $in, $out, $record, $key, %median_hash, $median, $fh );
+my ( $options, $in, $out, $record, $new_record, $key, %median_hash, $median, $fh );
$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" } } )
$median = "N/A";
}
- Maasha::Biopieces::put_record( { $key . "_MEDIAN" => $median } , $fh );
+ $new_record->{ $key . "_MEDIAN" } = $mean
}
-close $fh;
+if ( $options->{ "keys" } )
+{
+ $new_record->{ 'REC_TYPE' } = "MEDIAN";
-Maasha::Biopieces::close_stream( $in );
-Maasha::Biopieces::close_stream( $out );
+ Maasha::Biopieces::put_record( $new_record, $fh );
+}
+
+close $fh;
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
--- /dev/null
+#!/bin/bash
+
+source "$BP_DIR/bp_test/lib/test.sh"
+
+run "$bp -I $in -k V1,V2 -o $tmp -x"
+assert_no_diff $tmp $out.1
+clean
+
+run "$bp -I $in -l V3 -O $tmp"
+assert_no_diff $tmp $out.2
+clean