ensembl-hive  2.6
Bio::EnsEMBL::MappedSlice Class Reference

Public Member Functions

public Bio::EnsEMBL::MappedSlice new ()
 
public Listref add_Slice_Mapper_pair ()
 
public Listref get_all_Slice_Mapper_pairs ()
 
public Adaptor adaptor ()
 
public Bio::EnsEMBL::MappedSliceContainer container ()
 
public String name ()
 
public String seq_region_name ()
 
public Int start ()
 
public Int end ()
 
public Int strand ()
 
public Int length ()
 
public Int seq_region_length ()
 
public Int centrepoint ()
 
public Bio::EnsEMBL::CoordSystem coord_system ()
 
public Int coord_system_name ()
 
public Int is_toplevel ()
 
public String seq ()
 
public subseq ()
 
public get_repeatmasked_seq ()
 
public sub_MappedSlice ()
 
public project ()
 
public Listref AUTOLOAD ()
 

Detailed Description

Synopsis

# get a reference slice
my $slice =
$slice_adaptor->fetch_by_region( 'chromosome', 14, 900000, 950000 );
# create MappedSliceContainer based on the reference slice
my $msc = Bio::EnsEMBL::MappedSliceContainer->new( -SLICE => $slice );
# set the adaptor for fetching AssemblySlices
my $asa = $slice->adaptor->db->get_AssemblySliceAdaptor;
$msc->set_AssemblySliceAdaptor($asa);
# add an AssemblySlice to your MappedSliceContainer
$msc->attach_AssemblySlice('NCBIM36');
foreach my $mapped_slice ( @{ $msc->get_all_MappedSlices } ) {
print $mapped_slice->name, "\n";
foreach my $sf ( @{ $mapped_slice->get_all_SimpleFeatures } ) {
print " ", &to_string($sf), "\n";
}
}

Description

NOTE: this code is under development and not fully functional nor tested
yet.  Use only for development.

This object represents a mapped slice, i.e. a slice that's attached
to a reference slice and a mapper to convert coordinates to/from the
reference. The attachment is done via a MappedSliceContainer which
has the reference slice and the "container slice" defining the common
coordinate system for all MappedSlices.

A MappedSlice is supposed to behave as close to a Bio::EnsEMBL::Slice
as possible. Most Slice methods are implemented in MappedSlice and will
return an equivalent value to what Slice does. There are some exceptions
of unimplemented methods, either because there is no useful equivalent
for a MappedSlice to do, or they are too complicated.

Not supported Bio::EnsEMBL::Slice methods:

  All Bio::PrimarySeqI compliance methods
  expand
  get_generic_features
  get_seq_region_id
  seq_region_Slice

Not currently supported but maybe should/could:

  calculate_pi
  calculate_theta
  get_base_count
  get_by_Individual
  get_by_strain
  invert

Internally, a MappedSlice is a collection of Bio::EnsEMBL::Slices and
associated Bio::EnsEMBL::Mappers which map the slices to the common
container coordinate system.

MappedSlices are usually created and attached to a MappedSliceContainer
by an adaptor/factory.

Definition at line 75 of file MappedSlice.pm.

Member Function Documentation

◆ adaptor()

public Adaptor Bio::EnsEMBL::MappedSlice::adaptor ( )
  Arg[1]      : (optional) Adaptor $adaptor - the adaptor/factory for this
                object
  Example     :
$mapped_slice->adaptor($assembly_slice_adaptor);
  Description : Getter/setter for the adaptor/factory for this object.
  Return type : Adaptor of appropriate type
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ add_Slice_Mapper_pair()

public Listref Bio::EnsEMBL::MappedSlice::add_Slice_Mapper_pair ( )
  Arg[1]      : Bio::EnsEMBL::Slice $slice - slice to add
  Arg[2]      : Bio::EnsEMBL::Mapper $mapper - the mapper for this slice
  Example     :
$mapped_slice->add_Slice_Mapper_pair($slice, $mapper);
  Description : Adds a native slice and a corresponding mapper to map to/from
                the artificial container coord system.
  Return type : listref of Bio::EnsEMBL::MappedSlice
  Exceptions  : thrown on wrong or missing arguments
  Caller      : general, MappedSlice adaptors
  Status      : At Risk
              : under development
 
Code:
click to view

◆ AUTOLOAD()

public Listref Bio::EnsEMBL::MappedSlice::AUTOLOAD ( )
  Arg[1..N]   : Arguments passed on to the calls on the underlying slices.
  Example     :
