<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Dear Duarte,<br>
      <br>
      The 1000 Genomes Phase 3 data are stored in a VCF file and not in
      a database (it was too big to store it in our databases), that's
      why you didn't see them in your results.<br>
      However you can access it with the Ensembl Variation API. For
      that, you need add the following line in your script to force the
      API to look into the Ensembl Variation VCF files:<br>
    </p>
    <pre>$variation_adaptor->db->use_vcf(1);</pre>
    <p><br>
      Here is a suggestion of your script with the change:<br>
    </p>
    <pre class="code sh_perl sh_sourceCode"><span class="sh_keyword">my</span> <span class="sh_variable">$variation_adaptor</span> <span class="sh_symbol">=</span> <span class="sh_variable">$registry</span><span class="sh_symbol">-></span><span class="sh_function">get_adaptor</span><span class="sh_symbol">(</span><span class="sh_string">"human"</span><span class="sh_symbol">,</span> <span class="sh_string">"variation"</span><span class="sh_symbol">,</span> <span class="sh_string">"variation"</span><span class="sh_symbol">);
</span>
<span class="sh_symbol">$variation_adaptor->db->use_vcf(1);</span></pre>
    <pre>my $variation = $variation_adaptor->fetch_by_name($id);</pre>
    <div>
      <pre>foreach my $vf (@{$variation->get_all_VariationFeatures()}) {</pre>
      <pre>    ...</pre>
      <pre>}</pre>
    </div>
    <p>Note that I also replaced the VariationFeatureAdaptor call
      "$vf_adaptor->fetch_all_by_Variation($var)}" to avoid
      using/instantiate an extra adaptor.</p>
    <p>There are some further descriptions in our Ensembl Variation API
      tutorial: <a moz-do-not-send="true"
href="https://www.ensembl.org/info/docs/api/variation/variation_tutorial.html#alleles">https://www.ensembl.org/info/docs/api/variation/variation_tutorial.html#alleles</a></p>
    <p><br>
    </p>
    <p>Best regards,<br>
    </p>
    <pre class="moz-signature" cols="72">Laurent
Ensembl Variation
</pre>
    <div class="moz-cite-prefix">On 17/01/2019 09:54, Duarte Molha
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAGqkoE+g2yccOjAzkqV8jy0-MzAm6OSQtJxJGjr1ndqifExPPQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr" class="gmail_signature">
                          <div>Dear Developers </div>
                          <div><br>
                          </div>
                          <div>I created a simple script to provide me
                            with polymorphic frequencies in the
                            different populations in the database.
                            However after running it on my set it seems
                            some variations do not show results</div>
                          <div><br>
                          </div>
                          <div><br>
                          </div>
                          take for example the INDEL rs141080692
                          <div> </div>
                          <div>When I run it though my script this is
                            the information I get:</div>
                          <div><br>
                          </div>
                          <div>
                            <div>rs141080692     GT     
                              1000GENOMES:pilot_1_CEU_low_coverage_panel 
                                  -       deletion        9     
                               123543905       123543907</div>
                            <div>rs141080692     -     
                               1000GENOMES:pilot_1_CEU_low_coverage_panel 
                                  -       deletion        9     
                               123543905       123543907</div>
                            <div>rs141080692     GT     
                              1000GENOMES:pilot_1_CHB+JPT_low_coverage_panel 
                              -       deletion        9       123543905 
                                   123543907</div>
                            <div>rs141080692     -     
                               1000GENOMES:pilot_1_CHB+JPT_low_coverage_panel 
                              -       deletion        9       123543905 
                                   123543907</div>
                            <div>rs141080692     GT     
                              1000GENOMES:pilot_1_YRI_low_coverage_panel 
                                  -       deletion        9     
                               123543905       123543907</div>
                            <div>rs141080692     -     
                               1000GENOMES:pilot_1_YRI_low_coverage_panel 
                                  -       deletion        9     
                               123543905       123543907</div>
                            <div>rs141080692     GT      GMI:AK_Koreans 
                              -       deletion        9       123543905 
                                   123543907</div>
                            <div>rs141080692     -       GMI:AK_Koreans 
                              -       deletion        9       123543905 
                                   123543907</div>
                            <div>rs141080692     GT      GMI:NA10851   
                               -       deletion        9     
                               123543905       123543907</div>
                            <div>rs141080692     -       GMI:NA10851   
                               -       deletion        9     
                               123543905       123543907</div>
                            <div>rs141080692     GT      SSMP:SSM       
                              -       deletion        9       123543905 
                                   123543907</div>
                            <div>rs141080692     -       SSMP:SSM       
                              -       deletion        9       123543905 
                                   123543907</div>
                          </div>
                          <div><br>
                          </div>
                          <div>however, looking at the same database in
                            your website:</div>
                          <div><br>
                          </div>
                          <div><a
