Archive Ensembl HomeArchive Ensembl Home
Bio::EnsEMBL::AssemblyMapper Class Reference

List of all members.


Class Summary

Synopsis

    $db   = Bio::EnsEMBL::DBSQL::DBAdaptor-\>new(...);
    $asma = $db-\>get_AssemblyMapperAdaptor();
    $csa  = $db-\>get_CoordSystemAdaptor();

    my $chr_cs = $cs_adaptor-\>fetch_by_name( 'chromosome', 'NCBI33' );
    my $ctg_cs = $cs_adaptor-\>fetch_by_name('contig');

    $asm_mapper = $map_adaptor-\>fetch_by_CoordSystems( $cs1, $cs2 );

    # Map to contig coordinate system from chromosomal.
    @ctg_coords =
      $asm_mapper-\>map( 'X', 1_000_000, 2_000_000, 1, $chr_cs );

    # Map to chromosome coordinate system from contig.
    @chr_coords =
      $asm_mapper-\>map( 'AL30421.1.200.92341', 100, 10000, -1,
      $ctg_cs );

    # List contig names for a region of chromsome.
    @ctg_ids = $asm_mapper-\>list_ids( '13', 1_000_000, 1, $chr_cs );

    # List chromosome names for a contig region.
    @chr_ids =
      $asm_mapper-\>list_ids( 'AL30421.1.200.92341', 1, 1000, -1,
      $ctg_cs );

Description

The AssemblyMapper is a database aware mapper which faciliates
conversion of coordinates between any two coordinate systems with an
relationship explicitly defined in the assembly table.  In the future
it may be possible to perform multiple step (implicit) mapping between
coordinate systems.
It is implemented using the Bio::EnsEMBL::Mapper object, which is a
generic mapper object between disjoint coordinate systems.
 

Definition at line 48 of file AssemblyMapper.pm.

Available Methods

public
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor 
adaptor ()
public Bio::EnsEMBL::CoordSystem assembled_CoordSystem ()
public Bio::EnsEMBL::CoordSystem component_CoordSystem ()
public fast_to_assembly ()
public List fastmap ()
public void flush ()
public Boolean have_registered_assembled ()
public Boolean have_registered_component ()
public in_assembly ()
public list_contig_ids ()
public List list_ids ()
public List list_seq_regions ()
public List map ()
public map_coordinates_to_assembly ()
public map_coordinates_to_rawcontig ()
public Bio::EnsEMBL::Mapper mapper ()
public Int max_pair_count ()
public
Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor 
new ()
public void register_all ()
public void register_assembled ()
public void register_component ()
public Int size ()

Method Documentation

public Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor Bio::EnsEMBL::AssemblyMapper::adaptor ( )
  Arg [1]    : Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor $adaptor
  Example    : None
  Description: Getter/set terfor this object's database adaptor.
  Returntype : Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor
  Exceptions : None
  Caller     : General
  Status     : Stable
 
Code:
click to view
public Bio::EnsEMBL::CoordSystem Bio::EnsEMBL::AssemblyMapper::assembled_CoordSystem ( )
  Arg [1]    : None
  Example    : $cs = $asm_mapper->assembled_CoordSystem();
  Description: Retrieves the assembled CoordSystem from this
               assembly mapper.
  Return type: Bio::EnsEMBL::CoordSystem
  Exceptions : None
  Caller     : Internal, AssemblyMapperAdaptor
  Status     : Stable
 
Code:
click to view
public Bio::EnsEMBL::CoordSystem Bio::EnsEMBL::AssemblyMapper::component_CoordSystem ( )
  Arg [1]    : None
  Example    : $cs = $asm_mapper->component_CoordSystem();
  Description: Retrieves the component CoordSystem from this
               assembly mapper.
  Return type: Bio::EnsEMBL::CoordSystem
  Exceptions : None
  Caller     : Internal, AssemblyMapperAdaptor
  Status     : Stable
 
Code:
click to view
public Bio::EnsEMBL::AssemblyMapper::fast_to_assembly ( )
  Description:

Deprecated:
, use map() instead.
 
Code:
click to view
public List Bio::EnsEMBL::AssemblyMapper::fastmap ( )
  Arg [1]    : string $frm_seq_region
               The name of the sequence region to transform FROM.
  Arg [2]    : int $frm_start
               The start of the region to transform FROM.
  Arg [3]    : int $frm_end
               The end of the region to transform FROM.
  Arg [4]    : int $strand
               The strand of the region to transform FROM.
  Arg [5]    : Bio::EnsEMBL::CoordSystem
               The coordinate system to transform FROM.
  Example    : @coords =
                $asm_mapper->map( 'X', 1_000_000, 2_000_000, 1,
                                  $chr_cs );
  Description: Transforms coordinates from one coordinate system to
               another.
  Return type: List of Bio::EnsEMBL::Mapper::Coordinate and/or
               Bio::EnsEMBL::Mapper:Gap objects.
  Exceptions : Throws if the specified TO coordinat system is not
               one of the coordinate systems associated with this
               assembly mapper.
  Caller     : General
  Status     : Stable
 
