<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Thomas,<br>
    <br>
    Only the display_xref of a gene has synonyms, so you could speed up
    your script by limiting your query to those.<br>
    <br>
    This would replace the following lines:<br>
    <br>
        my @allsyn;<br>
        my $dber = $gene->get_all_DBEntries($dbname);<br>
        for my $db (@$dber) {<br>
            my $synr = $db->get_all_synonyms();<br>
            push(@allsyn, @$synr);<br>
        }<br>
        ## Find unique synonyms (while maintaining order):<br>
        my %seen;<br>
        my @keep;<br>
        for (0 .. $#allsyn) {<br>
            unless ($seen{$allsyn[$_]}) {<br>
                push(@keep, $_);<br>
                $seen{$allsyn[$_]} = 1;<br>
            }<br>
        }<br>
        print $of $geneid, "\t", join($sep, @allsyn[@keep]), "\n";<br>
    <br>
    with:<br>
       my $db = $gene->display_xref;<br>
       print $of $gene_id, "\t", join($sep,
    @{$db->get_all_synonyms()});<br>
    <br>
    <br>
    Hope that helps,<br>
    Magali<br>
    <br>
    <div class="moz-cite-prefix">On 25/05/2018 17:47, Thomas Danhorn
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:alpine.DEB.2.11.1805250957010.31788@Ntebonpgrevhz.ybpny">Hi
      Beat,
      <br>
      <br>
      I do this regularly and have attached my Perl script -- feel free
      to adapt it for your purposes.  It uses the Ensembl Perl API, so
      you have to have the appropriate version installed. (I cloned the
      git repo and get from there whichever version I need; if you run
      into issues, feel free to ask me.)  The script takes a list of
      Ensembl gene IDs (with a header) and prints a table with the
      orginal IDs and the synonyms.  Be sure to specify the species with
      the -s option, unless you want the default, 'Mouse'.
      <br>
      <br>
      One thing to note is that sometime between releases 84 and 90, the
      location of the synonyms in the databases switched from the
      "EntrezGene" DB to elsewhere, so if you use a newer release with
      the default parameters will likely find no synonyms -- use the
      option `-b all' to search through each DB (or specify one that you
      knnow has what you need).  This takes a while (days for an entire
      genome annotation), so if you have long lists, you may want to
      split them up and parallelize the process.
      <br>
      <br>
      Hope this helps,
      <br>
      <br>
      Thomas
      <br>
      <br>
      <br>
      On Tue, 22 May 2018, Premanand Achuthan wrote:
      <br>
      <br>
      <blockquote type="cite">Hi Beat Wolf,
        <br>
        <br>
        The synonyms is not always empty. If the external source has
        synonyms, then it should be available, for example look at HGNC
        <br>
        <br>
        {"display_id": "BRCA2","primary_id": "HGNC:1101","version":
        "0","description": "BRCA2, DNA repair associated","dbname":
        "HGNC","synonyms":
        ["BRCC2","FACD","FAD","FAD1","FANCD","FANCD1","XRCC11"],"info_text":
        "Generated via ensembl_manual","info_type":
        "DIRECT","db_display_name": "HGNC Symbol"}
        <br>
        <br>
        I am afraid that at the moment you can do it only gene by gene
        via the REST endpoint or via the core API.
        <br>
        <br>
        Thanks
        <br>
        Prem
        <br>
        <br>
        <br>
        On 22/05/2018 10:23, Wolf Beat wrote:
        <br>
        <blockquote type="cite">Thank you for the quick answer.
          <br>
          <br>
          <br>
          I did not know about this approach, but i have two issues with
          it:
          <br>
          <br>
          1) The synonyms attribute seems to be always empty, so
          something seems wrong.
          <br>
          <br>
          2) Sadly i need all synonyms for all genes for a specific
          species. Downloading it through that endpoint would be too
          slow. Thats why i initially looked at biomart, because all i
          need is a list of Ensembl gene id + all synonyms.
          <br>
          <br>
          <br>
          Kind regards
          <br>
          <br>
          <br>
          Beat Wolf
          <br>
          <br>
          ________________________________
          <br>
          From: Dev <a class="moz-txt-link-rfc2396E" href="mailto:dev-bounces@ensembl.org"><dev-bounces@ensembl.org></a> on behalf of
          Premanand Achuthan <a class="moz-txt-link-rfc2396E" href="mailto:prem@ebi.ac.uk"><prem@ebi.ac.uk></a>
          <br>
          Sent: Tuesday, May 22, 2018 11:20:09 AM
          <br>
          To: <a class="moz-txt-link-abbreviated" href="mailto:dev@ensembl.org">dev@ensembl.org</a>
          <br>
          Subject: Re: [ensembl-dev] Gene Synonyms through REST or
          Biomart
          <br>
          <br>
          Hi Beat Wolf,
          <br>
          <br>
          Please have a look at the /xrefs endpoint under "Cross
          References" and
          <br>
          look for "synonyms" in the attribute list.
          <br>
          <br>
<a class="moz-txt-link-freetext" href="http://rest.ensembl.org/xrefs/name/human/BRCA2?content-type=application/json">http://rest.ensembl.org/xrefs/name/human/BRCA2?content-type=application/json</a>
          <br>
          <br>
<a class="moz-txt-link-freetext" href="http://rest.ensembl.org/xrefs/id/ENSG00000157764?content-type=application/json">http://rest.ensembl.org/xrefs/id/ENSG00000157764?content-type=application/json</a>
          <br>
          <br>
          Hope it helps,
          <br>
          <br>
          Best Regards
          <br>
          Prem
          <br>
          <br>
          On 22/05/2018 10:09, Wolf Beat wrote:
          <br>
          <blockquote type="cite">Hello,
            <br>
            <br>
            <br>
            I'm looking for a complete list of all synonyms of a gene or
            a set of genes. I can not find a way to get this information
            through biomart or the REST interface. Is there a way to do
            it?
            <br>
            <br>
            <br>
            Kind regards
            <br>
            <br>
            <br>
            Beat Wolf
            <br>
            _______________________________________________
            <br>
            Dev mailing list    <a class="moz-txt-link-abbreviated" href="mailto:Dev@ensembl.org">Dev@ensembl.org</a>
            <br>
            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>
            <br>
            Ensembl Blog: <a class="moz-txt-link-freetext" href="http://www.ensembl.info/">http://www.ensembl.info/</a>
            <br>
          </blockquote>
          _______________________________________________
          <br>
          Dev mailing list    <a class="moz-txt-link-abbreviated" href="mailto:Dev@ensembl.org">Dev@ensembl.org</a>
          <br>
          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>
          <br>
          Ensembl Blog: <a class="moz-txt-link-freetext" href="http://www.ensembl.info/">http://www.ensembl.info/</a>
          <br>
          _______________________________________________
          <br>
          Dev mailing list    <a class="moz-txt-link-abbreviated" href="mailto:Dev@ensembl.org">Dev@ensembl.org</a>
          <br>
          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>
          <br>
          Ensembl Blog: <a class="moz-txt-link-freetext" href="http://www.ensembl.info/">http://www.ensembl.info/</a>
          <br>
        </blockquote>
        <br>
        <br>
      </blockquote>
      <br>
      NOTICE: This email message is for the sole use of the intended
      recipient(s) and may contain confidential and privileged
      information. Any unauthorized review, use, disclosure or
      distribution is prohibited. If you are not the intended recipient,
      please contact the sender by reply email and destroy all copies of
      the original message.<br>
      <!--'"--><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>