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

List of all members.


Class Summary

Synopsis

  use Bio::EnsEMBL::Registry;

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

  $asma = Bio::EnsEMBL::Registry-\>get_adaptor( "human", "core",
    "assemblymapper" );

  $csa = Bio::EnsEMBL::Registry-\>get_adaptor( "human", "core",
    "coordsystem" );

  my $chr33_cs = $csa-\>fetch_by_name( 'chromosome', 'NCBI33' );
  my $chr34_cs = $csa-\>fetch_by_name( 'chromosome', 'NCBI34' );
  my $ctg_cs   = $csa-\>fetch_by_name('contig');
  my $clone_cs = $csa-\>fetch_by_name('clone');

  my $chr_ctg_mapper =
    $asma-\>fetch_by_CoordSystems( $chr33_cs, $ctg_cs );

  my $ncbi33_ncbi34_mapper =
    $asm_adptr-\>fetch_by_CoordSystems( $chr33, $chr34 );

  my $ctg_clone_mapper =
    $asm_adptr-\>fetch_by_CoordSystems( $ctg_cs, $clone_cs );

Description

Adaptor for handling Assembly mappers.  This is a Singleton class.
ie: There is only one per database (DBAdaptor).
This is used to retrieve mappers between any two coordinate systems
whose makeup is described by the assembly table.  Currently one step
(explicit) and two step (implicit) pairwise mapping is supported.  In
one-step mapping an explicit relationship between the coordinate systems
is defined in the assembly table.  In two-step 'chained' mapping no
explicit mapping is present but the coordinate systems must share a
common mapping to an intermediate coordinate system.
 

Definition at line 58 of file AssemblyMapperAdaptor.pm.

Available Methods

protected _build_combined_mapper ()
protected _columns ()
protected _default_where_clause ()
protected _final_clause ()
protected _left_join ()
protected _list_dbIDs ()
protected _objs_from_sth ()
protected void _register_chained_special ()
protected _seq_region_id_to_name ()
protected _seq_region_name_to_id ()
protected _straight_join ()
protected _tables ()
public Listref bind_param_generic_fetch ()
public cache_seq_ids_with_mult_assemblys ()
public
Bio::EnsEMBL::DBSQL::DBAdaptor 
db ()
public
Bio::EnsEMBL::DBSQL::DBConnection 
dbc ()
public void delete_cache ()
public dump_data ()
public fetch_all ()
public Listref fetch_all_by_dbID_list ()
public Bio::EnsEMBL::AssemblyMapper fetch_by_CoordSystems ()
public Bio::EnsEMBL::Feature fetch_by_dbID ()
public fetch_by_type ()
public Listref generic_fetch ()
public get_dumped_data ()
public Boolean is_multispecies ()
public Scalar last_insert_id ()
public
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor 
new ()
public DBI::StatementHandle prepare ()
public void register_all ()
public void register_all_chained ()
public void register_assembled ()
public void register_chained ()
public void register_component ()
public register_contig ()
public register_region ()
public Listref seq_ids_to_regions ()
public Listref seq_regions_to_ids ()
public Int species_id ()

Method Documentation

protected Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::_build_combined_mapper ( )

Undocumented method

Code:
click to view
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 void Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::_register_chained_special ( )
  Arg [1]    : Bio::EnsEMBL::ChainedAssemblyMapper $casm_mapper
               The chained assembly mapper to register regions on
  Arg [2]    : string $from ('first' or 'last')
               The direction we are registering from, and the name of the
               internal mapper.
  Arg [3]    : string $seq_region_name
               The name of the seqregion we are registering on
  Arg [4]    : listref $ranges
               A list  of ranges to register (in [$start,$end] tuples).
  Arg [5]    : (optional) $to_slice
               Only register those on this Slice.
  Description: Registers a set of ranges on a chained assembly mapper.
               This function is at the heart of the chained mapping process.
               It retrieves information from the assembly table and
               dynamically constructs the mappings between two coordinate
               systems which are 2 mapping steps apart. It does this by using
               two internal mappers to load up a third mapper which is
               actually used by the ChainedAssemblyMapper to perform the
               mapping.
               This method must be called before any mapping is
               attempted on regions of interest, otherwise only gaps will
               be returned.  Note that the ChainedAssemblyMapper automatically
               calls this method when the need arises.
  Returntype : none
  Exceptions : throw if the seq_region to be registered does not exist
               or if it associated with multiple assembled pieces (bad data
               in assembly table)
               throw if the mapping between the coordinate systems cannot
               be performed in two steps, which means there is an internal
               error in the data in the meta table or in the code that creates
               the mapping paths.
  Caller     : Bio::EnsEMBL::AssemblyMapper
  Status     : Stable
 
Code:
click to view
protected Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::_seq_region_id_to_name ( )

Undocumented method

Code:
click to view
protected Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::_seq_region_name_to_id ( )

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::AssemblyMapperAdaptor::cache_seq_ids_with_mult_assemblys ( )
  Example    : $self->adaptor->cache_seq_ids_with_mult_assemblys();
  Description: Creates a hash of the component seq region ids that
               map to more than one assembly from the assembly table.
  Retruntype : none
  Exceptions : none
  Caller     : AssemblyMapper, ChainedAssemblyMapper
  Status     : At Risk
 
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 void Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::delete_cache ( )
 Description: Delete all the caches for the mappings/seq_regions
 Returntype : none
 Exceptions : none
 Caller     : General
 Status     : At risk
 
Code:
click to view
public Bio::EnsEMBL::DBSQL::BaseAdaptor::dump_data ( ) [inherited]

Undocumented method

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 Bio::EnsEMBL::AssemblyMapper Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::fetch_by_CoordSystems ( )
  Arg [1]    : Bio::EnsEMBL::CoordSystem $cs1
               One of the coordinate systems to retrieve the mapper
               between
  Arg [2]    : Bio::EnsEMBL::CoordSystem $cs2
               The other coordinate system to map between
  Description: Retrieves an Assembly mapper for two coordinate
               systems whose relationship is described in the
               assembly table.
               The ordering of the coodinate systems is arbitrary.
               The following two statements are equivalent:
               $mapper = $asma->fetch_by_CoordSystems($cs1,$cs2);
               $mapper = $asma->fetch_by_CoordSystems($cs2,$cs1);
  Returntype : Bio::EnsEMBL::AssemblyMapper
  Exceptions : wrong argument types
  Caller     : general
  Status     : Stable
 
Code:
click to view
public Bio::EnsEMBL::Feature Bio::EnsEMBL::DBSQL::BaseAdaptor::fetch_by_dbID ( ) [inherited]
  Arg [1]    : int $id
               The unique database identifier for the feature to be obtained
  Example    : $feat = $adaptor->fetch_by_dbID(1234));
               $feat = $feat->transform('contig');
  Description: Returns the feature created from the database defined by the
               the id $id.  The feature will be returned in its native
               coordinate system.  That is, the coordinate system in which it
               is stored in the database.  In order to convert it to a
               particular coordinate system use the transfer() or transform()
               method.  If the feature is not found in the database then
               undef is returned instead
  Returntype : Bio::EnsEMBL::Feature or undef
  Exceptions : thrown if $id arg is not provided
               does not exist
  Caller     : general
  Status     : Stable
 
Code:
click to view

Reimplemented in Bio::EnsEMBL::DBSQL::AnalysisAdaptor, Bio::EnsEMBL::DBSQL::AssemblyExceptionFeatureAdaptor, Bio::EnsEMBL::DBSQL::CoordSystemAdaptor, Bio::EnsEMBL::DBSQL::DBEntryAdaptor, Bio::EnsEMBL::DBSQL::DensityTypeAdaptor, Bio::EnsEMBL::DBSQL::MiscSetAdaptor, Bio::EnsEMBL::DBSQL::OntologyTermAdaptor, Bio::EnsEMBL::DBSQL::ProteinFeatureAdaptor, Bio::EnsEMBL::DBSQL::RepeatConsensusAdaptor, Bio::EnsEMBL::DBSQL::TranslationAdaptor, Bio::EnsEMBL::Map::DBSQL::DitagAdaptor, Bio::EnsEMBL::Map::DBSQL::DitagFeatureAdaptor, Bio::EnsEMBL::Map::DBSQL::MarkerAdaptor, and Bio::EnsEMBL::Map::DBSQL::QtlAdaptor.

public Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::fetch_by_type ( )
  Description:

Deprecated:
use fetch_by_CoordSystems instead
 
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 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 Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::new ( )
  Arg [1]    : Bio::EnsEMBL::DBAdaptor $dbadaptor the adaptor for
               the database this assembly mapper is using.
  Example    : my $asma = new Bio::EnsEMBL::AssemblyMapperAdaptor($dbadaptor);
  Description: Creates a new AssemblyMapperAdaptor object
  Returntype : Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor
  Exceptions : none
  Caller     : Bio::EnsEMBL::DBSQL::DBAdaptor
  Status     : Stable
 
Code:
click to view

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

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::AssemblyMapperAdaptor::register_all ( )
  Arg [1]    : Bio::EnsEMBL::AssemblyMapper $mapper
  Example    : $mapper = $asm_mapper_adaptor->fetch_by_CoordSystems($cs1,$cs2);
               # make cache large enough to hold all of the mappings
               $mapper->max_pair_count(10e6);
               $asm_mapper_adaptor->register_all($mapper);
               # perform mappings as normal
               $mapper->map($slice->seq_region_name(), $sr_start, $sr_end,
                            $sr_strand, $cs1);
               ...
  Description: This function registers the entire set of mappings between
               two coordinate systems in an assembly mapper.
               This will use a lot of memory but will be much more efficient
               when doing a lot of mapping which is spread over the entire
               genome.
  Returntype : none
  Exceptions : none
  Caller     : specialised prograhsm
  Status     : Stable
 
Code:
click to view
public void Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::register_all_chained ( )
  Arg [1]    : Bio::EnsEMBL::ChainedAssemblyMapper $casm_mapper
  Example    : $mapper = $asm_mapper_adaptor->fetch_by_CoordSystems($cs1,$cs2);
               # make the cache large enough to hold all of the mappings
               $mapper->max_pair_count(10e6);
               # load all of the mapping data
               $asm_mapper_adaptor->register_all_chained($mapper);
               # perform mappings as normal
               $mapper->map($slice->seq_region_name(), $sr_start, $sr_end,
                            $sr_strand, $cs1);
               ...
  Description: This function registers the entire set of mappings between
               two coordinate systems in a chained mapper.  This will use a lot
               of memory but will be much more efficient when doing a lot of
               mapping which is spread over the entire genome.
  Returntype : none
  Exceptions : throw if mapper is between coord systems with unexpected
               mapping paths
  Caller     : specialised programs doing a lot of genome-wide mapping
  Status     : Stable
 
Code:
click to view
public void Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::register_assembled ( )
  Arg [1]    : Bio::EnsEMBL::AssemblyMapper $asm_mapper
               A valid AssemblyMapper object
  Arg [2]    : integer $asm_seq_region
               The dbID of the seq_region to be registered
  Arg [3]    : int $asm_start
               The start of the region to be registered
  Arg [4]    : int $asm_end
               The end of the region to be registered
  Description: Declares an assembled region to the AssemblyMapper.
               This extracts the relevant data from the assembly
               table and stores it in Mapper internal to the $asm_mapper.
               It therefore must be called before any mapping is
               attempted on that region. Otherwise only gaps will
               be returned.  Note that the AssemblyMapper automatically
               calls this method when the need arises.
  Returntype : none
  Exceptions : throw if the seq_region to be registered does not exist
               or if it associated with multiple assembled pieces (bad data
               in assembly table)
  Caller     : Bio::EnsEMBL::AssemblyMapper
  Status     : Stable
 
