From 87179b2134a6ef2702f9917a18a2ac69d3c5eb86 Mon Sep 17 00:00:00 2001 From: juguang <juguang@sanger.ac.uk> Date: Wed, 5 Nov 2003 12:54:40 +0000 Subject: [PATCH] add fetch_by_transcript_id --- modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm | 16 +++++++++++++++- modules/Bio/EnsEMBL/Utils/Converter.pm | 2 +- .../Utils/Converter/bio_ens_featurePair.pm | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm index d4bfb4bd61..bdd5e79467 100644 --- a/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm @@ -152,7 +152,21 @@ sub fetch_by_translation_stable_id { return undef; } } - +=head2 fetch_by_translation_id + +=cut + +sub fetch_by_translation_id { + my ($self, $transl_id) = @_; + my $sth = $self->prepare( + "SELECT transcript_id + FROM transcript + WHERE translation_id = ?"); + $sth->execute($transl_id); + my ($id) = $sth->fetchrow_array; + return $id? $self->fetch_by_dbID($id) : undef; +} + =head2 fetch_all_by_DBEntry Arg [1] : in $external_id diff --git a/modules/Bio/EnsEMBL/Utils/Converter.pm b/modules/Bio/EnsEMBL/Utils/Converter.pm index e17464b039..6ac9fe96f0 100644 --- a/modules/Bio/EnsEMBL/Utils/Converter.pm +++ b/modules/Bio/EnsEMBL/Utils/Converter.pm @@ -161,7 +161,7 @@ sub convert{ return \@output; } -sub _converter_single{ +sub _convert_single{ my ($self, $input) = @_; $self->throw("Not implemented. Please check the instance subclass"); } diff --git a/modules/Bio/EnsEMBL/Utils/Converter/bio_ens_featurePair.pm b/modules/Bio/EnsEMBL/Utils/Converter/bio_ens_featurePair.pm index ad424257e8..7b521a7be6 100644 --- a/modules/Bio/EnsEMBL/Utils/Converter/bio_ens_featurePair.pm +++ b/modules/Bio/EnsEMBL/Utils/Converter/bio_ens_featurePair.pm @@ -30,7 +30,7 @@ Bio::EnsEMBL::Utils::Converter::bio_ens_featurePair =head1 AUTHOR Juguang Xiao -Juguang Xiao <juguang@fugu-sg.org> +Juguang Xiao <juguang@tll.org.sg> =head1 APPENDIX -- GitLab