<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000066" bgcolor="#FFFFFF">
    Hi,<br>
    <br>
    I'm trying to retrieve ClinVar information with the code example you
    provided.<br>
    <br>
        my $self = shift;<br>
        my $tva = shift;<br>
        my $vf = $tva->variation_feature;<br>
        my $pfa =
$self->{config}->{reg}->get_adaptor('human','variation','phenotypefeature');<br>
        <br>
        foreach my $known_var(@{$vf->{existing} || []}) {<br>
            foreach my
    $pf(@{$pfa->fetch_all_by_object_id($known_var->{variation_name})})
    {<br>
                if ($pf->{'source'} eq "dbSNP_ClinVar"){<br>
                    print
    "$pf->{'source'}\t$pf->{'external_id'}\t$pf->{'is_significant'}\t$pf->{'phenotype'}\n",
    ;<br>
                }<br>
            }<br>
        }<br>
    <br>
    As you can see I'm "filtering" the results to only output phenotype
    feature when source is dbSNP_ClinVar. I don't know why but I guess
    filtering should be done when doing the "fetch_all".<br>
    <br>
    On the other hand I'm trying to retrieve Disease, Source and
    Clinical Significance from this example table:
<a class="moz-txt-link-freetext" href="http://www.ensembl.org/Homo_sapiens/Variation/Phenotype?db=core;r=8:19955518-19956518;v=rs268;vdb=variation;vf=266">http://www.ensembl.org/Homo_sapiens/Variation/Phenotype?db=core;r=8:19955518-19956518;v=rs268;vdb=variation;vf=266</a><br>
    <br>
    I think I'm doing something wrong I got totally lost in
    Phenotypefeature.<br>
    <br>
    Regards,<br>
    Guillermo.<br>
    <br>
    <div class="moz-cite-prefix">On 02/03/15 16:05, Will McLaren wrote:<br>
    </div>
    <blockquote
cite="mid:CAMVEDX3eU9fx1rXtUep6JsZe-ByEcFA=GJTn_ZPaP7Zo1dbKuw@mail.gmail.com"
      type="cite">
      <div dir="ltr">If you enable the --check_existing flag when you
        run the VEP, you'll be able to see any known co-located variants
        attached to the VariationFeature object in your plugin:
        <div><br>
        </div>
        <div>sub run {</div>
          my $self = shift;
        <div>  my $tva = shift;</div>
        <div>  my $vf = $tva->variation_feature;</div>
        <div><br>
        </div>
        <div>  foreach my $known_var(@{$vf->{existing} || []}) {</div>
        <div>     # do stuff</div>
        <div>  }</div>
        <div>}</div>
        <div><br>
        </div>
        <div>The $known_var is not an API object but a simple hashref
          with a number of fields; you're probably interested in
          $known_var->{clin_sig}</div>
        <div><br>
        </div>
        <div>However, as I mentioned, this is the only data that is
          stored in the cache. To access the rating and the specific
          disease association, you'll need to make calls to the database
          by getting an adaptor, something like:</div>
        <div><br>
        </div>
        <div>
          <div>sub run {</div>
          <div>  my $self = shift;</div>
          <div>  my $tva = shift;</div>
          <div>  my $vf = $tva->variation_feature;</div>
          <div>  my $pfa =
$self->{config}->{reg}->get_adaptor('human','variation','phenotypefeature');</div>
          <div><br>
          </div>
          <div>  foreach my $known_var(@{$vf->{existing} || []}) {</div>
          <div>     foreach my
            $pf(@{$pfa->fetch_all_by_object_id($known_var->{variation_name})})
            {</div>
          <div>       # do stuff</div>
          <div>     }</div>
          <div>  }</div>
          <div>}</div>
        </div>
        <div><br>
        </div>
        <div>Be aware that this will access the database, so unless you
          have a local copy please don't run this sort of code on
          genome-wide VCFs using our public DB server.</div>
        <div><br>
        </div>
        <div>Regards</div>
        <div><br>
        </div>
        <div>Will</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On 2 March 2015 at 14:47, Guillermo
          Marco Puche <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:guillermo.marco@sistemasgenomicos.com"
              target="_blank">guillermo.marco@sistemasgenomicos.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000066" bgcolor="#FFFFFF"> Hi Will,<br>
              <br>
              Indeed I'm looking to retrieve this information from VEP
              plugin.<br>
              <br>
              Regards,<br>
              Guillermo.
              <div>
                <div class="h5"><br>
                  <br>
                  <div>On 02/03/15 15:25, Will McLaren wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">Hi Guillermo,
                      <div><br>
                      </div>
                      <div>The detailed ClinVar information is stored
                        against PhenotypeFeature objects (each
                        SNP/disease pairing gets its own entry in
                        ClinVar, e.g. <a moz-do-not-send="true"
                          href="http://www.ncbi.nlm.nih.gov/clinvar/RCV000019691.2"
                          target="_blank">http://www.ncbi.nlm.nih.gov/clinvar/RCV000019691.2</a>, <a
                          moz-do-not-send="true"
                          href="http://www.ncbi.nlm.nih.gov/clinvar/RCV000019692.2/"
                          target="_blank">http://www.ncbi.nlm.nih.gov/clinvar/RCV000019692.2/</a>, <a
                          moz-do-not-send="true"
                          href="http://www.ncbi.nlm.nih.gov/clinvar/RCV000019693.2/"
                          target="_blank">http://www.ncbi.nlm.nih.gov/clinvar/RCV000019693.2/</a>
                        for rs699).</div>
                      <div><br>
                      </div>
                      <div>The rating (and indeed the clinical
                        significance) is stored as an attribute on the
                        PhenotypeFeature object; you can retrieve this
                        with the get_all_attributes() method.</div>
                      <div><br>
                      </div>
                      <div>See <a moz-do-not-send="true"
