Commit b7e07b27 authored by Magali Ruffier's avatar Magali Ruffier
Browse files

added method get_total to give an estimate of the total number of features expected

parent f952b675
......@@ -7,16 +7,30 @@ use strict;
use warnings;
sub get_density {
my ($self, $block) = @_;
sub get_option {
my ($self) = @_;
my @biotypes = $self->get_biotype_group("coding");
return \@biotypes;
}
sub get_density {
my ($self, $block, $biotypes) = @_;
my $count = 0;
foreach my $biotype (@biotypes) {
foreach my $biotype (@$biotypes) {
$count += scalar(@{ $block->get_all_Genes_by_type($biotype) });
}
return $count;
}
sub get_total {
my ($self, $option) = @_;
my $species = $self->param('species');
my $ga = Bio::EnsEMBL::Registry->get_adaptor($species, 'core', 'gene');
return scalar(@{ $ga->fetch_all_by_biotype($option) });
}
1;
......@@ -7,16 +7,28 @@ use strict;
use warnings;
sub get_option {
my ($self) = @_;
my @biotypes = $self->get_biotype_group("noncoding");
return \@biotypes;
}
sub get_density {
my ($self, $block) = @_;
my @biotypes = $self->get_biotype_group("non-coding");
my ($self, $block, $biotypes) = @_;
my $count = 0;
foreach my $biotype (@biotypes) {
foreach my $biotype (@$biotypes) {
$count += scalar(@{ $block->get_all_Genes_by_type($biotype) });
}
return $count;
}
sub get_total {
my ($self, $option) = @_;
my $species = $self->param('species');
my $ga = Bio::EnsEMBL::Registry->get_adaptor($species, 'core', 'gene');
return scalar(@{ $ga->fetch_all_by_biotype($option) });
}
1;
......@@ -7,16 +7,29 @@ use strict;
use warnings;
sub get_density {
my ($self, $block) = @_;
sub get_option {
my ($self) = @_;
my @biotypes = $self->get_biotype_group("pseudogene");
return \@biotypes;
}
sub get_density {
my ($self, $block, $biotypes) = @_;
my $count = 0;
foreach my $biotype (@biotypes) {
foreach my $biotype (@$biotypes) {
$count += scalar(@{ $block->get_all_Genes_by_type($biotype) });
}
return $count;
}
sub get_total {
my ($self, $option) = @_;
my $species = $self->param('species');
my $ga = Bio::EnsEMBL::Registry->get_adaptor($species, 'core', 'gene');
return scalar(@{ $ga->fetch_all_by_biotype($option) });
}
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