# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-my ( $options, $in, $out, $record, $analysis, $key, $len, %skip_hash,
+my ( $options, $in, $out, $record, $analysis, $key, $len, %skip_hash, $data_out,
%key_hash, $skip, $keys, $types, $counts, $mins, $maxs, $sums, $means );
$options = Maasha::Biopieces::parse_options(
[
{ long => 'no_stream', short => 'x', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
+ { long => 'data_out', short => 'o', type => 'file', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
{ long => 'keys', short => 'k', type => 'list', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
{ long => 'no_keys', short => 'K', type => 'list', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
]
$in = Maasha::Biopieces::read_stream( $options->{ "stream_in" } );
$out = Maasha::Biopieces::write_stream( $options->{ "stream_out" } );
+$data_out = Maasha::Biopieces::write_stream( $options->{ "data_out" }, $options->{ "compress" } );
+$data_out ||= \*STDOUT;
+
map { $skip_hash{ $_ } = 1 } @{ $options->{ "no_keys" } };
map { $key_hash{ $_ } = 1; $skip = 1 } @{ $options->{ "keys" } };
$means .= sprintf "% 15s", $analysis->{ $key }->{ "MEAN" };
}
-print "$keys\n";
-print "$types\n";
-print "$counts\n";
-print "$mins\n";
-print "$maxs\n";
-print "$sums\n";
-print "$means\n";
+print $data_out "$keys\n";
+print $data_out "$types\n";
+print $data_out "$counts\n";
+print $data_out "$mins\n";
+print $data_out "$maxs\n";
+print $data_out "$sums\n";
+print $data_out "$means\n";
+
+close $data_out;
Maasha::Biopieces::close_stream( $in );
Maasha::Biopieces::close_stream( $out );