href="http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1PhenotypeFeature.html"
                          target="_blank">http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1PhenotypeFeature.html</a>
                        and <a moz-do-not-send="true"
href="http://www.ensembl.org/info/docs/api/variation/variation_tutorial.html#phenotype"
                          target="_blank">http://www.ensembl.org/info/docs/api/variation/variation_tutorial.html#phenotype</a>
                        for more info.</div>
                      <div><br>
                      </div>
                      <div><span style="font-size:12.8000001907349px">Bio::EnsEMBL::Variation::</span><span
                          style="font-size:12.8000001907349px">Utils::VEP::get_clin_sig()

                          is an internal method that you should not use.</span></div>
                      <div><span style="font-size:12.8000001907349px"><br>
                        </span></div>
                      <div><span style="font-size:12.8000001907349px">The
                          VEP cache contains the list of clinical
                          significance states for each variant, but
                          neither the disease association or the rating.
                          If you want help getting access to this data
                          via a plugin, let me know as it's a little
                          more involved than the API methods above
                          (though it is faster as no database access is
                          required).</span><br>
                      </div>
                      <div><br>
                      </div>
                      <div>Regards</div>
                      <div><br>
                      </div>
                      <div>Will McLaren</div>
                      <div>Ensembl Variation</div>
                    </div>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">On 2 March 2015 at 14:06,
                        Guillermo Marco Puche <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:guillermo.marco@sistemasgenomicos.com"
                            target="_blank">guillermo.marco@sistemasgenomicos.com</a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div text="#000066" bgcolor="#FFFFFF"> Dear
                            devs,<br>
                            <br>
                            I'm looking forward to retrieve ClinVar
                            information and add it to VEP annotation.
                            From my understanding I should be able to
                            retrieve "Clinical significance" and
                            "ClinVar Rating".<br>
                            <br>
                            I've been looking the Varation API, and I'm
                            confused. I guess for significance I should
                            use
                            Bio::EnsEMBL::Variation::Utils::VEP::get_clin_sig()
                            or
Bio::EnsEMBL::Variation::VariationFeature::get_all_clinical_significance_states().<br>
                            <br>
                            What about ClinVar rating? Is it possible to
                            retrieve it from API?<br>
                            <br>
                            Thanks!<br>
                            <br>
                            Regards,<br>
                            Guillermo.<br>
                            <br>
                            <br>
                          </div>
                          <br>
