Skip to content

Instantly share code, notes, and snippets.

@andrewyatz
Created February 22, 2011 14:05
Show Gist options
  • Save andrewyatz/838703 to your computer and use it in GitHub Desktop.
Save andrewyatz/838703 to your computer and use it in GitHub Desktop.
An Ensembl script for finding all the available introns for a single Gene for each of its transcripts & printing them to screen
=head1 LICENSE
Copyright (c) 1999-2011 The European Bioinformatics Institute and
Genome Research Limited. All rights reserved.
This software is distributed under a modified Apache license.
For license details, please see
http://www.ensembl.org/info/about/code_licence.html
=cut
use strict;
use warnings;
use Bio::EnsEMBL::Registry;
Bio::EnsEMBL::Registry->load_registry_from_db(
-HOST => 'mysql.ebi.ac.uk',
-PORT => 4157,
-USER => 'anonymous'
);
my $dba = Bio::EnsEMBL::Registry->get_DBAdaptor('Dictyostelium discoideum', 'core');
my $gene_adaptor = $dba->get_GeneAdaptor();
my $stable_id = 'DDB_G0280943';
my $gene = $gene_adaptor->fetch_by_stable_id($stable_id);
foreach my $transcript (@{$gene->get_all_Transcripts()}) {
print $transcript->stable_id(), "\n";
foreach my $intron (@{$transcript->get_all_Introns}) {
print $intron->seq_region_start.' - '.$intron->seq_region_end, "\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment