<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Dear people-at-Ensembl, I hope you can help me with this: <br>
    <br>
    I need to filter the alternative splicing data for mutually
    exclusive exons labeling the pairs of transcripts that are involved
    in event. <br>
    <br>
    Thanks in advance! <br>
    <br>
    Best regards, Julio.<br>
      <br>
    ###<br>
    <br>
    <br>
    This code is incomplete and I am trying to finish it (I copied from
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <a
      href="http://lists.ensembl.org/pipermail/dev/2011-May/001226.html">http://lists.ensembl.org/pipermail/dev/2011-May/001226.html</a>
    ).<br>
    <br>
    #!/usr/local/ensembl/bin/perl -w<br>
    <br>
    use lib "/home/julio/src/ensembl/modules"; <br>
    use strict;<br>
    use warnings;<br>
    use Getopt::Long;<br>
    use Bio::EnsEMBL::Utils::Exception qw(throw warning);<br>
    use Bio::EnsEMBL::Feature;<br>
    use Bio::EnsEMBL::DBSQL::DBAdaptor;<br>
    use Bio::EnsEMBL::DBSQL::SplicingEventAdaptor;<br>
    use Bio::EnsEMBL::DBSQL::GeneAdaptor;<br>
    use Bio::EnsEMBL::DBSQL::AttributeAdaptor;<br>
    use Bio::EnsEMBL::DBSQL::SplicingTranscriptPairAdaptor;<br>
    use Bio::EnsEMBL::Utils::Exception qw(throw);<br>
    <br>
    my $host   = '';<br>
    my $port   = '3306';<br>
    my $dbname = '';<br>
    my $dbuser = '';<br>
    my $dbpass = '';<br>
    my $file   = undef;<br>
    my $help;<br>
    my @coord_system;<br>
    <br>
    &GetOptions(<br>
            'dbhost:s'   => \$host,<br>
            'dbport:n'   => \$port,<br>
            'dbname:s'   => \$dbname,<br>
            'dbuser:s'   => \$dbuser,<br>
            '<a class="moz-txt-link-freetext" href="file:s">file:s</a>'      => \$file,<br>
            'dbpass:s'   => \$dbpass,<br>
            'h|help'     => \$help,<br>
            ) or ($help = 1);<br>
    <br>
    if(!$host || !$dbuser || !$dbname) { <br>
            print STDERR "Can't get any information without database
    details\n";<br>
            print STDERR "-dbhost $host -dbuser $dbuser -dbname $dbname
    ".<br>
                    " -dbpass $dbpass\n";<br>
            $help = 1;<br>
    }<br>
    <br>
    if ($help) {<br>
            exec('perldoc', $0);<br>
    }<br>
    <br>
    my $db = Bio::EnsEMBL::DBSQL::DBAdaptor->new<br>
            (-dbname => $dbname,<br>
             -host   => $host,<br>
             -user   => $dbuser,<br>
             -port   => $port,<br>
             -pass   => $dbpass);<br>
    <br>
    my $gene_adaptor = $db->get_GeneAdaptor();<br>
    my $se_adaptor = $db->get_SplicingEventAdaptor();<br>
    my $attrib_adaptor = $db->get_AttributeAdaptor();<br>
    my $SplicingTranscriptPairAdaptor =
    $db->get_SplicingTranscriptPairAdaptor();<br>
    my @stable_gene_ids = @{$gene_adaptor->list_stable_ids()};<br>
    my $size = scalar @stable_gene_ids;<br>
    print STDERR "Number of stable ids:\t" . $size . "\n";<br>
    <br>
    my $count = 0;<br>
    <br>
    # example genes <br>
    my @genes = ("ENSG00000002016", "ENSG00000002746");<br>
    <br>
    # don't know how to get this information easyly from the core API<br>
    <br>
    my $attrib_names = {<br>
            MXE => "Mutually exclusive exons",    <br>
            };<br>
    <br>
    print  " AS name\tType\tShort desc\tlocation\tdetails\n";<br>
    print 
"+--------------------------------------------------------------------------+\n";<br>
    <br>
    for my $id (@genes) {<br>
            <br>
            $count++;<br>
            my $gene = $gene_adaptor->fetch_by_stable_id($id);    <br>
            my $gene_id = $gene->display_id();<br>
            my $biotype = $gene->biotype();<br>
            my $chr = $gene->slice->seq_region_name();<br>
            my $strand = $gene->strand();<br>
            my $start = $gene->start();<br>
            my $end = $gene->end();<br>
            <br>
    #And get all the AS events sorted by type and location for a given
    gene:<br>
            <br>
            for my $se (  @ { $se_adaptor->fetch_all_by_Gene($gene) }
    ) {<br>
                <br>
                # filter on Mutually exclusive events<br>
                next unless ($se->type() eq 'MXE');<br>
                <br>
                # print location<br>
                my $location = ($se->strand() == 1) ? ("+\t$chr:" .
    $se->start() . "-" . $se->end()) : ("-\t$chr:" . $se->end()
    . "-" . $se->start());<br>
                print  $se->type() .  "\t$location";<br>
                <br>
             <br>
                # retrieve the trans<br>
                my $f = $f_map{$splicing_transcript_pair_id};<br>
                my $trans =
$SplicingTranscriptPairAdaptor->fetch_by_dbID($splicing_transcript_pair_id);<br>
                <br>
                # concatenate information about this trans<br>
    <br>
    <br>
                # depending to which transcript the mutually exclusive
    exon is part of, assign this information to list s1 or s2<br>
                    <br>
    <br>
                # finally print this information<br>
                print "\tAlternative trans: " . join("; ", @s1) . " / "
    . join(";", @s2) . "\n";<br>
            }        <br>
    }<br>
    exit 0;<br>
    <br>
  </body>
</html>