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

Public Member Functions

public Bio::EnsEMBL::MappedSliceContainer new ()
 
protected _create_container_slice ()
 
public Same set_adaptor ()
 
public An get_adaptor ()
 
public Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor set_AssemblySliceAdaptor ()
 
public Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor get_AssemblySliceAdaptor ()
 
public set_AlignSliceAdaptor ()
 
public get_AlignSliceAdaptor ()
 
public set_StrainSliceAdaptor ()
 
public get_StrainSliceAdaptor ()
 
public void attach_AssemblySlice ()
 
public void attach_StrainSlice ()
 
public Listref get_all_MappedSlices ()
 
public sub_MappedSliceContainer ()
 
public Bio::EnsEMBL::Slice ref_slice ()
 
public Bio::EnsEMBL::Slice container_slice ()
 
public Bio::EnsEMBL::Mapper mapper ()
 
public Boolean expanded ()
 
public String seq ()
 

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.

A MappedSliceContainer holds a collection of one or more
Bio::EnsEMBL::MappedSlices. It is based on a real reference slice and
contains an artificial "container slice" which defines the common
coordinate system used by all attached MappedSlices. There is also a
mapper to convert coordinates between the reference and the container
slice.

Attaching MappedSlices to the container is delegated to adaptors
(which act more as object factories than as traditional Ensembl db
adaptors). The adaptors will also modify the container slice and
associated mapper if required. This design allows us to keep the
MappedSliceContainer generic and encapsulate the data source specific
code in the adaptor/factory module.

In the simplest use case, all required MappedSlices are attached to the
MappedSliceContainer at once (by a single call to the adaptor). This
object should also allow "hot-plugging" of MappedSlices (e.g. attach a
MappedSlice representing a strain to a container that already contains a
multi-species alignment). The methods for attaching new MappedSlice will
be responsable to perform the necessary adjustments to coordinates and
mapper on the existing MappedSlices.

Definition at line 62 of file MappedSliceContainer.pm.

Member Function Documentation

◆ _create_container_slice()

protected Bio::EnsEMBL::MappedSliceContainer::_create_container_slice ( )

Undocumented method

Code:
click to view

◆ attach_AssemblySlice()

public void Bio::EnsEMBL::MappedSliceContainer::attach_AssemblySlice ( )
  Arg[1]      : String $version - assembly version to attach
  Example     :
$msc->attach_AssemblySlice('NCBIM36');
  Description : Attaches a MappedSlice for an alternative assembly to this
                container.
  Return type : none
  Exceptions  : thrown on missing argument
  Caller      : general, Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor
  Status      : At Risk
              : under development
 
Code:
click to view

◆ attach_StrainSlice()

public void Bio::EnsEMBL::MappedSliceContainer::attach_StrainSlice ( )
  Arg[1]      : String $strain - name of strain to attach
  Example     :
$msc->attach_StrainSlice('Watson');
  Description : Attaches a MappedSlice for an alternative strain to this
                container.
  Return type : none
  Exceptions  : thrown on missing argument
  Caller      : general, Bio::EnsEMBL::DBSQL::StrainSliceAdaptor
  Status      : At Risk
              : under development
 
Code:
click to view

◆ container_slice()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::MappedSliceContainer::container_slice ( )
  Arg[1]      : (optional) Bio::EnsEMBL::Slice - the container slice to set
  Example     :
my $container_slice = $mapped_slice_container->container_slice;
print "The common slice used by this MappedSliceContainer is ",
$container_slice->name, "\n";
  Description : Getter/setter for the container slice. This is an artificial
                slice which defines the common coordinate system used by the
                MappedSlices attached to this container.
  Return type : Bio::EnsEMBL::Slice
  Exceptions  : thrown on wrong argument type
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ expanded()

public Boolean Bio::EnsEMBL::MappedSliceContainer::expanded ( )
  Arg[1]      : (optional) Boolean - expanded mode to set
  Example     :
if ($mapped_slice_container->expanded) {
@section autotoc_md20 do more elaborate mapping than in collapsed mode
[...]
}
  Description : Getter/setter for expanded mode.
                By default, MappedSliceContainer use collapsed mode, which
                means that no inserts in the reference sequence are allowed
                when constructing the MappedSlices. in this mode, the
                mapped_slice artificial coord system will be identical with the
                ref_slice coord system.
                By setting expanded mode, you allow inserts in the reference
                sequence.
  Return type : Boolean
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ get_adaptor()

