<div dir="ltr">Hi Nathalie,<div><br></div><div>We wouldn't recommend using the API to retrieve all of the rsIDs; there are >60million and the API is not optimised for retrieving the whole dataset in this way.</div><div><br></div><div>Instead I'd recommend you extract the IDs from one of our dump files; probably VCF or GVF would be the easiest to work with:</div><div><br></div><div>curl <a href="ftp://ftp.ensembl.org/pub/release-77/variation/vcf/homo_sapiens/Homo_sapiens.vcf.gz">ftp://ftp.ensembl.org/pub/release-77/variation/vcf/homo_sapiens/Homo_sapiens.vcf.gz</a> | zcat | grep -v # | cut -f 3 | head<br></div><div><br></div><div>(remove the head and redirect to a file to get all of them).</div><div><br></div><div>The somatic mutations are in a separate file, <a href="ftp://ftp.ensembl.org/pub/release-77/variation/vcf/homo_sapiens/Homo_sapiens_somatic.vcf.gz">ftp://ftp.ensembl.org/pub/release-77/variation/vcf/homo_sapiens/Homo_sapiens_somatic.vcf.gz</a></div><div><br></div><div>To answer your question, to fetch somatic mutations use fetch_all_somatic() (see <a href="http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1DBSQL_1_1VariationAdaptor.html#a22e69dacdd77542463320a1ef16b151f">http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1DBSQL_1_1VariationAdaptor.html#a22e69dacdd77542463320a1ef16b151f</a>)</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 7 October 2014 10:38, Nathalie Conte <span dir="ltr"><<a href="mailto:nconte@ebi.ac.uk" target="_blank">nconte@ebi.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
I would like to get all variation ID  (ie rs1822893 )from ensembl, I am using the variation API to do so.<br>
Is it the best way? the fetch_all method seems to get all germline variation, is there another method for somatic ones?<br>
<br>
my $vf_adaptor = Bio::EnsEMBL::Registry->get_adaptor('human', 'variation', 'variationfeature');<br>
my @vfs = @{$vf_adaptor->fetch_all()};<br>
foreach my $vf(@vfs){<br>
                 if ($vf){<br>
                        my $varID=defined($vf->variation_name) ? $vf->variation_name :'No_variation';<br>
                        if ($varID) {<br>
print  "$varID\n";<br>
                        }<br>
                }<br>
}<br>
<br>
<br>
_______________________________________________<br>
Dev mailing list    <a href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>
Posting guidelines and subscribe/unsubscribe info: <a href="http://lists.ensembl.org/mailman/listinfo/dev" target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a><br>
Ensembl Blog: <a href="http://www.ensembl.info/" target="_blank">http://www.ensembl.info/</a><br>
</blockquote></div><br></div>