Archive Ensembl HomeArchive Ensembl Home
Bio::EnsEMBL::DBSQL::TranslationAdaptor Class Reference
Inheritance diagram for Bio::EnsEMBL::DBSQL::TranslationAdaptor:

List of all members.


Class Summary

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() );

Definition at line 50 of file TranslationAdaptor.pm.

Available Methods

protected _columns ()
protected _default_where_clause ()
protected _final_clause ()
protected _left_join ()
protected _list_dbIDs ()
protected _objs_from_sth ()
protected _straight_join ()
protected _tables ()
public Listref bind_param_generic_fetch ()
public
Bio::EnsEMBL::DBSQL::DBAdaptor 
db ()
public
Bio::EnsEMBL::DBSQL::DBConnection 
dbc ()
public dump_data ()
public Listref fetch_all ()
public Listref fetch_all_alternative_by_Transcript ()
public fetch_all_by_DBEntry ()
public Listref fetch_all_by_dbID_list ()
public Reference fetch_all_by_external_name ()
public Listref fetch_all_by_GOTerm ()
public Listref fetch_all_by_GOTerm_accession ()
public Reference fetch_all_by_Transcript_list ()
public Bio::EnsEMBL::Translation fetch_by_dbID ()
public Bio::EnsEMBL::Translation fetch_by_stable_id ()
public Bio::EnsEMBL::Translation fetch_by_Transcript ()
public Listref generic_fetch ()
public get_dumped_data ()
public get_stable_entry_info ()
public Boolean is_multispecies ()
public Scalar last_insert_id ()
public List list_dbIDs ()
public Reference list_stable_ids ()
public
Bio::EnsEMBL::DBSQL::BaseAdaptor 
new ()
public DBI::StatementHandle prepare ()
public void remove ()
public Int species_id ()
public Int store ()

Method Documentation

protected Bio::EnsEMBL::DBSQL::BaseAdaptor::_default_where_clause ( ) [inherited]
protected Bio::EnsEMBL::DBSQL::BaseAdaptor::_final_clause ( ) [inherited]

Undocumented method

Code:
click to view

Reimplemented in Bio::EnsEMBL::DBSQL::ExonAdaptor, Bio::EnsEMBL::DBSQL::MiscFeatureAdaptor, and Bio::EnsEMBL::DBSQL::PredictionExonAdaptor.

protected Bio::EnsEMBL::DBSQL::BaseAdaptor::_list_dbIDs ( ) [inherited]

Undocumented method

Code:
click to view
protected Bio::EnsEMBL::DBSQL::BaseAdaptor::_straight_join ( ) [inherited]

Undocumented method

Code:
click to view
public Listref Bio::EnsEMBL::DBSQL::BaseAdaptor::bind_param_generic_fetch ( ) [inherited]
 Arg [1]   : (optional)  scalar $param
              This is the parameter to bind
 Arg [2]   : (optional) int $sql_type
              Type of the parameter (from DBI (:sql_types))
 Example   :  $adaptor->bind_param_generic_fetch($stable_id,SQL_VARCHAR);
              $adaptor->generic_fetch();
 Description:  When using parameters for the query, will call the bind_param to avoid
               some security issues. If there are no arguments, will return the bind_parameters
 ReturnType : listref
 Exceptions:  if called with one argument
 
Code:
click to view
public Bio::EnsEMBL::DBSQL::DBAdaptor Bio::EnsEMBL::DBSQL::BaseAdaptor::db ( ) [inherited]
  Arg [1]    : (optional) Bio::EnsEMBL::DBSQL::DBAdaptor $obj 
               the database this adaptor is using.
  Example    : $db = $adaptor->db();
  Description: Getter/Setter for the DatabaseConnection that this adaptor is 
               using.
  Returntype : Bio::EnsEMBL::DBSQL::DBAdaptor
  Exceptions : none
  Caller     : Adaptors inherited from BaseAdaptor
  Status     : Stable
 
Code:
click to view
public Bio::EnsEMBL::DBSQL::DBConnection Bio::EnsEMBL::DBSQL::BaseAdaptor::dbc ( ) [inherited]
  Arg [1]    : (optional) Bio::EnsEMBL::DBSQL::DBConnection $obj 
               the database this adaptor is using.
  Example    : $db = $adaptor->db();
  Description: Getter/Setter for the DatabaseConnection that this adaptor is 
               using.
  Returntype : Bio::EnsEMBL::DBSQL::DBConnection
  Exceptions : none
  Caller     : Adaptors inherited from BaseAdaptor
  Status     : Stable
 
