[ensembl-dev] How to retrieve more detailed alternative splicing data.

Gautier Koscielny koscieln at ebi.ac.uk
Thu May 12 10:34:50 BST 2011


Dear Felipe,

I wrote a generic script to retrieve alternative splicing event from a 
core database. You will need to install the core API.
You can find it in the Ensembl source code repository from the web-based 
CVS:

http://cvs.sanger.ac.uk/cgi-bin/viewvc.cgi/ensembl/misc-scripts/alternative_splicing/generateSplicingEventTable.pl?root=ensembl&view=log

Usage:

perl generateSplicingEventTable.pl -dbhost ensembldb.ensembl.org -dbport 
5306 -dbname homo_sapiens_core_62_37g -dbuser anonymous

This is a snippet of code for your mutual exclusion (MXE) case:

=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#For your specific case, you can create a SplicingEventAdaptor

my $se_adaptor = $db->get_SplicingEventAdaptor();

#And get all the AS events sorted by type and location for a given gene:

for my $se (  @ { $se_adaptor->fetch_all_by_Gene($gene) } ) {

      # filter on Mutually exclusive events
      next unless ($se->type() eq 'MXE');

      # print location
      my $location = ($se->strand() == 1) ? ("+\t$chr:" . $se->start() . 
"-" . $se->end()) : ("-\t$chr:" . $se->end() . "-" . $se->start());
      print $se->type() .  "\t$location";

     # retrieve all the exon feature for this particular MXE event
     my @features = @{ $se->get_all_Features() };
     my %f_map = map { $_->exon_id() => $_ } @features;

     my $nb = 0;
     my @s1 = ();
     my @s2 = ();

     # loop on the features ordered
     foreach my $exon_id (sort { $f_map{$a}->feature_order() <=> 
$f_map{$b}->feature_order() } keys %f_map) {

             # retrieve the exon
              my $f = $f_map{$exon_id};
              my $exon = $exon_adaptor->fetch_by_dbID($exon_id);

             # concatenate information about this exon
             my $s = $exon->stable_id() . "(" . $f->start() . "-" . 
$f->end() . ")";
             # depending to which transcript the mutually exclusive exon 
is part of, assign this information to list s1 or s2
             if ($f->transcript_association() == 1) {
                               push @s1, $s;
             } else {
                               push @s2, $s;
             }

       }

       # finally print this information
       print "\tAlternative exons: " . join("; ", @s1) . " / " . join("; 
", @s2) . "\n";
}
=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

For gene "ENSG00000000419", it should return:

MXE    -    20:49562274-49557470    Alternative exons: 
ENSE00000662821(49558568-49558663) / ENSE00001455562(49557666-49557746)
MXE    -    20:49562274-49557492    Alternative exons: 
ENSE00001835197(49558568-49558663) / ENSE00001455562(49557666-49557746)

Hope this helps,

Gautier

On 11/05/2011 23:47, Felipe Veloso wrote:
> Dear people-at-Ensembl,
>
> I hope you can help me with this: I need to filter your alternative 
> splicing data for mutually exclusive exons labeling the pairs of exons 
> that are involved in each such event. It cannot be done from Biomart, 
> but Gautier Koscielny kindly helped me saying that it can be done with 
> Ensembl Core API and that you people can send me some lines of code to 
> do the job. So, that's why I'm emailing you. Thanks in advance!
>
> Best regards,
>
> Felipe.
>
>
>
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> List admin (including subscribe/unsubscribe): http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/


-- 
Best Regards/Cordialement/Mit freundlichen Grüßen
Gautier Koscielny, Ph.D.
phone: +44 (0)1223 494 650
EMBL Outstation - The European Bioinformatics Institute
Wellcome Trust Genome Campus
Hinxton CB10 1SD
UK





More information about the Dev mailing list