[ensembl-dev] get all introns for a gene

Andreas Kahari ak at ebi.ac.uk
Mon Nov 15 09:22:30 GMT 2010


On Sat, Nov 13, 2010 at 12:24:26AM +0000, Andrea Edwards wrote:
> Hi
> 
> Is there an obvious way to get all of the introns for a gene or do I
> have to keep track of the bases in between exons and work it out
> 'manually'
> 
> thanks

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




More information about the Dev mailing list