LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2024] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

CONTACT

Please email comments or questions to the public Ensembl
developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.

Questions may also be sent to the Ensembl help desk at
<http://www.ensembl.org/Help/Contact>.

NAME

Bio::EnsEMBL::DBSQL::TranslationAdaptor - Provides a means to fetch and store Translation objects from a database.

DESCRIPTION

This adaptor provides a means to retrieve and store Bio::EnsEMBL::Translation objects from/in a database.

Translation objects only truly make sense in the context of their transcripts so the recommended means to retrieve Translations is by retrieving the Transcript object first, and then fetching the Translation.

SYNOPSIS

use Bio::EnsEMBL::Registry;

Bio::EnsEMBL::Registry->load_registry_from_db(
  -host => 'ensembldb.ensembl.org',
  -user => 'anonymous'
);

$transcript_adaptor =
  Bio::EnsEMBL::Registry->get_adaptor( "human", "core",
  "transcript" );

$translation_adaptor =
  Bio::EnsEMBL::Registry->get_adaptor( "human", "core",
  "translation" );

my $transcript = $transcript_adaptor->fetch_by_dbID(131243);
my $translation =
  $translation_adaptor->fetch_by_Transcript($transcript);

print("Translation Start Site: "
    . $translation->start_Exon()->stable_id() . " "
    . $translation->start()
    . "\n" );
print("Translation Stop: "
    . $translation->end_Exon()->stable_id() . " "
    . $translation->end() );

METHODS

fetch_all_alternative_by_Transcript

Arg [1]    : Bio::EnsEMBL::Transcript $transcript
Example    :

  @tl = @{
    $translation_adaptor->fetch_all_alternative_by_Transcript(
                                                          $transcript)
    };

Description: Retrieves all alternative translations associated with a
             particular transcript.  If no alternative translation is
             found, a reference to an empty list is returned.

Returntype : listref of Bio::EnsEMBL::Translation
Exceptions : throw on incorrect argument
Caller     : Transcript
Status     : Stable

fetch_by_Transcript

Arg [1]    : Bio::EnsEMBL::Transcript $transcript
Example    : $tl = $translation_adaptor->fetch_by_Transcript($transcript);
Description: Retrieves a Translation via its associated transcript.
             If the Translation is not found, undef is returned.
Returntype : Bio::EnsEMBL::Translation
Exceptions : throw on incorrect argument
Caller     : Transcript
Status     : Stable

fetch_all_by_external_name

Arg [1]    : string $external_name
             The external identifier for the translation(s) to be
             obtained.
Arg [2]    : (optional) string $external_db_name
             The name of the external database from which the
             identifier originates.
Arg [3]    : Boolean override. Force SQL regex matching for users
             who really do want to find all 'NM%'
Example    : my @translations =
                @{ $trl_adaptor->fetch_all_by_external_name('BRCA2') };
             my @many_translations = 
                @{ $trl_adaptor->fetch_all_by_external_name('BRCA%') };
Description: Retrieves a list of translations fetched via an
             external identifier.  Note that this may not be a
             particularly useful method, because translations
             do not make much sense out of the context of
             their transcript.  It may be better to use the
             TranscriptAdaptor::fetch_all_by_external_name instead.
             SQL wildcards % and _ are supported in the $external_name
             but their use is somewhat restricted for performance reasons.
             Users that really do want % and _ in the first three characters
             should use argument 3 to prevent optimisations
Returntype : reference to a list of Translations
Exceptions : none
Caller     : general
Status     : Medium Risk

fetch_all_by_GOTerm

Arg [1]   : Bio::EnsEMBL::OntologyTerm
            The GO term for which translations should be fetched.

Example:  @translations = @{
            $translation_adaptor->fetch_all_by_GOTerm(
              $go_adaptor->fetch_by_accession('GO:0030326') ) };

Description   : Retrieves a list of translations that are
                associated with the given GO term, or with any of
                its descendent GO terms.

Return type   : listref of Bio::EnsEMBL::Translation
Exceptions    : Throws of argument is not a GO term
Caller        : general
Status        : Stable

fetch_all_by_GOTerm_accession

Arg [1]   : String
            The GO term accession for which genes should be
            fetched.

Example   :

  @genes =
    @{ $gene_adaptor->fetch_all_by_GOTerm_accession('GO:0030326') };

Description   : Retrieves a list of genes that are associated with
                the given GO term, or with any of its descendent
                GO terms.  The genes returned are in their native
                coordinate system, i.e. in the coordinate system
                in which they are stored in the database.  If
                another coordinate system is required then the
                Gene::transfer or Gene::transform method can be
                used.

