[BioC] Package/Function to calculate CpG density

Mark Robinson mrobinson at wehi.EDU.AU
Fri Nov 6 23:41:53 CET 2009


Hi Tim.

There are probably more elegant ways, but you might also have a look  
at the CGcount() function in the MEDME package.  It requires a  
MEDMEset object, but you can create a dummy object with your regions  
of interest.

?"MEDMEset-class"
?CGcount

Quick example:

library("MEDME")
library("BSgenome.Hsapiens.UCSC.hg18")

mms <- new("MEDMEset", chr = rep("chr1",2), pos=c(91642000,91642750),
            logR=matrix(,nr=2,nc=2,dimnames=list(c("roi1","roi2"))),  
organism="hsa")
CGcount(mms, wsize=250, wFunction="none")@CGcounts

This gives for the 2 positions:

 > CGcount(mms, wsize=250, wFunction="none")@CGcounts
chr1
[1]  2 33

... and if you look in the genome browser, the second region is right  
in a CpG island, hence the higher score.

Cheers,
Mark

On 7-Nov-09, at 8:40 AM, Neel Aluru wrote:

> Hey Tim,
>
> I just noticed it this week. Follow the link to Rafael Irizarry web  
> site (http://rafalab.jhsph.edu/). They have published a paper on  
> defining CpG islands using R package. Click on "New CpG islands"  
> link in the research overview page.
>
> Neel
>
> On Nov 6, 2009, at 4:35 PM, Tim Smith wrote:
>
>> Hi,
>>
>> Is there a package that has a function to calculate the CpG density  
>> between specific locations on a chromosome?
>> thanks!
>>
>>
>>
>> 	[[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>
> Neel Aluru
> Postdoctoral Scholar
> Biology Department
> Woods Hole Oceanographic Institution
> Woods Hole, MA 02543
> USA
> 508-289-3607
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

------------------------------
Mark Robinson, PhD (Melb)
Epigenetics Laboratory, Garvan
Bioinformatics Division, WEHI
e: m.robinson at garvan.org.au
e: mrobinson at wehi.edu.au
p: +61 (0)3 9345 2628
f: +61 (0)3 9347 0852



More information about the Bioconductor mailing list