How to perform a methylation analyisis from m values
1
0
Entering edit mode
Irene • 0
@74ca01f8
Last seen 5 months ago
Spain

I am trying to perform a methylation analysis from a txt file which contains the m values.
The RNA samples were taken to a company that performed an Illumina EPIC array.
They performed the first steps of the analysis which consisted of the pre-processing and quality control of the data using minfi package.
Then, they sent us two txt files one with the m-values and the other with the b-values.
The structure of these data in the txt file is (I am showing only the first 2 lines of17.000)
island patient1 patient2 patient3 control1 control2 control3
cg14817997 3.09546 2.11941 2.90160 1.91566 2.45522 2.36514

My doubt is when it comes to start the analysis from these data. I understand that I have to use the function:

makeGenomicRatioSetFromMatrix(mat, rownames = NULL, pData = NULL,
                              array = "IlluminaHumanMethylation450k",
                              annotation = .default.450k.annotation,
                              mergeManifest = FALSE, what = c("Beta", "M"))

It creates a GenomicRatioSet object that stores the methylation data along with additional information such as genomic coordinates of regions, genomic annotations and sample meta-information.
This function requires a matrix and I don't know how to set it up. I also think that I need to say R which are my groups so I create this:

df <- data.frame( test=1, d=c(rep('patient', 3 ), rep('control', 3)) )
df$d <- factor( df$d, levels = c('patient', 'control'))

However, I need help constructing the matrix correctly so that the function makeGenomicRatioSetFromMatrix works correctly and can search for differentially methylated positions.

Any help is welcome.

Thank u

MethylationArrayData methylationArrayAnalysis • 576 views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 2 hours ago
United States

You could create the matrix by doing something like this.

mat <- as.matrix(read.table(<filename goes here>, header = TRUE, row.names = 1, sep = "\t"))
## you might need to adjust the 'sep' argument, depending on the separator for your text file.
rgset <- makeGenomicRatioSetFromMatrix(mat, pData = df, 
                                       array = "IlluminaHumanMethylationEPIC",
                                       annotation = "IlluminaHumanMethylationEPICanno.ilm10b4.hg19")

That's untested code, as I don't have your text file, but it should get you close.

0
Entering edit mode

Thank you very much @JamesW.MacDonald, it worked!

Now I need to obtain the different methylation positions (DMPs)

I think that the function needed is "dmpFinder":

dmpFinder(dat, pheno, type = c("categorical", "continuous"),
    qCutoff = 1, shrinkVar = FALSE)

However, I don't know if I am using the function correctly. In my case, I substitute the arguments in the following way, but when I run the function, I get the following error

result<-dmpFinder(mat, df$d, type = c("categorical"),
    qCutoff = 1, shrinkVar = FALSE)

Error in dmpFinder(mat, df$d, type = c("categorical"), qCutoff = 1, shrinkVar = FALSE) : 
  is.numeric(dat) is not TRUE

Maybe I'm not using the right function either...

Thank u

ADD REPLY

Login before adding your answer.

Traffic: 707 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6