Code:
click to view
public void Bio::EnsEMBL::AssemblyMapper::flush ( )
  Args       : None
  Example    : None
  Description: Remove all cached items from this AssemblyMapper.
  Return type: None
  Exceptions : None
  Caller     : AssemblyMapperAdaptor
  Status     : Stable
 
Code:
click to view
public Boolean Bio::EnsEMBL::AssemblyMapper::have_registered_assembled ( )
  Arg [1]    : string $asm_seq_region
               The name of the sequence region to check for
               registration.
  Arg [2]    : int $chunk_id
               The chunk number of the provided seq_region to check
               for registration.
  Example    : if ( $asm_mapper->have_registered_component( 'X', 9 ) ) { }
  Description: Returns true if a given assembled region chunk
               has been registered with this assembly mapper.
               This should only be called by this class or the
               AssemblyMapperAdaptor.  In other words, do not use
               this method unless you really know what you are
               doing.
  Return type: Boolean (0 or 1)
  Exceptions : Throws on incorrect arguments
  Caller     : Internal, AssemblyMapperAdaptor
  Status     : Stable
 
Code:
click to view
public Boolean Bio::EnsEMBL::AssemblyMapper::have_registered_component ( )
  Arg [1]    : string $cmp_seq_region
               The name of the sequence region to check for
               registration.
  Example    : if ( $asm_mapper->have_registered_component('AL240214.1') ) {}
  Description: Returns true if a given component region has
               been registered with this assembly mapper.  This
               should only be called by this class or the
               AssemblyMapperAdaptor.  In other words, do not use
               this method unless you really know what you are
               doing.
  Return type: Boolean (0 or 1)
  Exceptions : Throws on incorrect arguments.
  Caller     : Internal, AssemblyMapperAdaptor
  Status     : Stable
 
Code:
click to view
public Bio::EnsEMBL::AssemblyMapper::in_assembly ( )
  Description:

Deprecated:
, use map() or list_ids() instead.
 
Code:
click to view
public Bio::EnsEMBL::AssemblyMapper::list_contig_ids ( )
  Description:

Deprecated:
, use list_ids() instead.
 
Code:
click to view
public List Bio::EnsEMBL::AssemblyMapper::list_ids ( )
  Arg [1]    : string $frm_seq_region
               The name of the sequence region of interest.
  Arg [2]    : int $frm_start
               The start of the region of interest.
  Arg [3]    : int $frm_end
               The end of the region to transform of interest.
  Arg [5]    : Bio::EnsEMBL::CoordSystem $frm_cs
               The coordinate system to obtain overlapping IDs of.
  Example    : foreach my $id (
                        $asm_mapper->list_ids( 'X', 1, 1000, $ctg_cs ) )
                { ... }
  Description: Retrieves a list of overlapping seq_region names of
               another coordinate system.  This is the same as the
               list_ids method but uses seq_region names rather
               internal IDs.
  Return type: List of strings.
  Exceptions : None
  Caller     : General
  Status     : Stable
 
Code:
click to view
public List Bio::EnsEMBL::AssemblyMapper::list_seq_regions ( )
  Arg [1]    : string $frm_seq_region
               The name of the sequence region of interest.
  Arg [2]    : int $frm_start
               The start of the region of interest.
  Arg [3]    : int $frm_end
               The end of the region to transform of interest.
  Arg [5]    : Bio::EnsEMBL::CoordSystem $frm_cs
               The coordinate system to obtain overlapping IDs of.
  Example    : foreach my $id (
                                 $asm_mapper->list_seq_regions(
                                                   'X', 1, 1000, $chr_cs
                                 ) ) { ... }
  Description: Retrieves a list of overlapping seq_region internal
               identifiers of another coordinate system.  This is
               the same as the list_seq_regions method but uses
               internal identfiers rather than seq_region strings.
  Return type: List of ints.
  Exceptions : None
  Caller     : General
  Status     : Stable
 