public An Bio::EnsEMBL::MappedSliceContainer::get_adaptor ( )
  Arg[1]      : String $type - the type of adaptor to get
  Example     :
my $assembly_slice_adaptor = $msc->get_adaptor('assembly');
  Description : Parameterisable wrapper for all methods that get adaptors (see
                below).
  Return type : An adaptor for the requested type of MappedSlice.
  Exceptions  : thrown on missing type
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ get_AlignSliceAdaptor()

public Bio::EnsEMBL::MappedSliceContainer::get_AlignSliceAdaptor ( )

Undocumented method

Code:
click to view

◆ get_all_MappedSlices()

public Listref Bio::EnsEMBL::MappedSliceContainer::get_all_MappedSlices ( )
  Example     :
foreach my $mapped_slice (@{ $msc->get_all_MappedSlices }) {
print $mapped_slice->name, "\n";
}
  Description : Returns all MappedSlices attached to this container.
  Return type : listref of Bio::EnsEMBL::MappedSlice
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ get_AssemblySliceAdaptor()

public Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor Bio::EnsEMBL::MappedSliceContainer::get_AssemblySliceAdaptor ( )
  Example     :
my $assembly_slice_adaptor = $msc->get_AssemblySliceAdaptor;
  Description : Gets a AssemblySliceAdaptor from this container. The adaptor can
                be used to attach MappedSlice for alternative assemblies.
  Return type : Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor
  Exceptions  : thrown on wrong or missing argument
  Caller      : general, $self->get_adaptor
  Status      : At Risk
              : under development
 
Code:
click to view

◆ get_StrainSliceAdaptor()

public Bio::EnsEMBL::MappedSliceContainer::get_StrainSliceAdaptor ( )

Undocumented method

Code:
click to view

◆ mapper()

public Bio::EnsEMBL::Mapper Bio::EnsEMBL::MappedSliceContainer::mapper ( )
  Arg[1]      : (optional) Bio::EnsEMBL::Mapper - the mapper to set
  Example     :
my $mapper = Bio::EnsEMBL::Mapper->new('ref', 'mapped');
$mapped_slice_container->mapper($mapper);
  Description : Getter/setter for the mapper to map between reference slice and
                the artificial container coord system.
  Return type : Bio::EnsEMBL::Mapper
  Exceptions  : thrown on wrong argument type
  Caller      : internal, Bio::EnsEMBL::MappedSlice->AUTOLOAD
  Status      : At Risk
              : under development
 
Code:
click to view

◆ new()

public Bio::EnsEMBL::MappedSliceContainer Bio::EnsEMBL::MappedSliceContainer::new ( )
  Arg [SLICE]     : Bio::EnsEMBL::Slice $slice - the reference slice for this
                    container
  Arg [EXPANDED]  : (optional) Boolean $expanded - set expanded mode (default:
                    collapsed)
  Example     :
my $slice = $slice_adaptor->fetch_by_region('chromosome', 1,
9000000, 9500000);
-SLICE => $slice,
-EXPANDED => 1,
);
  Description : Constructor. See the general documentation of this module for 
                details about this object. Note that the constructor creates an
                empty container, so you'll have to attach MappedSlices to it to
                be useful (this is usually done by an adaptor/factory).
  Return type : Bio::EnsEMBL::MappedSliceContainer
  Exceptions  : thrown on wrong or missing argument
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ ref_slice()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::MappedSliceContainer::ref_slice ( )
  Arg[1]      : (optional) Bio::EnsEMBL::Slice - the reference slice to set
  Example     :
my $ref_slice = $mapped_slice_container->ref_slice;
print "This MappedSliceContainer is based on the reference
slice ", $ref_slice->name, "\n";
  Description : Getter/setter for the reference slice.
  Return type : Bio::EnsEMBL::Slice
  Exceptions  : thrown on wrong argument type
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ seq()

public String Bio::EnsEMBL::MappedSliceContainer::seq ( )
  Example     :
my $seq = $container->seq()
  Description : Retrieves the expanded sequence of the artificial container
                slice, including "-" characters where there are inserts in any
                of the attached mapped slices.
  Return type : String
  Exceptions  : none
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ set_adaptor()

public Same Bio::EnsEMBL::MappedSliceContainer::set_adaptor ( )
  Arg[1]      : String $type - the type of adaptor to set
  Arg[2]      : Adaptor $adaptor - the adaptor to set
  Example     :
