al2na / methylKit

R package for DNA methylation analysis
https://bioconductor.org/packages/release/bioc/html/methylKit.html
208 stars 96 forks source link

feature request: subtract.and.adjust.mkBS.vs.oxBS #25

Closed avilella closed 8 years ago

avilella commented 8 years ago

This is a feature request to extend/clarify the method adjust.methylC found in the development branch of methylKit. See below:

I would like to know if the 5hmC levels listed below are from an (a) oxBS experiment or (b) 5hmC levels from the subtraction of an oxBS and a BS (or mock BS, mkBS) experiment:

I presume it's (b), in which case it would take multiple steps from the bam/bismark calls to reach that point in the analysis and then call methylKit.

It would be great if there was an alternative function that was able to load the values straight from parallel mkBS and oxBS experiments on the same sampleset. For example, I imagine something like:

myoxBS = read(oxBS.files...)
mymkBS = read(mkBS.files...)
adjusted = subtract.and.adjust.mkBS.vs.oxBS(mymkBS, myoxBS)

Let me know if this makes sense.

     # read 5hmC and 5mC files
     hmc.file=system.file("extdata", "test1.myCpG.txt", package = "methylKit")
     mc.file =system.file("extdata", "test2.myCpG.txt", package = "methylKit")

     my5hmC=read( hmc.file,sample.id="hmc",assembly="hg18")
     my5mC =read( mc.file,sample.id="mc",assembly="hg18")

     # adjusting the 5mC levels using 5hmC levels
     adjusted.5mC=adjust.methylC(my5mC,my5hmC)

Adjust measured 5mC levels using 5hmC levels

Description:

Measured 5mC levels via bisulfite sequencing might be a combination of 5hmC and 5mC levels since bisulfite sequencing can not distinguish between the two. This function can adjust 5mC levels of a bisulfite sequencing experiment if the user supplies corresponding 5hmC levels from the same sample.


Usage:

adjust.methylC(mc,hmc,save.db,...,chunk.size)

S4 method for signature 'methylRaw,methylRaw'

adjust.methylC(mc, hmc, save.db = FALSE, ..., chunk.size = 1e+06)

S4 method for signature 'methylRawList,methylRawList'

adjust.methylC(mc, hmc, save.db = FALSE, ..., chunk.size = 1e+06)

S4 method for signature 'methylRawDB,methylRawDB'

adjust.methylC(mc, hmc, save.db = TRUE, ..., chunk.size = 1e+06)

S4 method for signature 'methylRawListDB,methylRawListDB'

adjust.methylC(mc, hmc, save.db = TRUE, ..., chunk.size = 1e+06)

al2na commented 8 years ago

I think adjust.methylC() is doing this already