Return type   : listref of Bio::EnsEMBL::Gene
Exceptions    : Throws of argument is not a GO term accession
Caller        : general
Status        : Stable

store

Arg [1]    : Bio::EnsEMBL::Translation $translation
             The translation object to be stored in the database 
Example    : $transl_id = $translation_adaptor->store($translation);
Description: Stores a translation object in the database
Returntype : int - the new dbID of the stored translation
Exceptions : thrown if the dbID of the start_Exon or end_Exon is not 
             defined.
             thrown if only partial stable id information is present (e.g.
             identifier but not version number)
Caller     : Transcript::store
Status     : Stable

remove

Arg [1]    : Bio::EnsEMBL::Translation $translation
Example    : $translation_adaptor->remove($translation);
Description: Removes a translation completely from the database, and all
             associated information including protein features etc.
Returntype : none
Exceptions : throw on incorrect arguments
             warning if translation is not in this database
Caller     : TranscriptAdaptor::remove
Status     : Stable

list_dbIDs

Arg [1]    : none
Example    : @translation_ids = @{$translation_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all translations in the current db
Returntype : list of ints
Exceptions : none
Caller     : ?
Status     : Stable

list_stable_ids

Arg [1]    : none
Example    : @transl_stable_ids = @{$transl_adaptor->list_stable_dbIDs()};
Description: Gets an array of stable ids for all translations in the current 
             db
Returntype : reference to a list of strings
Exceptions : none
Caller     : general
Status     : Stable

_list_dbIDs

Arg[1]      : String $table
Arg[2]      : String $column
Example     : $transl_adaptor->_list_dbIDs('translation','translation_id');
Description : Local reimplementation to ensure multi-species translations
              are limited to their species alone
Returntype  : ArrayRef of specified IDs
Caller      : Internal
Status      : Unstable

fetch_by_dbID

Arg [1]    : int $dbID
             The internal identifier of the Translation to obtain
Example    : $translation = $translation_adaptor->fetch_by_dbID(1234);
Description: This fetches a Translation object via its internal id.
             This is only debatably useful since translations do
             not make much sense outside of the context of their
             Transcript.  Consider using fetch_by_Transcript instead.
Returntype : Bio::EnsEMBL::Translation, or undef if the translation is not
             found.
Exceptions : warning if an additional (old style) Transcript argument is
             provided
Caller     : ?
Status     : Stable

fetch_by_stable_id

Arg [1]    : string $stable_id
             The stable identifier of the Translation to obtain
Example    : $translation = $translation_adaptor->fetch_by_stable_id("ENSP00001");
Description: This fetches a Translation object via its stable id.
             This is only debatably useful since translations do
             not make much sense outside of the context of their
             Transcript.  Consider using fetch_by_Transcript instead.
Returntype : Bio::EnsEMBL::Translation or undef if the translation is not
             found.
Exceptions : warning if an additional (old style) Transcript argument is
             provided
Caller     : ?
Status     : Stable

fetch_by_stable_id_version

Arg [1]    : String $id 
             The stable ID of the gene to retrieve
Arg [2]    : Integer $version
             The version of the stable_id to retrieve
Example    : $gene = $gene_adaptor->fetch_by_stable_id('ENSG00000148944', 14);
Description: Retrieves a gene object from the database via its stable id and version.
             The gene will be retrieved in its native coordinate system (i.e.
             in the coordinate system it is stored in the database). It may
             be converted to a different coordinate system through a call to
             transform() or transfer(). If the gene or exon is not found
             undef is returned instead.
Returntype : Bio::EnsEMBL::Gene or undef
Exceptions : if we cant get the gene in given coord system
Caller     : general
Status     : Stable

fetch_all_by_Transcript_list

Arg [1]    : reference to list of Bio::EnsEMBL::Transcripts $transcripts
             The list of $transcripts to obtain Translation object for.
Example    : @translations = @{$tla->fetch_all_by_Transcript_list([$t1,$t2]);
Description: Fetches all translations associated with the list of transcripts
             passed to this method.  The passed transcripts will also have
             their translation set by this method.
Returntype : Reference to list of Bio::EnsEMBL::Translations
Exceptions : None
Caller     : general
Status     : Stable

fetch_all

Example     : $translations = $translation_adaptor->fetch_all();
Description : Retrieves all canonical and alternative translations 
              stored in the database.
Returntype  : listref of Bio::EnsEMBL::Translation
Caller      : general
Status      : At Risk