diff --git a/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm index 546d89e71542b8a5d6257735b499c72dec45a237..c1c97b945e79dc8679c3a75388d1d7fb608b9017 100644 --- a/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm @@ -103,6 +103,35 @@ sub fetch_by_dbID { return $out; } +=head2 fetch_all_by_DBEntry + + Arg [1] : in $external_id + the external identifier for the translation to be obtained + Example : @trans = @{$trans_adaptor->fetch_all_by_DBEntry($ext_id)} + Description: retrieves a list of translation with an external database + idenitifier $external_id + Returntype : listref of Bio::EnsEMBL::DBSQL::Translation in contig coordinates + Exceptions : none + Caller : ? + +=cut + +sub fetch_all_by_DBEntry { + my $self = shift; + my $external_id = shift; + my @trans = (); + + my $entryAdaptor = $self->db->get_DBEntryAdaptor(); + my @ids = $entryAdaptor->translationids_by_extids($external_id); + foreach my $trans_id ( @ids ) { + my $trans = $self->fetch_by_dbID( $trans_id ); + warn $trans_id; + if( $trans ) { + push( @trans, $trans ); + } + } + return \@trans; +} sub store { @@ -198,35 +227,4 @@ sub remove { $translation->dbID( undef ); #don't think this line works } -=head2 fetch_all_by_DBEntry - - Arg [1] : in $external_id - the external identifier for the translation to be obtained - Example : @trans = @{$trans_adaptor->fetch_all_by_DBEntry($ext_id)} - Description: retrieves a list of translation with an external database - idenitifier $external_id - Returntype : listref of Bio::EnsEMBL::DBSQL::Translation in contig coordinates - Exceptions : none - Caller : ? - -=cut - -sub fetch_all_by_DBEntry { - my $self = shift; - my $external_id = shift; - my @trans = (); - - my $entryAdaptor = $self->db->get_DBEntryAdaptor(); - my @ids = $entryAdaptor->translationids_by_extids($external_id); - foreach my $trans_id ( @ids ) { - my $trans = $self->fetch_by_dbID( $trans_id ); - warn $trans_id; - if( $trans ) { - push( @trans, $trans ); - } - } - return \@trans; -} - - 1;