[BioC] Find all the genes n genes either side on the chromosome

Steve Lianoglou mailinglist.honeypot at gmail.com
Thu Jul 21 17:40:36 CEST 2011


On Thu, Jul 21, 2011 at 11:23 AM, James Perkins
<jperkins at biochem.ucl.ac.uk> wrote:
> Dear all,
> Given a gene of interest, is there an easy way to get the n nearest
> genes either side (i.e. 5' and 3' direction) on the chromosome,
> without leaving R?
> I looked in biomart for a way to get the nearest gene either side but
> couldn't see anything obvious. If this exists I suppose that could be
> one way, just repeat the getBM call n times.
> Any pointers at how to go about doing this would be very gladly received.

Bird's eye view:

Create yourself a TranscriptDb object and extract your genes of
interest from it into a GRanges object (perhaps by calling

`precede` and `follow` will find you neighboring ranges to a query
given a subject, which will give you the closes genes on either side
of your points of interest.

I'll leave getting N such genes as an exercise for the reader :-)


Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

More information about the Bioconductor mailing list