$msc->set_adaptor('assembly', $adaptor);
  Description : Parameterisable wrapper for all methods that set adaptors (see
                below).
  Return type : same as Arg 2
  Exceptions  : thrown on missing type
  Caller      : general
  Status      : At Risk
              : under development
 
Code:
click to view

◆ set_AlignSliceAdaptor()

public Bio::EnsEMBL::MappedSliceContainer::set_AlignSliceAdaptor ( )

Undocumented method

Code:
click to view

◆ set_AssemblySliceAdaptor()

public Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor Bio::EnsEMBL::MappedSliceContainer::set_AssemblySliceAdaptor ( )
  Arg[1]      : Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor - the adaptor to set
  Example     :
$msc->set_AssemblySliceAdaptor($adaptor);
  Description : Sets an AssemblySliceAdaptor for this container. The adaptor can
                be used to attach MappedSlice for alternative assemblies.
  Return type : Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor
  Exceptions  : thrown on wrong or missing argument
  Caller      : general, $self->get_adaptor
  Status      : At Risk
              : under development
 
Code:
click to view

◆ set_StrainSliceAdaptor()

public Bio::EnsEMBL::MappedSliceContainer::set_StrainSliceAdaptor ( )

Undocumented method

Code:
click to view

◆ sub_MappedSliceContainer()

public Bio::EnsEMBL::MappedSliceContainer::sub_MappedSliceContainer ( )

Undocumented method

Code:
click to view

The documentation for this class was generated from the following file:
Bio::EnsEMBL::MappedSliceContainer::get_all_MappedSlices
public Listref get_all_MappedSlices()
Bio::EnsEMBL::MappedSliceContainer::get_adaptor
public An get_adaptor()
Bio::EnsEMBL::MappedSliceContainer::expanded
public Boolean expanded()
Bio::EnsEMBL::MappedSliceContainer::set_adaptor
public Same set_adaptor()
Bio::EnsEMBL::MappedSliceContainer::get_AssemblySliceAdaptor
public Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor get_AssemblySliceAdaptor()
Bio::EnsEMBL::CoordSystem::new
public Bio::EnsEMBL::CoordSystem new()
Bio::EnsEMBL::MappedSliceContainer::seq
public String seq()
Bio::EnsEMBL::MappedSliceContainer::attach_AssemblySlice
public void attach_AssemblySlice()
Bio::EnsEMBL::MappedSliceContainer::set_AssemblySliceAdaptor
public Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor set_AssemblySliceAdaptor()
Bio::EnsEMBL::CoordSystem
Definition: CoordSystem.pm:40
Bio::EnsEMBL::MappedSliceContainer::mapper
public Bio::EnsEMBL::Mapper mapper()
Bio::EnsEMBL::Slice
Definition: Slice.pm:50
Bio::EnsEMBL::Slice::new
public Bio::EnsEMBL::Slice new()
Bio::EnsEMBL::MappedSliceContainer::container_slice
public Bio::EnsEMBL::Slice container_slice()
Bio::EnsEMBL::MappedSliceContainer
Definition: MappedSliceContainer.pm:62
Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor
Definition: AssemblySliceAdaptor.pm:33
Bio::EnsEMBL::MappedSliceContainer::new
public Bio::EnsEMBL::MappedSliceContainer new()
Bio::EnsEMBL::MappedSliceContainer::ref_slice
public Bio::EnsEMBL::Slice ref_slice()
Bio::EnsEMBL::MappedSliceContainer::get_StrainSliceAdaptor
public get_StrainSliceAdaptor()
Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor::new
public Bio::EnsEMBL::DBSQL::AssemblySliceAdaptor new()
Bio::EnsEMBL::MappedSliceContainer::get_AlignSliceAdaptor
public get_AlignSliceAdaptor()
Bio::EnsEMBL::MappedSliceContainer::set_StrainSliceAdaptor
public set_StrainSliceAdaptor()
Bio::EnsEMBL::MappedSliceContainer::set_AlignSliceAdaptor
public set_AlignSliceAdaptor()
Bio::EnsEMBL::MappedSliceContainer::_create_container_slice
protected _create_container_slice()
Bio::EnsEMBL::MappedSliceContainer::attach_StrainSlice
public void attach_StrainSlice()
Bio::EnsEMBL::Mapper
Definition: Coordinate.pm:3
Bio::EnsEMBL::MappedSliceContainer::sub_MappedSliceContainer
public sub_MappedSliceContainer()