diff --git a/modules/Bio/EnsEMBL/Pipeline/Production/GeneCount.pm b/modules/Bio/EnsEMBL/Pipeline/Production/GeneCount.pm index 056988cce1ec7026359f6156824f786cf0a08c1d..a54cdc5e3ee1a0636c57eafbb37d576ef3daf665 100644 --- a/modules/Bio/EnsEMBL/Pipeline/Production/GeneCount.pm +++ b/modules/Bio/EnsEMBL/Pipeline/Production/GeneCount.pm @@ -18,6 +18,18 @@ sub get_attrib_codes { return %biotypes; } +sub get_alt_attrib_codes { + my ($self) = @_; + my @alt_attrib_codes = ('coding_acnt', 'pseudogene_acnt', 'noncoding_acnt'); + my %biotypes; + foreach my $alt_code (@alt_attrib_codes) { + my ($group) = $alt_code =~ /(\w+)\_acnt/; + my $biotypes = $self->get_biotype_group($group); + $biotypes{$alt_code} = $biotypes; + } + return %biotypes; +} + sub get_total { my ($self) = @_; my $species = $self->param('species'); @@ -26,6 +38,26 @@ sub get_total { } sub get_slices { + my ($self, $species) = @_; + my @slices; + my $dba = Bio::EnsEMBL::Registry->get_DBAdaptor($species, 'core'); + 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 gene + WHERE seq_region_id NOT IN + (SELECT seq_region_id + FROM seq_region_attrib sa, attrib_type at + WHERE at.attrib_type_id = sa.attrib_type_id + AND at.code= "non_ref") }; + my @ids = @{ $helper->execute_simple(-SQL => $sql) }; + foreach my $id(@ids) { + push @slices, $sa->fetch_by_seq_region_id($id); + } + return \@slices; +} + +sub get_all_slices { my ($self, $species) = @_; my @slices; my $dba = Bio::EnsEMBL::Registry->get_DBAdaptor($species, 'core');