<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Erik,<div><br></div><div>Once you fetch your Gene object from the API, you could try:</div><div>my $slice = $slice_adaptor->fetch_by_gene_stable_id(<span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">'ENSG00000012123',10000</span>);</div><div>$slice->seq;</div><div>This will include 10kb up- and downstream of the gene.</div><div><br></div><div>You could also calculate the coordinates you'd like to fetch and then use:</div><div><span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">$slice_adaptor->fetch_by_region();</span></div><div><br></div><div>There is more information under the SliceAdaptor section in our Pdoc:</div><div><a href="http://www.ensembl.org/info/docs/Pdoc/ensembl/index.html">http://www.ensembl.org/info/docs/Pdoc/ensembl/index.html</a></div><div><br></div><div>Thanks,</div><div>Bronwen</div><div><br><div><div>On 12 Apr 2011, at 21:39, Erik van Renselaar wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font size="3" face="Calibri">Given an organism (say: human) and a gene name (say: Leptin) I am looking for the location of the gene in the DNA sequence. I then want to download 10KBp upstream. Is anyone aware of code that can help me do this? I understand I can use Ensembl’s web interface but I am working on a project that requires me to pull this data programmatically.</font></p><p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri"><span style="mso-spacerun: yes"> </span>Any pointers would be greatly appreciated.</font></font></p><p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font size="3" face="Calibri">Many thanks in advance,</font></p><p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font size="3" face="Calibri">Erik van Renselaar</font></p>
_______________________________________________<br>Dev mailing list<br><a href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>http://lists.ensembl.org/mailman/listinfo/dev<br></blockquote></div><br></div></body></html>