<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Leila,<br>
    <br>
    For a given transcript, you can access all its exons and its
    translation (when available) with related protein features.<br>
    <br>
    This snippet of code shows how you can display protein coordinates
    for all exons and protein domains for the related translation,
    starting from a given transcript:<br>
    <br>
    my $registry = Bio::EnsEMBL::Registry->load_registry_from_db(<br>
    -host => 'ensembldb.ensembl.org',<br>
    -user => 'anonymous',<br>
    -port => '3306'<br>
    );<br>
    <br>
    my $transcript_adaptor = $registry->get_adaptor('human', 'core',
    'Transcript');<br>
    my $stable_id = 'ENST00000380152';<br>
    my $transcript =
    $transcript_adaptor->fetch_by_stable_id($stable_id);<br>
    <br>
    # Only get exons within the coding region<br>
    my $exons = $transcript->get_all_translateable_Exons();<br>
    foreach my $exon (@$exons) {<br>
      # Print the genomic coordinates for each exon<br>
      print "Exon " . $exon->stable_id . ":" . $exon->start . "-"
    . $exon->end. "\t";<br>
      my @pep_coords = $transcript->genomic2pep($exon->start,
    $exon->end, $exon->strand);<br>
      foreach my $pep (@pep_coords) {<br>
        # Print the protein coordinates for each exon<br>
        print $pep->start() . "-" . $pep->end() . "\n";<br>
      }<br>
    }<br>
    <br>
    my $translation = $transcript->translation;<br>
    # Check if there is a translation<br>
    if ($translation) {<br>
      my $pfs = $translation->get_all_ProteinFeatures();<br>
      # Display all protein features<br>
      foreach my $pf (@$pfs) {<br>
        print $pf->hseqname . ":" .  $pf->start . "-" .
    $pf->end . "\n";<br>
      }<br>
    }<br>
    <br>
    <br>
    If you only have exon coordinates to start with, you will need to
    create a slice for each set of coordinates, then retrieve
    transcripts overlapping that slice and use the process described
    above.<br>
    <br>
    my $slice_adaptor = $registry->get_adaptor('human', 'core',
    'Slice');<br>
    my $slice = $slice_adaptor->fetch_by_region('chromosome',
    $chromosome, $exon_start, $exon_end);<br>
    my $transcripts = $slice->get_all_Transcripts();<br>
    <br>
    <br>
    Hope that helps,<br>
    Magali<br>
    <br>
    <div class="moz-cite-prefix">On 16/05/2015 00:32, Leila Alieh wrote:<br>
    </div>
    <blockquote
cite="mid:CAFZt0cko2mmspjyO4XCWxmpmn0JqY-v_NSGU7ypCo-aRL_=_8Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>Hi all!<br>
                  <br>
                </div>
                I have a list of genomic coordinates of exons and I want
                to transform them into protein coordinates of the
                different protein isoforms these exons belong to.
                Moreover I want to find the protein coordinates of the
                domains of these proteins, and then overlap the 2 sets
                of information to find exons which encode for protein
                domains. For what I read the (only?) way to do so is to
                use the Perl API of ensembl, and in particular  I should
                use TranscriptMapper and ProteinFeauture, right? I read
                the the tutorial and the documentation but I still find
                it very difficult to understand the API and I don't
                knowhow to write the code in a way to restrict the query
                only to my list of exons/proteins. Could you please show
                me some examples? In particular I'd like to know what
                Greg did to find the protein coordinates of the protein
                domains (<a moz-do-not-send="true"
                  href="http://lists.ensembl.org/pipermail/dev/2015-April/011013.html">http://lists.ensembl.org/pipermail/dev/2015-April/011013.html</a>).<br>
              </div>
              <br>
            </div>
            Thank you in advance and I apologize if I did some mistake
            in the thread, it's the first time that I'm using the
            ensembl mailing list.<br>
            <br>
          </div>
          P.S. Please, please, please, make the protein coordinates
          accessible in Ensembl gene mart as soon as possible, it would
          save a lot of work/time<br>
          <br>
        </div>
        Thanks again!<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Dev mailing list    <a class="moz-txt-link-abbreviated" href="mailto:Dev@ensembl.org">Dev@ensembl.org</a>
Posting guidelines and subscribe/unsubscribe info: <a class="moz-txt-link-freetext" href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a>
Ensembl Blog: <a class="moz-txt-link-freetext" href="http://www.ensembl.info/">http://www.ensembl.info/</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>