From ca68357545d137b495a5360199ce5c7ae49b1b17 Mon Sep 17 00:00:00 2001 From: Monika Komorowska <mk8@sanger.ac.uk> Date: Wed, 11 Apr 2012 17:15:18 +0000 Subject: [PATCH] store density features in batch --- misc-scripts/density_feature/percent_gc_calc.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/misc-scripts/density_feature/percent_gc_calc.pl b/misc-scripts/density_feature/percent_gc_calc.pl index 148a125225..7458fa66ed 100644 --- a/misc-scripts/density_feature/percent_gc_calc.pl +++ b/misc-scripts/density_feature/percent_gc_calc.pl @@ -136,6 +136,8 @@ my ( $current_start, $current_end, $current ); my $slice_count = 0; my $block_size; +my $total_count; + while ( my $slice = shift @sorted_slices ){ $block_size = $slice->length() / $bin_count; @@ -172,14 +174,20 @@ while ( my $slice = shift @sorted_slices ){ -end => $current_end, -density_type => $density_type, -density_value => $gc); - #print join ("\t", $slice, $current_start, $current_end, $density_type, $gc, "\n"); - $dfa->store($df); + push(@density_features, $df); + if ($gc > 0) { + #density features with value = 0 are not stored + $total_count++; + } } + $dfa->store(@density_features); + last if ( $slice_count++ > $max_slices ); } +print STDOUT "Created $total_count percent gc density features\n"; # -- GitLab