al2na / methylKit

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

Correct way to read in modkit bedmethyl file? #300

Closed Ge0rges closed 11 months ago

Ge0rges commented 11 months ago

Hello,

I was wondering what the correct way to read in a bedmethyl file with all context 5mC and 5hmC methylation is? I tried:

methObj=methRead(files.list, sample.id = list("methylRawList"), assembly="106_sub", treatment=c(0), context ="CHH", pipeline=list(fraction = FALSE, chr.col = 1, start.col = 2, end.col = 3, coverage.col = 10, strand.col = 6, freqC.col = 11))

My bedmethyl file is standard and looks like this according to this standard.

contig_16950    47      48      m     1 -       47      48      255,0,0 1 0.00 0 1 0 0 0 0 0    

However I get the following error:

Erreur in round(data[, coverage.col]) :
  argument non numerical for a mathematical function

where files.list points to a string of an absolute path to bedmethyl file.

Ge0rges commented 11 months ago

Turns out the bedmethyl file was not consistent in its use of tab as a delimiter. See this issue, if using bedmethyl files generated by modkit.

alexg9010 commented 11 months ago

Hi @Ge0rges

Thanks for raising this issue, I think this will become more relevant in the future.

I will have a closer look into the problem, probably we should add support for "modKitBedmethyl" format.

Best, Alex

Ge0rges commented 11 months ago

I believe the modkit team is switching to the standard tab delimited file see https://github.com/nanoporetech/modkit/issues/43#issuecomment-1734502646