Code:
click to view
public Bio::EnsEMBL::DBSQL::BaseAdaptor::dump_data ( ) [inherited]

Undocumented method

Code:
click to view
public Listref Bio::EnsEMBL::DBSQL::TranslationAdaptor::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
 
Code:
click to view

Reimplemented from Bio::EnsEMBL::DBSQL::BaseAdaptor.

public Listref Bio::EnsEMBL::DBSQL::TranslationAdaptor::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
 
Code:
click to view
public Bio::EnsEMBL::DBSQL::TranslationAdaptor::fetch_all_by_DBEntry ( )
  Description:

Deprecated:
, this has been renames fetch_all_by_external_name
 
Code:
click to view
public Listref Bio::EnsEMBL::DBSQL::BaseAdaptor::fetch_all_by_dbID_list ( ) [inherited]
  Arg [1]    : listref of integers $id_list
               The unique database identifiers for the features to
               be obtained.
  Arg [2]    : optional - Bio::EnsEMBL::Slice to map features onto.
  Example    : @feats = @{$adaptor->fetch_all_by_dbID_list([1234, 2131, 982]))};
  Description: Returns the features created from the database
               defined by the the IDs in contained in the provided
               ID list $id_list.  The features will be returned
               in their native coordinate system.  That is, the
               coordinate system in which they are stored in the
               database.  In order to convert the features to a
               particular coordinate system use the transfer() or
               transform() method.  If none of the features are
               found in the database a reference to an empty list is
               returned.
  Returntype : listref of Bio::EnsEMBL::Features
  Exceptions : thrown if $id arg is not provided
               does not exist
  Caller     : general
  Status     : Stable
 
Code:
click to view

Reimplemented in Bio::EnsEMBL::DBSQL::OntologyTermAdaptor.

public Reference Bio::EnsEMBL::DBSQL::TranslationAdaptor::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.
  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
  Returntype : reference to a list of Translations
  Exceptions : none
  Caller     : general
  Status     : Medium Risk
             :   At some time may be

Deprecated:
to instead use : TranscriptAdaptor::fetch_all_by_external_name
 
Code:
click to view
public Listref Bio::EnsEMBL::DBSQL::TranslationAdaptor::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
 
Code:
click to view
public Listref Bio::EnsEMBL::DBSQL::TranslationAdaptor::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
 
Code:
click to view
public Reference Bio::EnsEMBL::DBSQL::TranslationAdaptor::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
 
Code:
click to view
public Bio::EnsEMBL::Translation Bio::EnsEMBL::DBSQL::TranslationAdaptor::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
 
Code:
click to view

Reimplemented from Bio::EnsEMBL::DBSQL::BaseAdaptor.

public Bio::EnsEMBL::Translation Bio::EnsEMBL::DBSQL::TranslationAdaptor::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
 
Code:
click to view
public Bio::EnsEMBL::Translation Bio::EnsEMBL::DBSQL::TranslationAdaptor::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
 
Code:
click to view
public Listref Bio::EnsEMBL::DBSQL::BaseAdaptor::generic_fetch ( ) [inherited]
  Arg [1]    : (optional) string $constraint
               An SQL query constraint (i.e. part of the WHERE clause)
  Arg [2]    : (optional) Bio::EnsEMBL::AssemblyMapper $mapper
               A mapper object used to remap features
               as they are retrieved from the database
  Arg [3]    : (optional) Bio::EnsEMBL::Slice $slice
               A slice that features should be remapped to
  Example    : $fts = $a->generic_fetch('contig_id in (1234, 1235)', 'Swall');
  Description: Performs a database fetch and returns feature objects in
               contig coordinates.
  Returntype : listref of Bio::EnsEMBL::SeqFeature in contig coordinates
  Exceptions : none
  Caller     : BaseFeatureAdaptor, ProxyDnaAlignFeatureAdaptor::generic_fetch
  Status     : Stable
 
Code:
click to view

Reimplemented in Bio::EnsEMBL::DBSQL::DataFileAdaptor.

public Bio::EnsEMBL::DBSQL::BaseAdaptor::get_dumped_data ( ) [inherited]

Undocumented method

Code:
click to view
public Bio::EnsEMBL::DBSQL::TranslationAdaptor::get_stable_entry_info ( )
 Description:

Deprecated:
  • This method should no longer be needed. Stable id info is fetched when the transcript is.
 
