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
TranscriptMapper - A utility class used to perform coordinate conversions between a number of coordinate systems relating to transcripts
SYNOPSIS
my $trmapper = Bio::EnsEMBL::TranscriptMapper->new($transcript);
@coords = $trmapper->cdna2genomic( 123, 554 );
@coords = $trmapper->genomic2cdna( 141, 500, -1 );
@coords = $trmapper->genomic2cds( 141, 500, -1 );
@coords = $trmapper->pep2genomic( 10, 60 );
@coords = $trmapper->genomic2pep( 123, 400, 1 );
DESCRIPTION
This is a utility class which can be used to perform coordinate conversions between a number of coordinate systems relating to transcripts.
Any transcript object given to TranscriptMapper should have a proper Slice object attached. The Slice provides vital information for the mapping process. After TranscriptMapper has been instantiated, changes to the supplied Transcript will not affect the Mapper's results.
METHODS
new
Arg [1] : Bio::EnsEMBL::Transcript $transcript
The transcript for which a TranscriptMapper should be created.
Example : $trans_mapper = Bio::EnsEMBL::TranscriptMapper->new($transcript)
Description: Creates a TranscriptMapper object which can be used to perform
various coordinate transformations relating to transcripts.
Note that the TranscriptMapper uses the transcript state at the
time of creation to perform the conversions, and that a new
TranscriptMapper must be created if the Transcript is altered.
'Genomic' coordinates are coordinates which are relative to the
slice that the Transcript is on.
Returntype : Bio::EnsEMBL::TranscriptMapper
Exceptions : throws if a transcript is not an argument
Caller : Transcript::get_TranscriptMapper
Status : Stable
_load_mapper
Arg [1] : Bio::EnsEMBL::Transcript $transcript
The transcript for which a mapper should be created.
Example : my $mapper = _load_mapper($transcript);
Description: loads the mapper
Returntype : Bio::EnsEMBL::Mapper
Exceptions : none
Caller : Internal
Status : Stable
cdna2genomic
Arg [1] : $start
The start position in cdna coordinates
Arg [2] : $end
The end position in cdna coordinates
Example : @cdna_coords = $transcript_mapper->cdna2genomic($start, $end);
Description: Converts cdna coordinates to genomic coordinates. The
return value is a list of coordinates and gaps, where the coordinates
are relative to the sequence region that the transcript used to construct
this mapper was on.
Returntype : list of Bio::EnsEMBL::Mapper::Coordinate and
Bio::EnsEMBL::Mapper::Gap objects
Exceptions : throws if no start or end
Caller : general
Status : Stable
genomic2cdna
Arg [1] : $start
The start position in genomic coordinates
Arg [2] : $end
The end position in genomic coordinates
Arg [3] : $strand
The strand of the genomic coordinates (default value 1)
Example : @coords = $trans_mapper->genomic2cdna($start, $end, $strnd);
Description: Converts genomic coordinates to cdna coordinates. The
return value is a list of coordinates and gaps. Gaps
represent intronic or upstream/downstream regions which do
not comprise this transcripts cdna. Coordinate objects
represent genomic regions which map to exons (utrs included).
Note: A poorly formed Transcript will cause this method to
malfunction.
Returntype : list of Bio::EnsEMBL::Mapper::Coordinate and
Bio::EnsEMBL::Mapper::Gap objects
Exceptions : throws if start, end or strand not defined
Caller : general
Status : Stable
cds2genomic
Arg [1] : int $start
start position in cds coords
Arg [2] : int $end
end position in cds coords
Arg [3] boolean (0 or 1) $include_original_region
option to include original input coordinate region mappings in the result
Example : @genomic_coords = $transcript_mapper->cds2genomic(69, 306);
Description: Converts cds coordinates into genomic coordinates. Coordinates returned
are relative to sequence region that the transcript used to construct
this mapper was on.
Returntype : list of Bio::EnsEMBL::Mapper::Gap and
Bio::EnsEMBL::Mapper::Coordinate objects
Exceptions : throws if no end
Caller : general
Status : at risk
pep2genomic
Arg [1] : int $start
start position in peptide coords
Arg [2] : int $end
end position in peptide coords
Example : @genomic_coords = $transcript_mapper->pep2genomic(23, 102);
Description: Converts peptide coordinates into genomic coordinates. The
coordinates returned are relative to the sequence region that the
transcript used to construct this TranscriptMapper was on.
Returntype : list of Bio::EnsEMBL::Mapper::Gap and
Bio::EnsEMBL::Mapper::Coordinate objects
Exceptions : throws if no end
Caller : general
Status : Stable
genomic2cds
Arg [1] : int $start
The genomic start position
Arg [2] : int $end
The genomic end position
Arg [3] : int $strand
The genomic strand
Example : @cds_coords = $trans_mapper->genomic2cds($start, $end, $strand);
Description: Converts genomic coordinates into CDS coordinates of the
transcript that was used to create this transcript mapper.
Returntype : list of Bio::EnsEMBL::Mapper::Coordinate and
Bio::EnsEMBL::Mapper::Gap objects
Exceptions : throw if start, end or strand not defined
Caller : general
Status : Stable
genomic2pep
Arg [1] : $start
The start position in genomic coordinates
Arg [2] : $end
The end position in genomic coordinates
Arg [3] : $strand
The strand of the genomic coordinates
Example : @pep_coords = $transcript->genomic2pep($start, $end, $strand);
Description: Converts genomic coordinates to peptide coordinates. The
return value is a list of coordinates and gaps.
Returntype : list of Bio::EnsEMBL::Mapper::Coordinate and
Bio::EnsEMBL::Mapper::Gap objects
Exceptions : throw if start, end or strand not defined
Caller : general
Status : Stable