This works fine. Thank you.
Hermann

2013/1/18 Dario Strbenac <D.Strbenac@garvan.org.au>

> Assuming that you are working with hg19,
>
> library(BSgenome.Hsapiens.UCSC.hg19)
>
> chrLengths <- seqlengths(Hsapiens)
> chrLengths <- chrLengths[paste("chr", c(1:22, 'X', 'Y'), sep = '')]
> Gcoverage <- coverage(testset.gr)
>
> coverageMeans <- unlist(mapply(function(x, y)
>                  {
>                         starts = seq(1, y, 200)
>                         ends = starts + 199
>                         mean(Views(start = starts, end = ends, subject =
> Gcoverage[[x]]), na.rm = TRUE)
>                  }, names(chrLengths), chrLengths), use.names = FALSE)
>
> > coverageMeans[51]
> [1] 0.285
> > coverageMeans[52]
> [1] 0.765
>
> _______________________________________________
> 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]]

