[ensembl-dev] how to use the transcript mapper
ian Longden
ianl at ebi.ac.uk
Mon Nov 1 14:28:40 GMT 2010
On Mon, Nov 1, 2010 at 1:46 PM, Andrea Edwards <edwardsa at cs.man.ac.uk>wrote:
> Hi
>
> I'm a bit confused by the transcript mapper. The docs say about the
> cdna2genomic method
>
> 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.
> Returntype : list of Bio::EnsEMBL::Mapper::Coordinate and
> Bio::EnsEMBL::Mapper::Gap objects
> Exceptions : throws if no start or end
> Caller : general
> Status : Stable
>
>
>
> What would/could the gaps be in a transcript?
>
The gaps here will be either at the start or the end depending on the values
of the start and end values past. So if you pass an end value past the end
of the cdna then a gap object will be the last element of the array.
> If your transcript did contain gaps would the return value be an array
> which contained both refs to coordinate objects and gap objects and you
> would have to iterate over the array and determine the type of the ref at
> each position?
>
Yes exactly so do something like:-
my @coords=$trmapper->cdna2genomic($pos1,$pos2);
foreach my $coord (@coords) {
if ($coord->isa("Bio::EnsEMBL::Mapper::Coordinate")){
print "genomic start is ".$coord->start." and ends at
".$coord->end."\n";
}
else{
print "GAP from".$coord->start." to ".$coord->end."\n";;
}
}
HTH,
Ian Longden.
> thanks
>
> _______________________________________________
> Dev mailing list
> Dev at ensembl.org
> http://lists.ensembl.org/mailman/listinfo/dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20101101/77728490/attachment.html>
More information about the Dev
mailing list