[ensembl-dev] Dev Digest, Vol 5, Issue 18
Steve Moss
gawbul at gmail.com
Mon Nov 15 12:57:53 GMT 2010
Hi,
You would have to bare in mind, that this code would produce a redundant
list of introns, as there can be multiple transcripts per gene, with shared
introns/exons. You would either need to do some redundancy checks
afterwards, or use the canonical_transcript() method instead.
Also, if using this method, doing the following would be more efficient:
my $transcripts = $gene->get_all_Transcripts();
while (my $transcript = shift @{$transcripts}) {
printf( "\tLooking at transcript '%s'\n", $transcript->stable_id() );
my $introns = $transcript->get_all_Introns();
while (my $intron = shift @{$introns}) {
printf( "\t\tIntron between %d and %d\n", $intron->start(),
$intron->end() );
}
}
Although personally I would do the following:
my $transcript = $gene->canonical_transcript();
printf( "\tLooking at transcript '%s'\n", $transcript->stable_id() );
my $introns = $transcript->get_all_Introns();
while (my $intron = shift @{$introns}) {
printf( "\t\tIntron between %d and %d\n", $intron->start(),
$intron->end() );
}
Cheers,
Steve
You can not get the introns for a gene, but you may get them for each of
> its transcripts. Like this, for example:
>
> my $ga = $registry->get_adaptor( 'Homo sapiens', 'Core', 'Gene' );
>
> my $gene = $ga->fetch_by_stable_id('ENSG00000139618');
>
> printf( "Looking at gene '%s'\n", $gene->stable_id() );
>
> foreach my $transcript ( @{ $gene->get_all_Transcripts() } ) {
> printf( "\tLooking at transcript '%s'\n",
> $transcript->stable_id() );
>
> foreach my $intron ( @{ $transcript->get_all_Introns() } ) {
> printf( "\t\tIntron between %d and %d\n",
> $intron->start(), $intron->end() );
> }
> }
>
> Output:
>
> Looking at gene 'ENSG00000139618'
> Looking at transcript 'ENST00000380152'
> Intron between 32889805 and 32890558
> Intron between 32890665 and 32893213
> Intron between 32893463 and 32899212
> Intron between 32899322 and 32900237
> Intron between 32900288 and 32900378
> Intron between 32900420 and 32900635
> Intron between 32900751 and 32903579
> Intron between 32903630 and 32905055
> Intron between 32905168 and 32906408
> Intron between 32907525 and 32910401
> Intron between 32915334 and 32918694
> Intron between 32918791 and 32920963
> Intron between 32921034 and 32928997
> Intron between 32929426 and 32930564
> Intron between 32930747 and 32931878
> Intron between 32932067 and 32936659
> Intron between 32936831 and 32937315
> Intron between 32937671 and 32944538
> Intron between 32944695 and 32945092
> Intron between 32945238 and 32950806
> Intron between 32950929 and 32953453
> Intron between 32953653 and 32953886
> Intron between 32954051 and 32954143
> Intron between 32954283 and 32968825
> Intron between 32969071 and 32971034
> Intron between 32971182 and 32972298
> Looking at transcript 'ENST00000470094'
> Intron between 32954051 and 32954143
> Intron between 32954283 and 32968825
> Intron between 32969071 and 32970127
> Intron between 32970254 and 32971034
> Intron between 32971182 and 32972298
>
>
>
> --
> Andreas K?h?ri, Ensembl Software Developer
> European Bioinformatics Institute (EMBL-EBI)
> Wellcome Trust Genome Campus
> Hinxton, Cambridge CB10 1SD, United Kingdom
>
--
Kindest regards,
Steve Moss
http://stevemoss.ath.cx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20101115/f90ed9f2/attachment.html>
More information about the Dev
mailing list