Hello all,
I am trying to compare 8 samples that came off an array using minfi on R. These are not in any groups, I am just trying to compare to each other for characteristics such as MGMT methylation and other genes. I am stuck at the dmpFinder() function, as the following error occurs:
Error in smooth.spline(lambda, vec.p0, w = ncs.weights, df = 3) :
missing or infinite values in inputs are not allowed
I have normalized my data effectively, so I am not sure why this is tossing this error. Below is my full code up to this point:
baseDir <- "C:/baseDir/"
list.files(baseDir, recursive = TRUE)
targets <- read.metharray.sheet(baseDir, pattern="Sample_Sheet.csv")
rgSet <- read.metharray.exp(targets=targets)
annotation(rgSet) = c(array = "IlluminaHumanMethylationEPIC", annotation = "ilm10b2.hg19")
# Get an overview of the data
rgSet
pData(rgSet)
getManifest(rgSet)
MSet <- preprocessRaw(rgSet)
MSet
ratioSet <- ratioConvert(MSet, what = "both", keepCN = TRUE)
# Observe the change of the assays
ratioSet
gset <- mapToGenome(ratioSet)
gset
beta <- getBeta(gset)
head(beta)
m <- getM(gset)
head(m)
cn <- getCN(gset)
head(cn)
qc <- getQC(MSet)
plotQC(qc)
detP <- detectionP(rgSet)
head(detP)
phenoData <- pData(MSet)
densityPlot(MSet, sampGroups = phenoData$Surgical_Case)
mSetSq <- preprocessQuantile(MSet)
detP <- detectionP(rgSet)
detP <- detP[match(featureNames(mSetSq),rownames(detP)),]
# remove any probes that have failed in one or more samples; this next line
# checks for each row of detP whether the number of values < 0.01 is equal
# to the number of samples (TRUE) or not (FALSE)
keep <- rowSums(detP < 0.01) == ncol(mSetSq)
table(keep)
# Subset the GenomicRatioSet
mSetSqFlt <- mSetSq[keep,]
mSetSqFlt
mSetSqFlt <- dropLociWithSnps(mSetSqFlt)
mSetSqFlt
grp <- targets$Surgical_Case
m_test <- getM(mSetSqFlt)
dmp_result <- dmpFinder(dat = m_test, pheno = grp)
my m_test via getM is a large matrix, here are some example values: -2.42122784 -2.8134431635 -3.06483917 -2.995262320 -2.85917300 0.79549058 -1.21399109
I would love any guidance as this is my first time working with this data. Again, my end goal is to look for certain genes such as MGMT to see if they are methylated, as well as create a copy number plot. I research online and they said to use the dmpFinder function, but maybe that is not the case for me.
Thank you, Roy