Code:
click to view
public List Bio::EnsEMBL::AssemblyMapper::map ( )
  Arg [1]    : string $frm_seq_region
               The name of the sequence region to transform FROM.
  Arg [2]    : int $frm_start
               The start of the region to transform FROM.
  Arg [3]    : int $frm_end
               The end of the region to transform FROM.
  Arg [4]    : int $strand
               The strand of the region to transform FROM.
  Arg [5]    : Bio::EnsEMBL::CoordSystem
               The coordinate system to transform FROM
  Example    : @coords =
                $asm_mapper->map( 'X', 1_000_000, 2_000_000, 1,
                                  $chr_cs );
  Description: Transforms coordinates from one coordinate system to
               another.
  Return type: List of Bio::EnsEMBL::Mapper::Coordinate and/or
               Bio::EnsEMBL::Mapper:Gap objects.
  Exceptions : Throws if if the specified TO coordinat system is not
               one of the coordinate systems associated with this
               assembly mapper.
  Caller     : General
  Status     : Stable
 
Code:
click to view
public Bio::EnsEMBL::AssemblyMapper::map_coordinates_to_assembly ( )
  Description:

Deprecated:
, use map() instead.
 
Code:
click to view
public Bio::EnsEMBL::AssemblyMapper::map_coordinates_to_rawcontig ( )
  Description:

Deprecated:
, use map() instead.
 
Code:
click to view
public Bio::EnsEMBL::Mapper Bio::EnsEMBL::AssemblyMapper::mapper ( )
  Arg [1]    : None
  Example    : $mapper = $asm_mapper->mapper();
  Description: Retrieves the internal mapper used by this Assembly
               Mapper.  This is unlikely to be useful unless you
               _really_ know what you are doing.
  Return type: Bio::EnsEMBL::Mapper
  Exceptions : None
  Caller     : Internal, AssemblyMapperAdaptor
  Status     : Stable
 
Code:
click to view
public Int Bio::EnsEMBL::AssemblyMapper::max_pair_count ( )
  Arg [1]    : (optional) int $max_pair_count
  Example    : $mapper->max_pair_count(100000)
  Description: Getter/Setter for the number of mapping pairs allowed
               in the internal cache.  This can be used to override
               the default value (1000) to tune the performance and
               memory usage for certain scenarios.  Higher value
               means bigger cache, more memory used.
  Return type: int
  Exceptions : None
  Caller     : General
  Status     : Stable
 
Code:
click to view
public Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor Bio::EnsEMBL::AssemblyMapper::new ( )
  Arg [1]    : Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor
  Arg [2]    : Bio::EnsEMBL::CoordSystem $asm_cs
  Arg [3]    : Bio::EnsEMBL::CoordSystem $cmp_cs
  Example    : Should use AssemblyMapperAdaptor->fetch_by_CoordSystems()
  Description: Creates a new AssemblyMapper
  Returntype : Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor
  Exceptions : Throws if multiple coord_systems are provided
  Caller     : AssemblyMapperAdaptor
  Status     : Stable
 
Code:
click to view
public void Bio::EnsEMBL::AssemblyMapper::register_all ( )
  Arg [1]    : None
  Example    : $mapper->max_pair_count(10e6);
               $mapper->register_all();
  Description: Pre-registers all assembly information in this
               mapper.  The cache size should be set to a
               sufficiently large value so that all of the
               information can be stored.  This method is useful
               when *a lot* of mapping will be done in regions
               which are distributed around the genome.  After
               registration the mapper will consume a lot of memory
               but will not have to perform any SQL and will be
               faster.
  Return type: None
  Exceptions : None
  Caller     : Specialised programs doing a lot of mapping.
  Status     : Stable
 
Code:
click to view
public void Bio::EnsEMBL::AssemblyMapper::register_assembled ( )
  Arg [1]    : integer $asm_seq_region
               The dbID of the sequence region to register.
  Arg [2]    : int $chunk_id
               The chunk number of the provided seq_region to register.
  Example    : $asm_mapper->register_assembled( 'X', 4 );
  Description: Flags a given assembled region as registered in this
               assembly mapper.  This should only be called by this
               class or the AssemblyMapperAdaptor.  Do not call this
               method unless you really know what you are doing.
  Return type: None
  Exceptions : Throws on incorrect arguments
  Caller     : Internal, AssemblyMapperAdaptor
  Status     : Stable
 
Code:
click to view
public void Bio::EnsEMBL::AssemblyMapper::register_component ( )
  Arg [1]    : integer $cmp_seq_region
               The dbID of the component sequence region to
               register.
  Example    : $asm_mapper->register_component('AL312341.1');
  Description: Flags a given component sequence region as registered
               in this assembly mapper.  This should only be called
               by this class or the AssemblyMapperAdaptor.
  Return type: None
  Exceptions : Throws on incorrect arguments
  Caller     : Internal, AssemblyMapperAdaptor
  Status     : Stable
 
Code:
click to view
public Int Bio::EnsEMBL::AssemblyMapper::size ( )
  Args       : None
  Example    : $num_of_pairs = $mapper->size();
  Description: Returns the number of pairs currently stored.
  Return type: int
  Exceptions : None
  Caller     : General
  Status     : Stable
 
Code:
click to view

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