Skip to content
Snippets Groups Projects
Commit f4ce1d99 authored by Magali Ruffier's avatar Magali Ruffier
Browse files

added a get_total method for snp density

when counting features, do not use strict lower/higher
parent f8579a78
No related branches found
No related tags found
No related merge requests found
......@@ -15,12 +15,21 @@ sub get_density {
my $sql = q{
SELECT count(*) FROM variation_feature
WHERE seq_region_id = ?
AND seq_region_start < ?
AND seq_region_end > ? };
AND seq_region_start <= ?
AND seq_region_end >= ? };
my @params = [$block->get_seq_region_id, $block->end, $block->start];
my $count = $helper->execute_single_result(-SQL => $sql, -PARAMS => @params);
return $count;
}
sub get_total {
my ($self, $option) = @_;
my $species = $self->param('species');
my $variation_adaptor = Bio::EnsEMBL::Registry->get_DBAdaptor($species, 'variation');
my $helper = $variation_adaptor->dbc()->sql_helper();
my $sql = "SELECT count(*) FROM variation_feature";
return $helper->execute_single_result(-SQL => $sql);
}
return 1;
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