Code:
click to view
public Boolean Bio::EnsEMBL::DBSQL::BaseAdaptor::is_multispecies ( ) [inherited]
  Arg [1]    : (optional) boolean $arg
  Example    : if ($adaptor->is_multispecies()) { }
  Description: Getter/Setter for the is_multispecies boolean of
               to use for this adaptor.
  Returntype : boolean
  Exceptions : none
  Caller     : general
  Status     : Stable
 
Code:
click to view
public Scalar Bio::EnsEMBL::DBSQL::BaseAdaptor::last_insert_id ( ) [inherited]
  Arg [1]     : (optional) $field the name of the field the inserted ID was pushed 
                into
  Arg [2]     : (optional) HashRef used to pass extra attributes through to the 
                DBD driver
  Description : Delegating method which uses DBI to extract the last inserted 
                identifier. If using MySQL we just call the DBI method 
                DBI::last_insert_id() since MySQL ignores any extra
                arguments. See DBI for more information about this 
                delegated method. 
  Example     : my $id = $self->last_insert_id('my_id'); my $other_id = $self->last_insert_id();
  Returntype  : Scalar or undef
 
Code:
click to view
public List Bio::EnsEMBL::DBSQL::TranslationAdaptor::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
 
Code:
click to view
public Reference Bio::EnsEMBL::DBSQL::TranslationAdaptor::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
 
Code:
click to view
public Bio::EnsEMBL::DBSQL::BaseAdaptor Bio::EnsEMBL::DBSQL::BaseAdaptor::new ( ) [inherited]
  Arg [1]    : Bio::EnsEMBL::DBSQL::DBConnection $dbobj
  Example    : $adaptor = new AdaptorInheritedFromBaseAdaptor($dbobj);
  Description: Creates a new BaseAdaptor object.  The intent is that this
               constructor would be called by an inherited superclass either
               automatically or through $self->SUPER::new in an overridden 
               new method.
  Returntype : Bio::EnsEMBL::DBSQL::BaseAdaptor
  Exceptions : none
  Caller     : Bio::EnsEMBL::DBSQL::DBConnection
  Status     : Stable
 
Code:
click to view

Reimplemented in Bio::EnsEMBL::DBSQL::AnalysisAdaptor, Bio::EnsEMBL::DBSQL::AssemblyExceptionFeatureAdaptor, Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor, Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor, Bio::EnsEMBL::DBSQL::AttributeAdaptor, Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor, Bio::EnsEMBL::DBSQL::CoordSystemAdaptor, Bio::EnsEMBL::DBSQL::DensityFeatureAdaptor, Bio::EnsEMBL::DBSQL::DensityTypeAdaptor, Bio::EnsEMBL::DBSQL::GOTermAdaptor, Bio::EnsEMBL::DBSQL::MetaCoordContainer, Bio::EnsEMBL::DBSQL::MiscSetAdaptor, Bio::EnsEMBL::DBSQL::SequenceAdaptor, Bio::EnsEMBL::DBSQL::SliceAdaptor, Bio::EnsEMBL::DBSQL::SOTermAdaptor, Bio::EnsEMBL::DBSQL::StrainSliceAdaptor, Bio::EnsEMBL::DBSQL::UnmappedObjectAdaptor, and Bio::EnsEMBL::External::BlastAdaptor.

public DBI::StatementHandle Bio::EnsEMBL::DBSQL::BaseAdaptor::prepare ( ) [inherited]
  Arg [1]    : string $string
               a SQL query to be prepared by this adaptors database
  Example    : $sth = $adaptor->prepare("select yadda from blabla")
  Description: provides a DBI statement handle from the adaptor. A convenience
               function so you dont have to write $adaptor->db->prepare all the
               time
  Returntype : DBI::StatementHandle
  Exceptions : none
  Caller     : Adaptors inherited from BaseAdaptor
  Status     : Stable
 
Code:
click to view

Reimplemented in Bio::EnsEMBL::DBSQL::SliceAdaptor, and Bio::EnsEMBL::External::BlastAdaptor.

public void Bio::EnsEMBL::DBSQL::TranslationAdaptor::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
 
Code:
click to view
public Int Bio::EnsEMBL::DBSQL::BaseAdaptor::species_id ( ) [inherited]
  Arg [1]    : (optional) int $species_id
               The internal ID of the species in a multi-species database.
  Example    : $db = $adaptor->db();
  Description: Getter/Setter for the internal ID of the species in a
               multi-species database.  The default species ID is 1.
  Returntype : Integer
  Exceptions : none
  Caller     : Adaptors inherited from BaseAdaptor
  Status     : Stable
 
Code:
click to view
public Int Bio::EnsEMBL::DBSQL::TranslationAdaptor::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
 
Code:
click to view

The documentation for this class was generated from the following file: