ensembl-hive  2.7.0
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor Class Reference
+ Inheritance diagram for Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor:

Public Member Functions

public Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor new ()
 
public cache_seq_ids_with_mult_assemblys ()
 
public Bio::EnsEMBL::AssemblyMapper fetch_by_CoordSystems ()
 
public void register_assembled ()
 
protected _seq_region_name_to_id ()
 
protected _seq_region_id_to_name ()
 
public void register_component ()
 
public void register_chained ()
 
protected void _register_chained_special ()
 
public void register_all ()
 
public void register_all_chained ()
 
protected _build_combined_mapper ()
 
public Listref seq_regions_to_ids ()
 
public Listref seq_ids_to_regions ()
 
public void delete_cache ()
 
- Public Member Functions inherited from Bio::EnsEMBL::DBSQL::BaseAdaptor
public Bio::EnsEMBL::DBSQL::BaseAdaptor new ()
 
public DBI::StatementHandle prepare ()
 
public Bio::EnsEMBL::DBSQL::DBAdaptor db ()
 
public Bio::EnsEMBL::DBSQL::DBConnection dbc ()
 
public Boolean is_multispecies ()
 
public Int species_id ()
 
protected _list_dbIDs ()
 
protected _straight_join ()
 
protected _can_straight_join ()
 
public Listref bind_param_generic_fetch ()
 
protected _bind_param_generic_fetch ()
 
public String generate_in_constraint ()
 
public Listref generic_fetch ()
 
public Int generic_count ()
 
protected _generate_sql ()
 
public Bio::EnsEMBL::Feature fetch_by_dbID ()
 
protected _uncached_fetch_by_dbID ()
 
public Listref fetch_all_by_dbID_list ()
 
protected _uncached_fetch_all_by_dbID_list ()
 
protected ArrayRef _uncached_fetch_all_by_id_list ()
 
public fetch_all ()
 
public Scalar last_insert_id ()
 
public insert_ignore_clause ()
 
protected Bio::EnsEMBL::DBSQL::Support::BaseCache _id_cache ()
 
protected Boolean _no_id_cache ()
 
public Boolean ignore_cache_override ()
 
public Int schema_version ()
 
protected _tables ()
 
protected _columns ()
 
protected _default_where_clause ()
 
protected _left_join ()
 
protected _final_clause ()
 
protected _objs_from_sth ()
 
protected _build_id_cache ()
 
protected _logic_name_to_constraint ()
 

Detailed Description

Synopsis

-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.

Member Function Documentation

◆ _build_combined_mapper()

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

Undocumented method

Code:
click to view

◆ _register_chained_special()

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

◆ _seq_region_id_to_name()

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

Undocumented method

Code:
click to view

◆ _seq_region_name_to_id()

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

Undocumented method

Code:
click to view

◆ cache_seq_ids_with_mult_assemblys()

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

◆ delete_cache()

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

◆ fetch_by_CoordSystems()

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

◆ new()

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

◆ register_all()

public void Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::register_all ( )
  Arg [1]    : Bio::EnsEMBL::AssemblyMapper $mapper
  Example    :
$mapper = $asm_mapper_adaptor->fetch_by_CoordSystems($cs1,$cs2);
@verbatim
# 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);
...
@endverbatim
  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

◆ register_all_chained()

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);
@verbatim
# 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);
...
@endverbatim
  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

◆ register_assembled()

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

◆ register_chained()

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

◆ register_component()

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

◆ seq_ids_to_regions()

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

◆ seq_regions_to_ids()

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

The documentation for this class was generated from the following file:
Bio::EnsEMBL::Registry::get_adaptor
public Adaptor get_adaptor()
Bio::EnsEMBL::AssemblyMapper
Definition: AssemblyMapper.pm:49
map
public map()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::delete_cache
public void delete_cache()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::register_assembled
public void register_assembled()
Bio::EnsEMBL::ChainedAssemblyMapper
Definition: ChainedAssemblyMapper.pm:54
Bio::EnsEMBL::Registry
Definition: Registry.pm:113
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::register_all
public void register_all()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::cache_seq_ids_with_mult_assemblys
public cache_seq_ids_with_mult_assemblys()
Bio::EnsEMBL::TopLevelAssemblyMapper
Definition: TopLevelAssemblyMapper.pm:40
Bio::EnsEMBL::AssemblyMapper::new
public Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor new()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::fetch_by_CoordSystems
public Bio::EnsEMBL::AssemblyMapper fetch_by_CoordSystems()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::seq_regions_to_ids
public Listref seq_regions_to_ids()
Bio::EnsEMBL::Registry::load_registry_from_db
public Int load_registry_from_db()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::_register_chained_special
protected void _register_chained_special()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::register_component
public void register_component()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::seq_ids_to_regions
public Listref seq_ids_to_regions()
Bio::EnsEMBL::TopLevelAssemblyMapper::new
public Bio::EnsEMBL::DBSQL::TopLevelAssemblyMapper new()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::_build_combined_mapper
protected _build_combined_mapper()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::register_chained
public void register_chained()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::register_all_chained
public void register_all_chained()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::_seq_region_name_to_id
protected _seq_region_name_to_id()
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor::_seq_region_id_to_name
protected _seq_region_id_to_name()
Bio::EnsEMBL::ChainedAssemblyMapper::new
public Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor new()