Archive Ensembl HomeArchive Ensembl Home
Bio::EnsEMBL::Mapper::RangeRegistry Class Reference

List of all members.


Class Summary

Synopsis

  use Bio::EnsEMBL::Mapper::RangeRegistry;

  $rr = Bio::EnsEMBL::Mapper::RangeRegistry-\>new();

  # Get a fixed width chunk around the range of intereset.  This
  # will be used if any registration is actually necessary.
  $chunk_start = ( $start \>\> 20 ) \<\< 20 + 1;
  $chunk_end = ( ( $end \>\> 20 ) + 1 ) \<\< 20;

  # Check if any registration is necessary for the range.  If it is
  # register a large chunked area instead and return a listref of
  # unregistered areas that need to be loaded.
  if (
    $pairs = $rr-\>check_and_register(
      $id, $start, $end, $chunk_start, $chunk_end
    ) )
  {
    foreach my $pair (@$pairs) {
      my ( $pair_start, $pair_end ) = @$pair;
      # Fetch mappings for these regions from the assembly table and
      # load them into the mapper.
      ...;
    }
  } else {
    # The range ($start - $end) is already registered
    ...;
  }

  # Check if any registration is necessary.  If it is register the
  # region and return a listref of pairs that need to be loaded.
  if ( $pairs = $rr-\>check_and_register( $id, $start, $end ) ) {
    ...;
  }

Description

This module maintains an internal list of registered regions and is
used to quickly ascertain if and what regions of a provided range need
registration.
 

Definition at line 51 of file RangeRegistry.pm.

Available Methods

public Undef check_and_register ()
public flush ()
public get_ranges ()
public
Bio::EnsEMBL::Mapper::RangeRegistry 
new ()
public Int overlap_size ()

Method Documentation

public Undef Bio::EnsEMBL::Mapper::RangeRegistry::check_and_register ( )
  Arg [1]    : string $id
               The id of the range to be checked/registered (e.g. a sequenceid)
  Arg [2]    : int $start
               The start of the range to be checked
  Arg [3]    : int $end
               The end of the range to be checked
  Arg [4]    : (optional) int $rstart
               The start of the range to be registered
               if the checked range was not fully registered
  Arg [5]    : (optional) int $rend
               The end of the range to be registerd
               if the checked range was not fully registered
  Example    : $ranges=$rr->check_and_register('X',500,600, 1,1_000_000));
  Description: Checks the range registry to see if the entire range
               denoted by ($id : $start-$end) is already registered.  If
               it already is, then undef is returned.  If it is not then
               the range specified by $rstart and $rend is registered, and
               a list of regions that were required to completely register
               $rstart-$rend is returned.  If $rstart and $rend are not
               defined they default to $start and $end respectively.
               The reason there is a single call to do both the checking and
               registering is to reduce the overhead. Much of the work to
               check if a range is registered is the same as registering a
               region around that range.
  Returntype : undef or listref of [start,end] range pairs
  Exceptions : throw if rstart is greater than start
               throw if rend is less than end
               throw if end is less than start
               throw if id, start, or end are not defined
  Caller     : AssemblyMapperAdaptor
  Status     : Stable
 
Code:
click to view
public Bio::EnsEMBL::Mapper::RangeRegistry::flush ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Mapper::RangeRegistry::get_ranges ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Mapper::RangeRegistry Bio::EnsEMBL::Mapper::RangeRegistry::new ( )
  Arg [1]    : none
  Example    : my $rr = Bio::EnsEMBL::Mapper::RangeRegistry->new();
  Description: Creates a new RangeRegistry object
  Returntype : Bio::EnsEMBL::Mapper::RangeRegistry
  Exceptions : none
  Caller     : AssemblyMapperAdaptor
  Status     : Stable
 
Code:
click to view
public Int Bio::EnsEMBL::Mapper::RangeRegistry::overlap_size ( )
  Arg [1]    : string $id
  Arg [2]    : int $start
  Arg [3]    : int $end
  Example    : my $overlap_size = $rr->( "chr1", 1, 100_000_000 )
  Description: finds out how many bases of the given range are registered
  Returntype : int
  Exceptions : none
  Caller     : general
  Status     : Stable
 
Code:
click to view

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