_______________________________________________<br>
                          Dev mailing list    <a moz-do-not-send="true"
                            href="mailto:Dev@ensembl.org"
                            target="_blank">Dev@ensembl.org</a><br>
                          Posting guidelines and subscribe/unsubscribe
                          info: <a moz-do-not-send="true"
                            href="http://lists.ensembl.org/mailman/listinfo/dev"
                            target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a><br>
                          Ensembl Blog: <a moz-do-not-send="true"
                            href="http://www.ensembl.info/"
                            target="_blank">http://www.ensembl.info/</a><br>
                          <br>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
Dev mailing list    <a moz-do-not-send="true" href="mailto:Dev@ensembl.org" target="_blank">Dev@ensembl.org</a>
Posting guidelines and subscribe/unsubscribe info: <a moz-do-not-send="true" href="http://lists.ensembl.org/mailman/listinfo/dev" target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a>
Ensembl Blog: <a moz-do-not-send="true" href="http://www.ensembl.info/" target="_blank">http://www.ensembl.info/</a>
</pre>
                  </blockquote>
                  <br>
                </div>
              </div>
              <div>-- <br>
                <div align="center">
                  <hr size="2" width="100%" align="center"></div>
                <table cellpadding="0" align="center" border="0">
                  <tbody>
                    <tr>
                      <td>
                        <p><span style="font-size:12px"><span
                              style="font-family:arial,helvetica,sans-serif"><span
                                style="color:#000066"><strong>Guillermo
                                  Marco Puche</strong><br>
                                <br>
                                Bioinformatician, Computer Science
                                Engineer<br>
                                Sistemas Genómicos S.L.<br>
                                Phone: <a moz-do-not-send="true"
                                  href="tel:%2B34%20902%20364%20669"
                                  value="+34902364669" target="_blank">+34
                                  902 364 669</a> (Ext.777)<br>
                                Fax: <a moz-do-not-send="true"
                                  href="tel:%2B34%20902%20364%20670"
                                  value="+34902364670" target="_blank">+34
                                  902 364 670</a></span><br>
                              <a moz-do-not-send="true"
                                href="http://www.sistemasgenomicos.com"
                                target="_blank"><span
                                  style="color:#000066">www.sistemasgenomicos.com</span></a></span></span></p>
                      </td>
                      <td>
                        <p><a moz-do-not-send="true"
href="https://www.sistemasgenomicos.com/web_sg/web/areas-bioinformatica.php"
                            target="_blank"><img alt=""
                              src="cid:part17.09060303.02050507@sistemasgenomicos.com">
                          </a></p>
                      </td>
                    </tr>
                  </tbody>
                </table>
                <div align="center">
                  <hr size="2" width="100%" align="center"></div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            Dev mailing list    <a moz-do-not-send="true"
              href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>
            Posting guidelines and subscribe/unsubscribe info: <a
              moz-do-not-send="true"
              href="http://lists.ensembl.org/mailman/listinfo/dev"
              target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a><br>
            Ensembl Blog: <a moz-do-not-send="true"
              href="http://www.ensembl.info/" target="_blank">http://www.ensembl.info/</a><br>
            <br>
          </blockquote>
        </div>
        <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>
    <div class="moz-signature">-- <br>
      <title>Guillermo Marco Puche - Firma</title>
      <div align="center">
        <hr size="2" width="100%" align="center"></div>
      <table cellpadding="0" align="center" border="0">
        <tbody>
          <tr>
            <td>
              <p><span style="font-size:12px;"><span
                    style="font-family:arial,helvetica,sans-serif;"><span
                      style="color:#000066;"><strong>Guillermo Marco
                        Puche</strong><br>
                      <br>
                      Bioinformatician, Computer Science Engineer<br>
                      Sistemas Genómicos S.L.<br>
                      Phone: +34 902 364 669 (Ext.777)<br>
                      Fax: +34 902 364 670</span><br>
                    <a href="www.sistemasgenomicos.com" target="_blank"><span
                        style="color:#000066;">www.sistemasgenomicos.com</span></a></span></span></p>
            </td>
            <td>
              <p><a
href="https://www.sistemasgenomicos.com/web_sg/web/areas-bioinformatica.php"><img
                    alt=""
                    src="cid:part23.01090903.04010501@sistemasgenomicos.com">
                </a></p>
            </td>
          </tr>
        </tbody>
      </table>
      <div align="center">
        <hr size="2" width="100%" align="center"></div>
    </div>
  </body>
</html>