<p>Hi!</p>

<p>I am curious to know, how can I find all the genes within a genomic region, preferable in a file or may be in a separate window.</p>

<p>for instance say, I have a genomic region spanning from  chr1:1,783,590-2,597,819  and I want to get all the genes present in this region how can I get it? 
I know I can use UCSC browser to see all the genes present in that region but how can I get it as a list in a file.</p>

<p>Thank you</p>

<p>Or you can create a query in <a href="http://www.ensembl.org/biomart/martview/">BioMart</a>.
Below an example using the <a href="http://www.bioconductor.org/packages/release/bioc/html/biomaRt.html">Bioconductor biomaRt</a> package (a wrapper to the on-line web service):</p>

<pre><code>library(biomaRt)
mart &lt;- useMart("ensembl")
mart &lt;- useDataset("hsapiens_gene_ensembl", mart)
attributes &lt;- c("ensembl_gene_id","start_position","end_position","strand","hgnc_symbol","chromosome_name","entrezgene","ucsc","band")
filters &lt;- c("chromosome_name","start","end")
values &lt;- list(chromosome="1",start="1783590",end="2597819")
all.genes &lt;- getBM(attributes=attributes, filters=filters, values=values, mart=mart)
</code></pre>
