This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to export with minfi quantile normalized preprocessed 850K methylation data?

Hello all,

I am trying to normalize my raw methylation beta-values using minfi with R version 3.6.0. I have been following the bioconductor user guide in order to do so:

https://www.bioconductor.org/help/course-materials/2015/BioC2015/methylation450k.html.

After running the preprocessQuantile function, I receive the following standard messages:

# [preprocessQuantile] Mapping to genome. 
# [preprocessQuantile] Fixing outliers. 
# [preprocessQuantile] Quantile normalizing.

As well as the following warning message:

# Warning message: 
# In .getSex(CN = CN, xIndex = xIndex, yIndex = yIndex, cutoff = cutoff) : An inconsistency was encountered while determining sex. One possibility is that only one sex is present. We recommend further checks, for example with the plotSex function.

I am not concerned about the warning message because I do expect for all my samples to be female.

My issue is with exporting the preprocessQuantile normalized beta values from R. The Bioconductor Minfi User Guide states that: "Note: The function returns a GenomicRatioSet object ready for downstream analysis."

I tried using write.table function to do so and received this error:

# Error in as.vector(x) : no method for coercing this S4 class to a vector.

Is it not possible to export files into .txt format?

For reference also, this is the write.table function that I had used:

write.table(GRset_ascites.quantile, "H:/Cyto/PCPGM/IDAT/Cytoquantilenorm.txt", sep="\t")

I am admittedly inexperienced with R, but still learning! I'm also a long-time-lurker on Biostars, but this is my first time posting so please critique my question as needed. :)

r methylation minfi quantile normalization

1 answer

Hi everyone,

Thought I would post what ended up working for me, hopefully it can be helpful to someone in the future!

Again, I was following: "Analysis of 450k data using minfi" User Guide by Jean-Philippe Fortin and Kasper Daniel Hansen

I was zeroed in on following the steps for preprocessQuantile normalization (Section 5.4) and was trying to use write.table function on the output: GenomicRatioSet object.

First I needed to: getBeta(GRset.quantile) # function is first mentioned in Sections 3.1 & 3.2

And then use: write.table(beta, file = "H:/Cyto/PCPGM/IDAT/CytoQuantileNorm.txt", sep = "\t")

Log in to answer this question.