diff --git a/modules/Bio/EnsEMBL/Pipeline/Production/SnpDensity.pm b/modules/Bio/EnsEMBL/Pipeline/Production/SnpDensity.pm
index 7e4325bbda3d30b56491d93bdcedd9ea10b732ad..92a18b61551efc7623e102cd782950ca4eff606f 100644
--- a/modules/Bio/EnsEMBL/Pipeline/Production/SnpDensity.pm
+++ b/modules/Bio/EnsEMBL/Pipeline/Production/SnpDensity.pm
@@ -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;