[BioC] function precede() not working with GRanges
Martin Morgan
mtmorgan at fhcrc.org
Tue Jan 4 20:52:55 CET 2011
On 01/04/2011 11:34 AM, Jeremiah Degenhardt wrote:
> Hello Bioconductor,
>
> I am trying to use the function precede() with two GRanges objects to find
> the closest element from gr1 to an element in gr2. precede() shows that it
> should work with a GRanges object, however, when I try to use it it returns
> only a vector of "NA".
>
> Pasted below is a simplified bit of code to reproduce the error and my
> session info.
>
> Additionally, it would be even nicer if the function nearest() were
> implemented for a GRanges object.
>
> Thanks in advance for the help
Hi Jeremiah --
Provide strand information for at least one of the reads, e.g.,
> gr1 <- GRanges("chr1", IRanges(1,10), "-")
> gr2 <- GRanges("chr1", IRanges(20,30))
> precede(gr2, gr1)
[1] 1
or do the comparison on IRanges with
> precede(ranges(gr1), ranges(gr2))
[1] 1
nearest will be implemented.
Martin
> Jeremiah
>
>> gr1 <- GRanges("chr1", IRanges(1,10))
>> gr2<- GRanges("chr1", IRanges(20,30))
>> precede(gr2, gr1)
> [1] NA
>>
>
>> sessionInfo()
> R version 2.13.0 Under development (unstable) (2010-12-07 r53809)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> locale:
> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
> [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8
> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
> [9] LC_ADDRESS=C LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] grid stats graphics grDevices utils datasets methods
> [8] base
>
> other attached packages:
> [1] motifRG_0.0.2 rtracklayer_1.11.8 RCurl_1.5-0
> [4] bitops_1.0-4.1 seqLogo_1.17.0 chipseq_1.1.2
> [7] ShortRead_1.9.8 Rsamtools_1.3.11 lattice_0.18-3
> [10] BSgenome_1.19.2 Biostrings_2.19.2 GenomicRanges_1.3.5
> [13] IRanges_1.9.16 multicore_0.1-3
>
> loaded via a namespace (and not attached):
> [1] Biobase_2.11.6 hwriter_1.3 tools_2.13.0 XML_3.2-0
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
--
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109
Location: M1-B861
Telephone: 206 667-2793
More information about the Bioconductor
mailing list