my @simple_features = @{ $mapped_slice->get_all_SimpleFeatures };
  Description : Aggregate data gathered from composing Slices.
                This will call Slice->get_all_* and combine the results.
                Coordinates will be transformed to be on the container slice
                coordinate system.
                Calls involving DAS features are skipped since the DAS adaptor
                handles coordinate conversions natively.
  Return type : listref of features (same type as corresponding Slice method)
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ centrepoint()

public Int Bio::EnsEMBL::MappedSlice::centrepoint ( )
  Example     :
my $centrepoint = $mapped_slice->centrepoint;
  Description : Returns the centrepoint of the container slice.
  Return type : Int
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ container()

public Bio::EnsEMBL::MappedSliceContainer Bio::EnsEMBL::MappedSlice::container ( )
  Arg[1]      : (optional) Bio::EnsEMBL::MappedSliceContainer - the container
                this object is attached to
  Example     :
my $container = $mapped_slice->container;
print $container->ref_slice->name, "\n";
  Description : Getter/setter for the container this object is attached to. The
                container will give you access to the reference slice, a common
                artificial container slice, and a mapper to map to it from the
                container coord system.
                The implementation uses a weak reference to attach the container
                since the container holds a list of MappedSlices itself.
  Return type : Bio::EnsEMBL::MappedSliceContainer
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ coord_system()

public Bio::EnsEMBL::CoordSystem Bio::EnsEMBL::MappedSlice::coord_system ( )
  Example     :
my $cs = $mapped_slice->coord_system;
  Description : Returns the coord system of the container slice.
  Return type : Bio::EnsEMBL::CoordSystem
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ coord_system_name()

public Int Bio::EnsEMBL::MappedSlice::coord_system_name ( )
  Example     :
my $cs_name = $mapped_slice->coord_system_name;
  Description : Returns the coord system name of the container slice.
  Return type : Int
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ end()

public Int Bio::EnsEMBL::MappedSlice::end ( )
  Example     :
my $end = $mapped_slice->end;
  Description : Returns the end of the container slice.
  Return type : Int
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ get_all_Slice_Mapper_pairs()

public Listref Bio::EnsEMBL::MappedSlice::get_all_Slice_Mapper_pairs ( )
  Example     :
foreach my $pair (@{ $self->get_all_Slice_Mapper_pairs }) {
my ($slice, $mapper) = @$pair;
@section autotoc_md18 get container coordinates
my @coords = $mapper->map_coordinates(
$slice->seq_region_name,
$slice->start,
$slice->end,
$slice->strand,
'mapped_slice'
);
@section autotoc_md19 ....
}
  Description : Gets all Slice/Mapper pairs this MappedSlice is composed of.
                Each slice (and features on it) can be mapped onto the
                artificial container coord system using the mapper.
  Return type : listref of listref of a Bio::EnsEMBL::Slice and
                Bio::EnsEMBL::Mapper pair
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ get_repeatmasked_seq()

public Bio::EnsEMBL::MappedSlice::get_repeatmasked_seq ( )

Undocumented method

Code:
click to view

◆ is_toplevel()

public Int Bio::EnsEMBL::MappedSlice::is_toplevel ( )
  Example     :
my $toplevel_flag = $mapped_slice->is_toplevel;
  Description : Returns weather the container slice is toplevel.
  Return type : Int
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ length()

public Int Bio::EnsEMBL::MappedSlice::length ( )
  Example     :
my $length = $mapped_slice->length;
  Description : Returns the length of the container slice
  Return type : Int
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ name()

public String Bio::EnsEMBL::MappedSlice::name ( )
  Arg[1]      : String - the name of this object
  Example     :
my $name = $mapped_slice->container->ref_slice->name .
":mapped_" . $ident_string;
$mapped_slice->name($name);
  Description : Getter/setter for this object's name
  Return type : String
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ new()

public Bio::EnsEMBL::MappedSlice Bio::EnsEMBL::MappedSlice::new ( )
  Arg [ADAPTOR]   : Adaptor $adaptor - an adaptor of the appropriate type
  Arg [CONTAINER] : Bio::EnsEMBL::MappedSliceContainer $container - the
                    container this MappedSlice is attached to
  Arg [NAME]      : String $name - name
  Example     :
