al2na / methylKit

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

NA values #323

Open Silvia-Giorgia-Signorini opened 2 months ago

Silvia-Giorgia-Signorini commented 2 months ago

Hi! I am analysing methylation data with methylKit on R and I got some NA values after the unite function, after merging samples:

meth=unite(myobj, destrand=FALSE)

This issue does not allow me to do:

getCorrelation(meth) clusterSamples(meth) PCASamples(meth)

because of this NA. What can I do to solve this issue? Do you have any advice? I really thank you in advance for your help. Silvia

alexg9010 commented 2 months ago

Hi @Silvia-Giorgia-Signorini,

If you changed the min.per.group during merging, please see Altuna's previous comment:

This is a bug and a feature. When you use min.per.group you will have NAs in your dataset because not every CpG is covered in all samples. correlation with default arguments produces NAs if there are NAs present in one of the vectors. For now, for correlation and clustering purposes do not use min.per.group, differential methylation should work when there are NAs

Otherwise, can you share more details? Do all your rows contain NAs or only a few of them? Does using na.omit() solve your issue?

Best, Alex