diff --git a/modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm index db37ea2bb39e87575b9c4fc8e138c51ac7edcb99..1db28f6a0a0ad3c17eb83c631caae397c605e4d5 100644 --- a/modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm @@ -300,6 +300,26 @@ sub source_constraint { return $constraint; } +=head2 count_all_by_source + + Arg [1] : String $source + listref of $source + The source of the gene to retrieve. You can have as an argument a reference + to a list of sources + Example : $cnt = $gene_adaptor->count_all_by_source('ensembl'); + $cnt = $gene_adaptor->count_all_by_source(['havana', 'vega']); + Description : Retrieves count of gene objects from the database via its source or sources. + Returntype : integer + Caller : general + Status : Stable + +=cut + +sub count_all_by_source { + my ($self, $source) = @_; + return $self->generic_count($self->source_constraint($source)); +} + =head2 fetch_all_by_biotype Arg [1] : String $biotype diff --git a/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm index bae3c39fcabcc0b5f2edcbb118963200d27af748..af5ffb7e2d614d71728fea2cbce91e5755eaaafa 100644 --- a/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm @@ -755,6 +755,26 @@ sub source_constraint { return $constraint; } +=head2 count_all_by_source + + Arg [1] : String $source + listref of $source + The source of the transcript to retrieve. You can have as an argument a reference + to a list of sources + Example : $cnt = $transcript_adaptor->count_all_by_source('ensembl'); + $cnt = $transcript_adaptor->count_all_by_source(['havana', 'vega']); + Description : Retrieves count of transcript objects from the database via its source or sources. + Returntype : integer + Caller : general + Status : Stable + +=cut + +sub count_all_by_source { + my ($self, $source) = @_; + return $self->generic_count($self->source_constraint($source)); +} + =head2 fetch_all_by_biotype Arg [1] : String $biotype