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

added a get_slices method specific to snp count

will get unique regions with variation_feature, stops it from counting snps twice on chromosome Y
parent ece81978
...@@ -22,6 +22,7 @@ sub get_feature_count { ...@@ -22,6 +22,7 @@ sub get_feature_count {
return $count; return $count;
} }
sub get_total { sub get_total {
my ($self) = @_; my ($self) = @_;
my $variation_adaptor = Bio::EnsEMBL::Registry->get_DBAdaptor($self->param('species'), 'variation'); my $variation_adaptor = Bio::EnsEMBL::Registry->get_DBAdaptor($self->param('species'), 'variation');
...@@ -33,6 +34,22 @@ sub get_total { ...@@ -33,6 +34,22 @@ sub get_total {
} }
sub get_slices {
my ($self, $species) = @_;
my @slices;
my $dba = Bio::EnsEMBL::Registry->get_DBAdaptor($species, 'variation');
my $sa = Bio::EnsEMBL::Registry->get_adaptor($species, 'core', 'slice');
my $helper = $dba->dbc()->sql_helper();
my $sql = q{
SELECT DISTINCT seq_region_id FROM variation_feature };
my @ids = @{ $helper->execute_simple(-SQL => $sql) };
foreach my $id(@ids) {
push @slices, $sa->fetch_by_seq_region_id($id);
}
return \@slices;
}
sub get_attrib_codes { sub get_attrib_codes {
my ($self) = @_; my ($self) = @_;
my $prod_dba = $self->get_production_DBAdaptor(); my $prod_dba = $self->get_production_DBAdaptor();
......
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