Code:
click to view
public void Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::register_chained ( )
  Arg [1]    : Bio::EnsEMBL::ChainedAssemblyMapper $casm_mapper
               The chained assembly mapper to register regions on
  Arg [2]    : string $from ('first' or 'last')
               The direction we are registering from, and the name of the
               internal mapper.
  Arg [3]    : string $seq_region_name
               The name of the seqregion we are registering on
  Arg [4]    : listref $ranges
               A list  of ranges to register (in [$start,$end] tuples).
  Arg [5]    : (optional) $to_slice
               Only register those on this Slice.
  Description: Registers a set of ranges on a chained assembly mapper.
               This function is at the heart of the chained mapping process.
               It retrieves information from the assembly table and
               dynamically constructs the mappings between two coordinate
               systems which are 2 mapping steps apart. It does this by using
               two internal mappers to load up a third mapper which is
               actually used by the ChainedAssemblyMapper to perform the
               mapping.
               This method must be called before any mapping is
               attempted on regions of interest, otherwise only gaps will
               be returned.  Note that the ChainedAssemblyMapper automatically
               calls this method when the need arises.
  Returntype : none
  Exceptions : throw if the seq_region to be registered does not exist
               or if it associated with multiple assembled pieces (bad data
               in assembly table)
               throw if the mapping between the coordinate systems cannot
               be performed in two steps, which means there is an internal
               error in the data in the meta table or in the code that creates
               the mapping paths.
  Caller     : Bio::EnsEMBL::AssemblyMapper
  Status     : Stable
 
Code:
click to view
public void Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::register_component ( )
  Arg [1]    : Bio::EnsEMBL::AssemblyMapper $asm_mapper
               A valid AssemblyMapper object
  Arg [2]    : integer $cmp_seq_region
               The dbID of the seq_region to be registered
  Description: Declares a component region to the AssemblyMapper.
               This extracts the relevant data from the assembly
               table and stores it in Mapper internal to the $asm_mapper.
               It therefore must be called before any mapping is
               attempted on that region. Otherwise only gaps will
               be returned.  Note that the AssemblyMapper automatically
               calls this method when the need arises.
  Returntype : none
  Exceptions : throw if the seq_region to be registered does not exist
               or if it associated with multiple assembled pieces (bad data
               in assembly table)
  Caller     : Bio::EnsEMBL::AssemblyMapper
  Status     : Stable
 
Code:
click to view
public Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::register_contig ( )
  Description:

Deprecated:
use register_component instead
 
Code:
click to view
public Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::register_region ( )
  Description:

Deprecated:
use register_assembled instead
 
Code:
click to view
public Listref Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::seq_ids_to_regions ( )
  Arg [1]    : listref of   seq_region ids
  Example    : my @ids = @{$asma->ids_to_seq_regions(\@seq_ids)};
  Description: Converts a list of seq_region ids to seq region names
               using the internal cache that has accumulated while registering
               regions for AssemblyMappers. If any requested regions are
               not  found in the cache an attempt is made to retrieve them
               from the database.
  Returntype : listref of strings
  Exceptions : throw if a non-existant seq_region_id is provided
  Caller     : general
  Status     : Stable
 
Code:
click to view
public Listref Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::seq_regions_to_ids ( )
  Arg [1]    : Bio::EnsEMBL::CoordSystem $coord_system
  Arg [2]    : listref of strings $seq_regions
  Example    : my @ids = @{$asma->seq_regions_to_ids($coord_sys, \@seq_regs)};
  Description: Converts a list of seq_region names to internal identifiers
               using the internal cache that has accumulated while registering
               regions for AssemblyMappers. If any requested regions are
               not  found in the cache an attempt is made to retrieve them
               from the database.
  Returntype : listref of ints
  Exceptions : throw if a non-existant seqregion is provided
  Caller     : general
  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

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