hansenlab / minfi

Devel repository for minfi
58 stars 68 forks source link

"subsetByLoci" and "preprocessIllumina" can not work together #84

Closed TracyHIT closed 7 years ago

TracyHIT commented 7 years ago

metharray<-read.metharray(basename,extended = FALSE, verbose = FALSE, force = FALSE) detP<-detectionP(metharray) rownames<-rownames(detP) filterpronames<-rownames[which(detP<=0.05)] metharray<-subsetByLoci(metharray, includeLoci = filterpronames) mset <- preprocessIllumina(metharray)

Here I can not go on ~ ~ I want to dorp some probes which failed detection p-value testing.

Error in getGreen(rgSet)[getProbeInfo(rgSet, type = "II")$AddressA, ] : ...

Jfortin1 commented 7 years ago

Hi TracyHIT.

First, they do work together -- tested and confirmed on my side. "detP" is a matrix, and therefore to use "filterpronames<-rownames[which(detP<=0.05)]" does not quite make sense. "which(detP<=0.05)" will return a vector m x n, where m is number of rows and n is the number of columns.

If you want to keep probes for which the detP is less or equal to 0.05 for all samples, I suggest to use the following instead: filterpronames <- which(rowSums(detP <= 0.05) == ncol(detP))

kasperdanielhansen commented 7 years ago

@TracyHIT : make sure you are running the latest version of minfi (1.20). And try to make a reproducible example using say minfiData or minfiDataEPIC. I cannot reproduce the error either.

TracyHIT commented 7 years ago

@kasperdanielhansen :I am running the version of the minfi is "1.18.6" and I just use the data download from "https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSM999339"

so the "basename<-GSM999339_hg19_wgEncodeHaibMethyl450HepatoSitesRep1"

Thank you for your answer

TracyHIT commented 7 years ago

@Jfortin1 👍 I am running the version of the minfi is "1.18.6" and I just use the data download from "https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSM999339"

I only use only one chip‘s data~ ~ I accepted your suggestion and changed the "which(detP<=0.05)"

~~ but it still can not work ~~ I want to drop some probs.

kasperdanielhansen commented 7 years ago

Use the new bioconductor / minfi, that should fix your problem. We cannot even fix the old version anymore.

TracyHIT commented 7 years ago

Using new bioconductor / minfi, I have fixed my problem~