Commit 03d4a97c authored by Magali Ruffier's avatar Magali Ruffier
Browse files

method get_total adds an estimate of maximum number of features expected

parent cbfdda06
......@@ -14,5 +14,12 @@ sub get_density {
return $gc;
}
sub get_total {
my ($self) = @_;
my $species = $self->param('species');
my $slices = scalar(@{ Bio::EnsEMBL::Registry->get_adaptor($species, 'core', 'slice')->fetch_all('toplevel') });
return $slices*$self->param('bin_count')*100;
}
return 1;
......@@ -10,7 +10,7 @@ use warnings;
sub get_density {
my ($self, $block, $slice) = @_;
my ($self, $block) = @_;
my $repeat_count = 0;
my @repeats = @{ $block->get_all_RepeatFeatures() };
@repeats = map { $_->[1] } sort { $a->[0] <=> $b->[0] } map { [$_->start, $_] } @repeats;
......@@ -42,5 +42,12 @@ sub get_density {
return 100*$repeat_count/$block->length();
}
sub get_total {
my ($self) = @_;
my $species = $self->param('species');
my $slices = scalar(@{ Bio::EnsEMBL::Registry->get_adaptor($species, 'core', 'slice')->fetch_all('toplevel') });
return $slices*$self->param('bin_count')*100;
}
return 1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment