Archive Ensembl HomeArchive Ensembl Home
Bio::EnsEMBL::DB::ExternalFeatureFactoryI Class Reference
Inheritance diagram for Bio::EnsEMBL::DB::ExternalFeatureFactoryI:

List of all members.


Class Summary

Synopsis

  $external_ff = new ImplementingExternalFeatureFactoryClass;

  $database_adaptor = new Bio::EnsEMBL::DBSQL::DBAdaptor(
    -host   =\> 'blah',
    -dbname =\> 'other',
    -pass   =\> 'pass'
  );

  # alternatively, you can add external databases to an obj once made
  $database_adaptor-\>add_ExternalFeatureFactory($external_ff);

  # now the ExternalFeatureFactory has been added, Ensembl RawContigs
  # and Slices will now have ExternalFeatures on them
  $contig =
    $db_adaptor-\>get_RawContigAdaptor-\>fetch_by_name('AC00056.00001');
  @external = @{ $contig-\>get_all_ExternalFeatures() };

  # this works on Slices as well
  $slice =
    $db_adaptor-\>get_SliceAdaptor-\>fetch_by_chr_start_end( '12', 10000,
    30000 );
  @external = @{ $slice-\>get_all_ExternalFeatures() };

Description

This is a legacy class.  It is included only for backwards
compatibility with ExternalFeatureFactories which are presumably
still used to place data into ensembl.  It is recommended that if
you wish to create EnsEMBL features externally that you use the
Bio::EnsEMBL::External::ExternalFeatureAdaptor instead.
This object defines the abstract interface for External Database access
inside Ensembl. The aim is that one can attach an External Database
which will generate Sequence Features and these Sequence Features will
be accessible along side all the internal Ensembl sequence features, for
drawing, EMBL dumping etc. In particular, the external database does not
have to worry about the transformation of the Sequence Feature objects
into VirtualContigs.
Sequence Features have to be defined in one of two coordinate systems:
Original EMBL/GenBank coordinates of a particular sequnence version or
the Ensembl contig coordinates. This means you have to calculate your
sequence features in one these two coordinate systems
The methods that have to be implemented are:
  get_External_SeqFeatures_contig( $ensembl_contig_identifier,
    $sequence_version, $start, $end );
  get_External_SeqFeatures_clone( $embl_accession_number,
    $sequence_version, $start, $end );
The semantics of this method is as follows:
  $ensembl_contig_identifier - the ensembl contig id (external id).
  $sequence_version - embl/genbank sequence version
  $embl_accession_number - the embl/genbank accession number
The $start/$end can be ignored, but methods can take advantage of it.
This is so that ensembl can ask for features only on a region of DNA,
and if desired, the external database can respond with features only in
this region, rather than the entire sequence.
The hope is that the second method could potentially have a very complex
set of mappings of other embl_accession numbers to one embl_accession
number and provide the complex mapping.
The methods should return Sequence Features with the following spec:
  a) must implement the Bio::SeqFeatureI interface.
  b) must accept "set" calls on
  start,end,strand
  to provide coordinate transformation of the feature.
  c) must be unique in-memory objects, ie, the implementation is not
  allowed to cache the sequence feature in its entirity. Two separate
  calls to get_External_SeqFeatures_contig must be able to separately
  set start,end,strand information without clobbering each other. The
  other information, if so wished, can be cached by each SeqFeature
  holding onto another object, but this is left to the implementor to
  decide on the correct strategy.
  d) must return an unique identifier when called with method id.
You must implement both functions. In most cases, one function will
always return an empty list, whereas the other function will actually
query the external database.
The second way of accessing the External Database from Ensembl is using
unique internal identifiers in that database. The method is:
  get_SeqFeature_by_id($id);
It should return exactly one Sequence Feature object of the same type as
above.
 

Definition at line 109 of file ExternalFeatureFactoryI.pm.

Available Methods

protected _guess_slice_setter ()
protected void _no_valid_coord_system ()
protected Boolean _supported ()
public void coordinate_systems ()
public
Bio::EnsEMBL::DBSQL::DBAdaptor 
ensembl_db ()
public String feature_type ()
public Reference fetch_all_by_chr_start_end ()
public Reference fetch_all_by_clone_accession ()
public void fetch_all_by_contig_name ()
public Reference fetch_all_by_Slice ()
public Reference fetch_all_by_supercontig_name ()
public An get_Ensembl_Genes_clone ()
public get_Ensembl_SeqFeatures_clone ()
public get_Ensembl_SeqFeatures_contig ()
public get_SeqFeature_by_id ()
public
Bio::EnsEMBL::External::ExternalFeatureAdaptor 
new ()
public String track_name ()

Method Documentation

protected Bio::EnsEMBL::External::ExternalFeatureAdaptor::_guess_slice_setter ( ) [inherited]

Undocumented method

Code:
click to view
protected void Bio::EnsEMBL::External::ExternalFeatureAdaptor::_no_valid_coord_system ( ) [inherited]
  Arg [1]    : none
  Example    : none
  Description: PRIVATE method - throws an error with a descriptive message
  Returntype : none
  Exceptions : always thrown
  Caller     : internal
 
Code:
click to view
protected Boolean Bio::EnsEMBL::External::ExternalFeatureAdaptor::_supported ( ) [inherited]
  Arg [1]    : string $system 
  Example    : print "CONTIG system supported" if($self->_supported('CONTIG'));
  Description: PRIVATE method. Tests if the coordinate system defined by
               the $system argument is implemented.
  Returntype : boolean
  Exceptions : none
  Caller     : internal
 
Code:
click to view
public void Bio::EnsEMBL::DB::ExternalFeatureFactoryI::coordinate_systems ( )
  Arg [1]    : none
  Example    : none
  Description: This method is present to make the ExternalFeatureFactory 
               interface behave as an ExternalFeatureAdaptor. It is for
               backwards compatibility.
  Returntype : none
  Exceptions : none
  Caller     : internal
 
Code:
click to view

Reimplemented from Bio::EnsEMBL::External::ExternalFeatureAdaptor.

public Bio::EnsEMBL::DBSQL::DBAdaptor Bio::EnsEMBL::External::ExternalFeatureAdaptor::ensembl_db ( ) [inherited]
  Arg [1]    : (optional) Bio::EnsEMBL::DBSQL::DBAdaptor
  Example    : $external_feature_adaptor->ensembl_db($new_val);
  Description: none
  Returntype : Bio::EnsEMBL::DBSQL::DBAdaptor
  Exceptions : none
  Caller     : internal
 
Code:
click to view
public String Bio::EnsEMBL::External::ExternalFeatureAdaptor::feature_type ( ) [inherited]
  Arg [1]    : none
  Example    : $feature_type = $xf_adaptor->track_name
  Description: Currently this is not used.  In the future it may be possible
               to have ExternalFeatures automatically displayed by the EnsEMBL
               web code.  This method would then be used do determine the 
               type of glyphs used to draw the features which are returned
               from this external adaptor.
  Returntype : string
  Exceptions : none
  Caller     : none
 
Code:
click to view
public Reference Bio::EnsEMBL::External::ExternalFeatureAdaptor::fetch_all_by_chr_start_end ( ) [inherited]
  Arg [1]    : string $chr_name
               The name of the chromosome to retrieve features from
  Arg [2]    : int $start
               The start coordinate of the chromosomal region to retrieve
               features from.
  Arg [3]    : int $end
               The end coordinate of the chromosomal region to retrieve 
               features from.
  Example    : @features
  Description: Retrieves features on the region defined by the $chr_name,
               $start, and $end args in assembly (chromosomal) coordinates.
               If this method is overridden then the coordinate_systems method
               must return 'ASSEMBLY' as one of its values.
               This method will work as is (i.e. without overriding it) 
               providing at least one of the other fetch methods is overridden.
  Returntype : reference to a list of Bio::SeqFeatures 
  Exceptions : Thrown if the coordinate_systems method returns ASSEMBLY as a 
               value and this method is not overridden.  
               Thrown if any of the input arguments are incorrect
  Caller     : general, fetch_all_by_Slice
 
Code:
click to view
public Reference Bio::EnsEMBL::External::ExternalFeatureAdaptor::fetch_all_by_clone_accession ( ) [inherited]
  Arg [1]    : string $acc
               The EMBL accession number of the clone to fetch features from.
  Arg [2]    : (optional) string $ver
  Arg [3]    : (optional) int $start
  Arg [4]    : (optional) int $end
  Example    : @fs = @{$self->fetch_all_by_clone_accession('AC000093')};
  Description: Retrieves features on the clone defined by the $acc arg in 
               Clone coordinates.
               If this method is overridden then the coordinate_systems method
               must return 'CLONE' as one of its values. The arguments 
               start, end, version are passed if this method is overridden and
               can optionally be used to reduce the scope of the query and 
               improve performance.
               This method will work as is - providing at least one other
               fetch method has been overridden.
  Returntype : reference to a list of Bio::SeqFeature objects in the Clone
               coordinate system
  Exceptions : thrown if the input argument is incorrect
               thrown if the coordinate system method returns the value 'CLONE'
               and this method is not overridden.
               thrown if the coordinate systems method does not return any 
               valid values.
  Caller     : general, fetch_all_by_clone_accession
 
Code:
click to view
public void Bio::EnsEMBL::DB::ExternalFeatureFactoryI::fetch_all_by_contig_name ( )
  Arg [1]    : none
  Example    : none
  Description: This method is present to make the ExternalFeatureFactory 
               interface behave as an ExternalFeatureAdaptor. It is for
               backwards compatibility.
  Returntype : none
  Exceptions : none
  Caller     : internal
 
Code:
click to view

Reimplemented from Bio::EnsEMBL::External::ExternalFeatureAdaptor.

public Reference Bio::EnsEMBL::External::ExternalFeatureAdaptor::fetch_all_by_Slice ( ) [inherited]
  Arg [1]    : Bio::EnsEMBL::Slice $slice
  Example    : @features = @{$ext_adaptor->fetch_all_by_Slice($slice)};
  Description: Retrieves all features which lie in the region defined
               by $slice in slice coordinates.
               If this method is overridden then the coordinate_systems method
               must return 'SLICE' as one of its values.
               This method will work as is (i.e. without overriding it) 
               providing at least one of the other fetch methods is overridden.
  Returntype : reference to a list of Bio::SeqFeature objects in the Slice
               coordinate system
  Exceptions : Thrown on incorrect input arguments
  Caller     : general, fetch_all_by_chr_start_end
 
Code:
click to view
public Reference Bio::EnsEMBL::External::ExternalFeatureAdaptor::fetch_all_by_supercontig_name ( ) [inherited]
  Arg [1]    : string $supercontig_name
  Arg [2]    : int $start (optional)
               The start of the region on the contig to retrieve features on
               if not specified the whole of the contig is used.
  Arg [3]    : int $end (optional) 
               The end of the region on the contig to retrieve features on
               if not specified the whole of the contig is used.
  Example    : @fs = @{$self->fetch_all_by_contig_name('NT_004321')};
  Description: Retrieves features on the contig defined by the name 
               $supercontigname in supercontig coordinates.
               If this method is overridden then the coordinate_systems 
               method must return 'SUPERCONTIG' as one of its values.
               This method will work as is (i.e. without being overridden)
               providing at least one other fetch method has 
               been overridden.
  Returntype : reference to a list of Bio::SeqFeature objects in the contig
               coordinate system.
  Exceptions : thrown if the input argument is incorrect
               thrown if the coordinate_systems method returns the value
               'SUPERCONTIG' and this method has not been overridden.
  Caller     : general, fetch_all_by_Slice
 
Code:
click to view
public An Bio::EnsEMBL::DB::ExternalFeatureFactoryI::get_Ensembl_Genes_clone ( )
 Title   : get_Ensembl_Genes_clone
 Function: returns Gene objects in clone coordinates from a gene id
 Returns : An array of Gene objects
 Args    : clone id
 
Code:
click to view
public Bio::EnsEMBL::DB::ExternalFeatureFactoryI::get_Ensembl_SeqFeatures_clone ( )
 Title   : get_Ensembl_SeqFeatures_clone (Abstract)
 Usage   :
 Function:
 Example :
 Returns : 
 Args    :
 
Code:
click to view
public Bio::EnsEMBL::DB::ExternalFeatureFactoryI::get_Ensembl_SeqFeatures_contig ( )
 Title   : get_Ensembl_SeqFeatures_contig (Abstract)
 Usage   :
 Function:
 Example :
 Returns : 
 Args    :
 
Code:
click to view
public Bio::EnsEMBL::DB::ExternalFeatureFactoryI::get_SeqFeature_by_id ( )
 Title   : get_SeqFeature_by_id (Abstract)
 Usage   : 
 Function: Return SeqFeature object for any valid unique id  
 Example :
 Returns : 
 Args    : id as determined by the External Database
 
Code:
click to view
public Bio::EnsEMBL::External::ExternalFeatureAdaptor Bio::EnsEMBL::External::ExternalFeatureAdaptor::new ( ) [inherited]
  Arg [1]    : none
  Example    : $xfa = new Bio::EnsEMBL::External::ExternalFeatureAdaptor;
  Description: Creates a new ExternalFeatureAdaptor object.  You may wish to
               extend this constructor and provide your own set of paremeters.
  Returntype : Bio::EnsEMBL::External::ExternalFeatureAdaptor
  Exceptions : none
  Caller     : general
 
Code:
click to view
public String Bio::EnsEMBL::External::ExternalFeatureAdaptor::track_name ( ) [inherited]
  Arg [1]    : none
  Example    : $track_name = $xf_adaptor->track_name;
  Description: Currently this is not really used.  In the future it may be 
               possible to have ExternalFeatures automatically displayed by
               the EnsEMBL web code.  By default this method returns 
               'External features' but you are encouraged to override this 
               method and provide your own meaningful name for the features
               your adaptor provides.  This also allows you to distinguish the
               type of features retrieved from Slices.  See
               the PODs for Bio::EnsEMBL::Slice::get_all_ExternalFeatures and 
               Bio::EnsEMBL::DBSQL::DBAdaptor::add_ExternalFeatureAdaptor 
               methods. 
  Returntype : string
  Exceptions : none
  Caller     : Bio::EnsEMBL::DBSQL::DBAdaptor::add_ExternalFeatureAdaptor
 
Code:
click to view

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