[ensembl-dev] variation api - what exon a variation feature is in and exon start/end positions vary

Will Spooner whs at eaglegenomics.com
Sat Nov 20 00:13:25 GMT 2010


Hi Andrea,

$feature->start returns coordinates relative to the arbitrary slice on which the feature is placed, which is great for drawing genome browser images, but not for getting absolute locations. For that you need $feature->seq_region_start. To be 100% sure you may want to $feature->project to 'toplevel' first, although this should not be needed with ensembl-distributed DBs.

However, To get the exon(s) co-located with a SNP, the best way is probably to;

  $variation->feature_Slice->get_all_Exons;

Best,

Will

On 19 Nov 2010, at 23:35, Andrea Edwards wrote:

> Hi
> 
> If i create a variation feature object for a SNP I can get all of the transcript variations for that SNP.
> How would i find out for each particular transcript variation which exon the SNP resides in?
> 
> I can get all of the exons for the transcript and iterate through them and look at their start and stop positions and see if the snp resides in the exon.
> 
> However when i did this i found that the start and stop positions you get for an exon when you retrieve the exon like this:
> 
> ========================================
> @exons = @{$tv->transcript->get_all_Exons() };
> 
>          foreach $exon (@exons) {
>               $exon->start
>         }
> 
> example:
> id: ENSBTAE00000282962
> start: 3916
> end: 4033
> ==============================================
> 
> 
> Is different than when you get an exon like this:
> 
> 
> 
> ==============================================
> my $exon = $exon_adaptor->fetch_by_stable_id( 'ENSBTAE00000282962' );
> print $exon->start(), "\n";
>    print $exon->end(), "\n";
> =========================================================
> 
> 
> The latter case seems to be genomic coordinates
> 
> I couldn't tell what you are getting in the first case though. The exon in the example is at the start of the transcript so I don't know why you get a start of 3916. It is also the first exon of all exons in the gene so it isn't 3916 from the start of the underlying gene. Please could you explain where those start and end coordinates come from. I had to do this workaround to get genomic coordinates
> 
> @exons = @{$tv->transcript->get_all_Exons() };
> 
>          foreach $exon (@exons) {
>              print "id: ", $exon->stable_id, "\n";
>              $exon = $exon_adaptor->fetch_by_stable_id( $exon->stable_id );
>              print "start: ", $exon->start, "\n";
>              print "end: ", $exon->end, "\n";
>          }
> 
> thanks
> 
> _______________________________________________
> Dev mailing list
> Dev at ensembl.org
> http://lists.ensembl.org/mailman/listinfo/dev

--
William Spooner
whs at eaglegenomics.com
http://www.eaglegenomics.com







More information about the Dev mailing list