comp = seq.composition
comp.each_pair do |key,val|
- record["RES[#{key}]".to_sym] = val
+ record["RES_#{key}"] = val
end
- record["HARD_MASK%".to_sym] = seq.hard_mask
- record["SOFT_MASK%".to_sym] = seq.soft_mask
- record["GC%".to_sym] = ((comp["G"] + comp["C"]).to_f / (seq.len - seq.indels).to_f * 100.0).round(2)
+ record["HARD_MASK"] = seq.hard_mask
+ record["SOFT_MASK"] = seq.soft_mask
+ record["GC"] = ((comp["G"] + comp["C"]).to_f / (seq.len - seq.indels).to_f * 100.0).round(2)
end
bp.puts record
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-my ( $options, $in, $out, $record, $key, %sum_hash, %count_hash, $mean, $fh );
+my ( $options, $in, $out, $record, $new_record, $key, %sum_hash, %count_hash, $mean, $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" } } )
$mean = "N/A";
}
- Maasha::Biopieces::put_record( { $key . "_MEAN" => $mean } , $fh );
+ $new_record->{ $key . "_MEAN" } = $mean
}
-close $fh;
+if ( $options->{ "keys" } )
+{
+ $new_record->{ 'REC_TYPE' } = "MEAN";
-Maasha::Biopieces::close_stream( $in );
-Maasha::Biopieces::close_stream( $out );
+ Maasha::Biopieces::put_record( $new_record, $fh );
+}
+
+close $fh;
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
while ( $record = Maasha::Biopieces::get_record( $in ) )
{
- $record->{ "SEQ" } = reverse $record->{ "SEQ" } if $record->{ "SEQ" };
+ $record->{ "SEQ" } = reverse $record->{ "SEQ" } if $record->{ "SEQ" };
+ $record->{ "SCORES" } = reverse $record->{ "SCORES" } if $record->{ "SCORES" };
Maasha::Biopieces::put_record( $record, $out );
}