diff --git a/modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm index 2bd86d466e792a60971f54ae7b5ffeab90106dd9..26924a7b7aa2a5d6a3690e75bfd543a0534d9ac1 100644 --- a/modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm @@ -785,7 +785,7 @@ sub fetch_all_by_external_name { used. Return type : listref of Bio::EnsEMBL::Gene - Exceptions : none + Exceptions : Throws of argument is not a GO term Caller : general Status : Stable @@ -794,6 +794,13 @@ sub fetch_all_by_external_name { sub fetch_all_by_GOTerm { my ( $self, $term ) = @_; + if ( !ref($term) + || !$term->isa('Bio::EnsEMBL::OntologyTerm') + || $term->ontology() ne 'GO' ) + { + throw('Argument is not a GO term'); + } + my $entryAdaptor = $self->db->get_DBEntryAdaptor(); my %unique_dbIDs; diff --git a/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm index 34f61b7ffaffd188000c039faaf18b86176159af..6d7057e25c236af062b23b3feb041303dc3303c5 100644 --- a/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm @@ -480,7 +480,7 @@ sub fetch_all_by_external_name { Transcript::transform method can be used. Return type : listref of Bio::EnsEMBL::Transcript - Exceptions : none + Exceptions : Throws of argument is not a GO term Caller : general Status : Stable @@ -489,6 +489,13 @@ sub fetch_all_by_external_name { sub fetch_all_by_GOTerm { my ( $self, $term ) = @_; + if ( !ref($term) + || !$term->isa('Bio::EnsEMBL::OntologyTerm') + || $term->ontology() ne 'GO' ) + { + throw('Argument is not a GO term'); + } + my $entryAdaptor = $self->db->get_DBEntryAdaptor(); my %unique_dbIDs; diff --git a/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm index 7c01f7e12c250b285b1d39cadb28dc39d78909ad..2e6293a3d17d04e41a8704241ba5e8fa717fc37b 100644 --- a/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm @@ -227,7 +227,7 @@ sub fetch_all_by_external_name { its descendent GO terms. Return type : listref of Bio::EnsEMBL::Translation - Exceptions : none + Exceptions : Throws of argument is not a GO term Caller : general Status : Stable @@ -236,6 +236,13 @@ sub fetch_all_by_external_name { sub fetch_all_by_GOTerm { my ( $self, $term ) = @_; + if ( !ref($term) + || !$term->isa('Bio::EnsEMBL::OntologyTerm') + || $term->ontology() ne 'GO' ) + { + throw('Argument is not a GO term'); + } + my $entryAdaptor = $self->db->get_DBEntryAdaptor(); my %unique_dbIDs;