2
$\begingroup$

I'm trying to replicate this paper (https://pathsocjournals.onlinelibrary.wiley.com/doi/10.1002/path.5845) and I don't understand this bit from the "Data Preprocessing" section on page 4:

Beta values whose corre-sponding intensities on probe-level failed a z-test with a P value threshold of 0.01 against background signal were masked.

Can someone please explain what this means? I'm using R, mainly minfi.

Paper details:

Title: Machine learning models predict the primary sites of head and neck squamous cell carcinoma metastases based on DNA methylation

Details: It takes idat files from a few geo numbers for preprocessing and then models them. I have retrieved the idats from GEO used in the paper, fed them into minfi. My question is with the preprocessing while this data is in minfi.

New contributor
Munk is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
2
  • $\begingroup$ Please edit your question and give us more context. Ideally, make it so we only need the paper if we are particularly curious. If we need to read the paper to answer your question, that makes it far more unlikely that people will have the time to do so. So include enough for us to get the context. Also clarify exactly what part of this is confusing you. What is it you do not understand? $\endgroup$
    – terdon
    Commented yesterday
  • $\begingroup$ @terdon added paper description to my best abilities. Forgive for I'm still a beginner $\endgroup$
    – Munk
    Commented 17 hours ago

1 Answer 1

1
$\begingroup$

Okay I see. Basically there's a threshold for removing low intensity signal that can't be distinguished from background. That threshold seems tight at 1% of the mean of the normal distributio. Only the signal that is highly significantly above background signal is retained, i.e. subject to further analysis.

The way it works is that for a given CpG site there is a) methylated allele probe and b) unmethylated allele probe. The beta-value is a representation of those two intensities. What they want to do is filter out the background signal to avoid false positives.

Here's the manual https://bioconductor.org/packages/devel/bioc/vignettes/minfi/inst/doc/minfi.html#5_Quality_control

Here's a basic code (I stress the word basic) HOWEVER see the note on Noob in minfi below:

library(minfi)

myStuff <- read.metharray.exp("/Users/username/Desktop/myfile")
rgSet <- preprocessQuantile(myStuff)

M <- getM(rgSet)
U <- getU(rgSet)

beta <- M / (M + U)

filterProbesByZTest <- function(M, U, p.threshold = 0.01) {
  n <- ncol(M)
  filteredProbes <- rep(TRUE, ncol(M)) 
  
  for (i in 1:ncol(M)) {
    probeM <- M[, i]
    probeU <- U[, i]
    
    meanM <- mean(probeM, na.rm = TRUE)
    meanU <- mean(probeU, na.rm = TRUE)
    sdM <- sd(probeM, na.rm = TRUE)
    sdU <- sd(probeU, na.rm = TRUE)
    
    z_stat <- (meanM - meanU) / sqrt((sdM^2 / length(probeM)) + (sdU^2 / length(probeU)))
    p_value <- 2 * pnorm(-abs(z_stat))
    
    if (p_value > p.threshold) {
      filteredProbes[i] <- FALSE
    }
  }
  
  return(filteredProbes)
}

filteredProbes <- filterProbesByZTest(M, U, p.threshold = 0.01)
betaFiltered <- beta[, filteredProbes]

Note apart from being basic. the code isn't an exact replication of the authors method because they used Noob

ll data processing was performed in R (version 3.6.1; R Foundation for Statistical Computing, Vienna, Austria). Using the minfi library [26], raw IDAT files were imported; Noob normalization was performed [27]; and beta values were computed. Beta values whose corresponding intensities on probe-level failed a z-test with a P value threshold of 0.01 against background signal were masked.

preprocessNoob by Triche et al (2013)

My suspicion is that preprocessNoob comprises the above function. I'd need to read the paper in detail.

preprocessQuantile was used above and was part of the original minfi package


Note A key minfi paper describing the implementation is: https://genomebiology.biomedcentral.com/articles/10.1186/s13059-014-0503-2

The most advanced method I'm aware of is Heiss and Just (2019) There guys have developed a different tool set ewastools ... if its compatible.

Getting involved what is a periphery topic for me at the cutting edge of the field is something I'd rather avoid, admittedly I'm heavily into cancer stuff.

$\endgroup$
1
  • $\begingroup$ @Munk Try the above but read up on Noob. $\endgroup$
    – M__
    Commented 12 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.