LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2024] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
CONTACT
Please email comments or questions to the public Ensembl
developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.
Questions may also be sent to the Ensembl help desk at
<http://www.ensembl.org/Help/Contact>.
NAME
Bio::EnsEMBL::TopLevelAssemblyMapper - Handles mapping between a given coordinate system and the toplevel pseudo coordinate system.
SYNOPSIS
$db = Bio::EnsEMBL::DBSQL::DBAdaptor->new(...);
$asma = $db->get_AssemblyMapperAdaptor();
$csa = $db->get_CoordSystemAdaptor();
my $toplevel = $cs_adaptor->fetch_by_name('toplevel');
my $ctg_cs = $cs_adaptor->fetch_by_name('contig');
$asm_mapper = $map_adaptor->fetch_by_CoordSystems( $toplevel, $ctg_cs );
# map to toplevel coord system for this region
@chr_coords =
$asm_mapper->map( 'AL30421.1.200.92341', 100, 10000, -1, $ctg_cs );
# list toplevel seq_region_ids for this region
@chr_ids =
$asm_mapper->list_ids( 'AL30421.1.200.92341', 1, 1000, -1,
$ctg_cs );
DESCRIPTION
The TopLevelAssemblyMapper performs mapping between a provided coordinate system and the toplevel pseudo cooordinate system. The toplevel coordinate system is not a real coordinate system, but represents the highest coordinate system that can be mapped to in a given region. It is only possible to perform unidirectional mapping using this mapper, because it does not make sense to map from the toplevel coordinate system to another coordinate system.
METHODS
new
Arg [1] : Bio::EnsEMBL::DBAdaptor $dbadaptor the adaptor for
the database this mapper is using.
Arg [2] : Toplevel CoordSystem
Arg [3] : Other CoordSystem
Description: Creates a new TopLevelAssemblyMapper object
Returntype : Bio::EnsEMBL::DBSQL::TopLevelAssemblyMapper
Exceptions : throws if any of the 3 arguments are missing/ not
: of the correct type.
Caller : Bio::EnsEMBL::DBSQL::AssemblyMapperAdaptor
Status : Stable
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
Arg [6] : if set will do a fastmap
Arg [7] : (optional) dummy placeholder to keep the interface
consistent across different mappers
Arg [8] : (optional) boolean
Whether or not to include the original coordinates
Example : @coords = $mapper->map('X', 1_000_000, 2_000_000,
1, $chr_cs);
Description: Transforms coordinates from one coordinate system
to another.
Returntype : List of Bio::EnsEMBL::Mapper::Coordinate and/or
Bio::EnsEMBL::Mapper:Gap objects
Exceptions : thrown if if the specified TO coordinate system is not one
of the coordinate systems associated with this mapper
Caller : general
Status : Stable
flush
Args : none
Example : none
Description: polymorphism with AssemblyMapper, does nothing
Returntype : none
Exceptions : none
Status : Stable
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 = $mapper->fastmap('X', 1_000_000, 2_000_000,
1, $chr_cs);
Description: Transforms coordinates from one coordinate system
to another.
Returntype : List of Bio::EnsEMBL::Mapper::Coordinate and/or
Bio::EnsEMBL::Mapper:Gap objects
Exceptions : thrown if if the specified TO coordinate system is not one
of the coordinate systems associated with this mapper
Caller : general
Status : Stable
assembled_CoordSystem
Arg [1] : none
Example : $cs = $mapper->assembled_CoordSystem
Description: Retrieves the assembled CoordSystem from this mapper
Returntype : Bio::EnsEMBL::CoordSystem
Exceptions : none
Caller : internal, AssemblyMapperAdaptor
Status : Stable
component_CoordSystem
Arg [1] : none
Example : $cs = $mapper->component_CoordSystem
Description: Retrieves the component CoordSystem from this mapper
Returntype : Bio::EnsEMBL::CoordSystem
Exceptions : none
Caller : internal, AssemblyMapperAdaptor
Status : Stable
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 $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
Returntype : List of strings
Exceptions : none
Caller : general
Status : Stable
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 $id ($asm_mapper->list_ids('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
Returntype : List of ints
Exceptions : thrown if the from CoordSystem is the toplevel coord system
thrown if the from CoordSystem is not the one used in the mapper
Caller : general
Status : Stable