Thanks Sean. It seemed to have worked.

D.

On Mon, Aug 20, 2012 at 7:03 PM, Sean Davis <sdavis2@mail.nih.gov> wrote:

>
>
> On Mon, Aug 20, 2012 at 11:55 AM, d r <dolevrahat@gmail.com> wrote:
>
>> Hi Steve
>>
>> I have tried running your code on my machine and got the same error
>> message.
>>
>>
> distanceToNearest for GRanges was added in version 1.9.4 of GenomicRanges,
> so it is currently available in the devel version of bioconductor.
>
>
> http://article.gmane.org/gmane.science.biology.informatics.conductor/40360/match=distancetonearest+granges
>
> For information on using the devel version, see here:
>
> http://www.bioconductor.org/developers/useDevel/
>
> Sean
>
>
>
>> This is my sessuinInfo():
>>
>> R version 2.15.1 (2012-06-22)
>> Platform: x86_64-pc-mingw32/x64 (64-bit)
>>
>> locale:
>> [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
>> States.1252    LC_MONETARY=English_United States.1252
>> [4] LC_NUMERIC=C                           LC_TIME=English_United
>> States.1252
>>
>> attached base packages:
>> [1] splines   stats     graphics  grDevices utils     datasets
>> methods   base
>>
>> other attached packages:
>>  [1] doBy_4.5-3           MASS_7.3-20          snow_0.3-10
>> lme4_0.999999-0      Matrix_1.0-6         lattice_0.20-6
>> multcomp_1.2-12
>>  [8] mvtnorm_0.9-9992     R2HTML_2.2           survival_2.36-14
>> GenomicRanges_1.8.12 IRanges_1.14.4       BiocGenerics_0.2.0
>>
>> loaded via a namespace (and not attached):
>> [1] grid_2.15.1   nlme_3.1-104  stats4_2.15.1 tools_2.15.1
>>
>> Thanks in advance
>> Dolev
>>
>>
>>
>> On Mon, Aug 20, 2012 at 6:14 PM, Steve Lianoglou <
>> mailinglist.honeypot@gmail.com> wrote:
>>
>> > Hi,
>> >
>> > On Mon, Aug 20, 2012 at 7:41 AM, d r <dolevrahat@gmail.com> wrote:
>> > > I am attempting to use GRanges to calculate the distances between
>> > > certain  probes
>> > > and their nearest respective transcription start sites. I have created
>> > two
>> > > GRanges objects,  one containing  the position of the probes and
>> another
>> > > containing the positions of the genes (which I produced from USCS
>> Table
>> > > Browser).
>> > >
>> > > This is the code I used:
>> > >
>> > >
>> >
>> genes<-GRanges(seqnames=refseq[,1],ranges=IRanges(start=refseq[,4],end=refseq[,5]),strand=refseq[,3],gene=refseq[,11])
>> > >
>> > >
>> >
>> probes<-GRanges(seqnames=annotations[,3],ranges=IRanges(start=annotations[,4],end=annotations[,4]),probe=annotations[,1])
>> > >
>> > > distance_from_TSS<-distanceToNearest(probes,genes)
>> > >
>> > > when I tried to run the last command I got this error message:
>> > >
>> > > Error in function (classes, fdef, mtable)  :
>> > >
>> > >   unable to find an inherited method for function "distanceToNearest",
>> > for
>> > > signature "GRanges", "GRanges"
>> >
>> > Can we get the output of your sessionInfo() please?
>> >
>> > This seems to work find here:
>> >
>> > R> gr <- GRanges('chr1', IRanges(c(10, 50), width=10), '+')
>> > R> gg <- GRanges('chr1', IRanges(c(1, 30, 80), width=10), '+')
>> > R> distanceToNearest(gr, gg)
>> > DataFrame with 2 rows and 3 columns
>> >   queryHits subjectHits  distance
>> >   <integer>   <integer> <integer>
>> > 1         1           2        11
>> > 2         2           3        21
>> >
>> > R> sessionInfo()
>> > R version 2.15.1 (2012-06-22)
>> > Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>> >
>> > locale:
>> > [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>> >
>> > attached base packages:
>> > [1] stats     graphics  grDevices utils     datasets  methods   base
>> >
>> > other attached packages:
>> > [1] GenomicRanges_1.9.48 IRanges_1.15.35      BiocGenerics_0.3.1
>> >
>> > HTH,
>> > -steve
>> >
>> > --
>> > 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
>> >
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>
>

	[[alternative HTML version deleted]]