my $mapped_slice = Bio::EnsEMBL::MappedSlice->new(
-ADAPTOR => $adaptor,
-CONTAINER => $container,
-NAME => $name,
);
  Description : Constructor. Usually you won't call this method manually, but
                the MappedSlice will be constructed by an adaptor/factory.
  Return type : Bio::EnsEMBL::MappedSlice
  Exceptions  : thrown on wrong or missing arguments
  Caller      : general, MappedSlice adaptors
  Status      : At Risk
              : under development
 
Code:
click to view

◆ project()

public Bio::EnsEMBL::MappedSlice::project ( )

Undocumented method

Code:
click to view

◆ seq()

public String Bio::EnsEMBL::MappedSlice::seq ( )
  Example     :
my $seq = $mapped_slice->seq()
  Description : Retrieves the expanded sequence of this mapped slice,
                including "-" characters where there are inserts in any other
                mapped slices. This will align with the sequence returned by
                the container's seq() method.
  Return type : String
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ seq_region_length()

public Int Bio::EnsEMBL::MappedSlice::seq_region_length ( )
  Example     :
my $sr_length = $mapped_slice->seq_region_length;
  Description : Returns the seq_region length of the reference slice.
  Return type : Int
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ seq_region_name()

public String Bio::EnsEMBL::MappedSlice::seq_region_name ( )
  Example     :
my $sr_name = $mapped_slice->seq_region_name;
  Description : Returns the seq_region name of the reference slice.
  Return type : String
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ start()

public Int Bio::EnsEMBL::MappedSlice::start ( )
  Example     :
my $start = $mapped_slice->start;
  Description : Returns the start of the container slice.
  Return type : Int
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ strand()

public Int Bio::EnsEMBL::MappedSlice::strand ( )
  Example     :
my $strand = $mapped_slice->strand;
  Description : Returns the strand of the container slice.
  Return type : Int
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ sub_MappedSlice()

public Bio::EnsEMBL::MappedSlice::sub_MappedSlice ( )

Undocumented method

Code:
click to view

◆ subseq()

public Bio::EnsEMBL::MappedSlice::subseq ( )

Undocumented method

Code:
click to view

The documentation for this class was generated from the following file:
Bio::EnsEMBL::MappedSlice::start
public Int start()
Bio::EnsEMBL::MappedSlice::adaptor
public Adaptor adaptor()
Bio::EnsEMBL::MappedSlice::seq
public String seq()
Bio::EnsEMBL::MappedSlice::add_Slice_Mapper_pair
public Listref add_Slice_Mapper_pair()
Bio::EnsEMBL::MappedSliceContainer::get_AssemblySliceAdaptor
public Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor get_AssemblySliceAdaptor()
Bio::EnsEMBL::MappedSlice::get_all_Slice_Mapper_pairs
public Listref get_all_Slice_Mapper_pairs()
Bio::EnsEMBL::MappedSlice::coord_system_name
public Int coord_system_name()
Bio::EnsEMBL::MappedSlice::length
public Int length()
Bio::EnsEMBL::MappedSlice::centrepoint
public Int centrepoint()
Bio::EnsEMBL::MappedSlice::AUTOLOAD
public Listref AUTOLOAD()
Bio::EnsEMBL::MappedSlice::coord_system
public Bio::EnsEMBL::CoordSystem coord_system()
Bio::EnsEMBL::MappedSlice
Definition: MappedSlice.pm:75
Bio::EnsEMBL::MappedSlice::new
public Bio::EnsEMBL::MappedSlice new()
Bio::EnsEMBL::MappedSlice::sub_MappedSlice
public sub_MappedSlice()
Bio::EnsEMBL::MappedSlice::get_repeatmasked_seq
public get_repeatmasked_seq()
Bio::EnsEMBL::MappedSlice::seq_region_length
public Int seq_region_length()
Bio::EnsEMBL::MappedSliceContainer
Definition: MappedSliceContainer.pm:62
Bio::EnsEMBL::MappedSliceContainer::new
public Bio::EnsEMBL::MappedSliceContainer new()
Bio::EnsEMBL::MappedSlice::strand
public Int strand()
Bio::EnsEMBL::MappedSlice::name
public String name()
Bio::EnsEMBL::MappedSlice::container
public Bio::EnsEMBL::MappedSliceContainer container()
Bio::EnsEMBL::MappedSlice::end
public Int end()
Bio::EnsEMBL::MappedSlice::project
public project()
Bio::EnsEMBL::MappedSlice::subseq
public subseq()
Bio::EnsEMBL::MappedSlice::seq_region_name
public String seq_region_name()
Bio::EnsEMBL::MappedSlice::is_toplevel
public Int is_toplevel()