href="http://dec2015.archive.ensembl.org/Homo_sapiens/Variation/Population?db=core;r=9:123543406-123544407;v=rs141080692;vdb=variation;vf=127601209"
                              moz-do-not-send="true">http://dec2015.archive.ensembl.org/Homo_sapiens/Variation/Population?db=core;r=9:123543406-123544407;v=rs141080692;vdb=variation;vf=127601209</a><br>
                          </div>
                          <div><br>
                          </div>
                          <div>You can see that there is information
                            about its frequency in a whole bunch of
                            populations</div>
                          <div><br>
                          </div>
                          <div>How do I go about fetching these?</div>
                          <div><br>
                          </div>
                          <div>My script is pretty basic</div>
                          <div><br>
                          </div>
                          <div>first I fect all populations or only ones
                            I am interested in with:</div>
                          <div><br>
                          </div>
                          <div>
                            <div>foreach my $pop
                              (@{$population_adaptor->fetch_all()}){</div>
                            <div><span style="white-space:pre">   </span>my
                              $name = $pop->name();</div>
                            <div><span style="white-space:pre">   </span>if
                              (defined $name){</div>
                            <div><span style="white-space:pre">           </span>if
                              (defined $population){</div>
                            <div><span style="white-space:pre">                   </span>if
                              ($name =~ /\Q$population/){</div>
                            <div><span style="white-space:pre">                           </span>print
                              STDERR "Selected Populations: $name \n";</div>
                            <div><span style="white-space:pre">                           </span>push
                              @selected_populations, $name; </div>
                            <div><span style="white-space:pre">                   </span>}</div>
                            <div><span style="white-space:pre">           </span>}else{</div>
                            <div><span style="white-space:pre">                   </span>print
                              STDERR "Selected Populations: $name \n";</div>
                            <div><span style="white-space:pre">                   </span>push
                              @selected_populations, $name; </div>
                            <div><span style="white-space:pre">                   </span></div>
                            <div><span style="white-space:pre">           </span>}</div>
                            <div><span style="white-space:pre">   </span>}</div>
                            <div>}</div>
                          </div>
                          <div><br>
                          </div>
                          <div>I then use the variation adaptor to get
                            the variation object</div>
                          <div><br>
                          </div>
                          <div>
                            <div> my $variation =
                              $variation_adaptor->fetch_by_name($id);</div>
                          </div>
                          <div><br>
                          </div>
                          <div>Then I cycle though each variation
                            feature with </div>
                          <div><br>
                          </div>
                          <div>
                            <div>foreach my $vf
                              (@{$vf_adaptor->fetch_all_by_Variation($var)}){</div>
                          </div>
                          <div>
                            <div><span style="white-space:pre">           </span>my
                              @alleles = @{$vf->get_all_Alleles};</div>
                          </div>
                          <div><br>
                          </div>
                          <div>
                            <div><span style="white-space:pre">           </span>ALLELE_CYCLE:foreach
                              my $a (@alleles){</div>
                            <div><span style="white-space:pre">                   </span>my
                              $astr = $a->allele();</div>
                            <div><span style="white-space:pre">                   </span>my
                              $pop  = $a->population();</div>
                            <div><span style="white-space:pre">                   </span>my
                              $pop_name = "-";</div>
                            <div><span style="white-space:pre">                   </span>if
                              (defined $pop){</div>
                            <div><span style="white-space:pre">                           </span>$pop_name
                              = $a->population->name() ;</div>
                            <div><span style="white-space:pre">                   </span>}</div>
                            <div><span style="white-space:pre">                   </span>my
                              $freq = $a->frequency() || "-";</div>
                            <div><span style="white-space:pre">                   </span></div>
                            <div><span style="white-space:pre">                   </span>foreach
                              my $p (@{$selected_populations}){</div>
                            <div><span style="white-space:pre">                           </span>#print
                              STDERR $pop_name."\t".$p."\n";</div>
                            <div><span style="white-space:pre">                           </span>if
                              ($pop_name eq $p){</div>
                            <div><span style="white-space:pre">                                   </span>print
                              $out_fh join "\t", (<span style="white-space:pre">      </span>$var->name(),</div>
                            <div><span style="white-space:pre">                                                                                           </span>$astr,</div>
                            <div><span style="white-space:pre">                                                                                           </span>$pop_name,</div>
                            <div><span style="white-space:pre">                                                                                           </span>$freq,</div>
                            <div><span style="white-space:pre">                                                                                           </span>$varClass, </div>
                            <div><span style="white-space:pre">                                                                                           </span>$chr, </div>
                            <div><span style="white-space:pre">                                                                                           </span>$start, </div>
                            <div><span style="white-space:pre">                                                                                           </span>$end."\n");</div>
                            <div><span style="white-space:pre">                                   </span>next
                              ALLELE_CYCLE;</div>
                            <div><span style="white-space:pre">                           </span>}</div>
                            <div><span style="white-space:pre">                   </span>}</div>
                            <div><span style="white-space:pre">           </span>}</div>
                          </div>
                          <div>}</div>
                          <div><br>
                          </div>
                          <div>Am I doing something wrong? </div>
                          <div>There are the phase3 population data for
                            example. They are clealy included in your
                            site</div>
                          <div><br>
                          </div>
                          <div>Many thanks</div>
                          <div><br>
                          </div>
                          <div>Duarte</div>
                          <div><br>
                          </div>
                          <div><br>
                          </div>
                          <div><br>
                          </div>
                          <div><br>
                          </div>
                          <div><br>
                          </div>
                          <div><br>
                          </div>
                          <div><br>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-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>
  </body>
</html>