On Sun, Mar 13, 2011 at 9:00 PM, Dario Strbenac <d.strbe...@garvan.org.au>wrote:

> Hello,
>
> I have a group of genomic windows as a GRanges object, and a GRangesList
> object of length 6 (6 lanes of sequencing).
>
> I think it should be possible to do counting of reads simply using
> countOverlaps :
>
> > showMethods(countOverlaps)
> ...          ...          ...
> query="GenomicRanges", subject="GRangesList"
> ...          ...          ...
>
> But I only get one set of counts, not a matrix of 6 columns of counts.
>
> > summary(aG)
>  Length   Class    Mode
>  24966 GRanges      S4
> > summary(ipsList)
>     Length       Class        Mode
>          6 GRangesList          S4
> > str(countOverlaps(aG, ipsList))
>  int [1:24966] 6 6 6 6 6 6 4 5 6 6 ...
>
> Could this be a bug then ? Or is the design of the function intended for
> something different ?
>
>
It means something different. Each element of the GRangesList is treated as
a single compound range in overlap detection. A query need only overlap any
range in the component GRanges to be considered overlapping. Thus, you're
getting the number of elements in the GRangesList that overlap each of your
query ranges. This is useful, e.g., for RNA-seq data, where the reads and
gene models are compound ranges.

GenomicFeatures really needs an additional list structure that does not have
this semantic. For now, you can just lapply over the GRangesList.

Michael

> sessionInfo()
> R version 2.12.0 (2010-10-15)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> locale:
>  [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C
>  [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8
>  [5] LC_MONETARY=C              LC_MESSAGES=en_AU.UTF-8
>  [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] GenomicRanges_1.2.3 IRanges_1.8.9
>
> loaded via a namespace (and not attached):
> [1] tools_2.12.0
>
> --------------------------------------
> Dario Strbenac
> Research Assistant
> Cancer Epigenetics
> Garvan Institute of Medical Research
> Darlinghurst NSW 2010
> Australia
>
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
>

        [[alternative HTML version deleted]]

_______________________________________________
Bioc-sig-sequencing mailing list
Bioc-sig-sequencing@r-project.org
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

Reply via email to