Tutorial: Differential Methylation Analysis using ChAMP
0
3 months ago by
learning.iq840 wrote:

Hello All,

I am new to the methylation analysis and to R. I need help in doing the Differential Methylation Analysis, please. From TCGA, I got a text file for each patient. I extract beta values columns from all the patients' files and made all in one table where each column header is the patient ID. I have another file where it has 2 columns. the first column is the sample names, which has all patients IDs. the second column is sample type, where I have T to represent the cancer samples and C to represent the normal or control samples. Now, I am not sure how I can use these files to do the differential methylation analysis in ChAMP. This what I have so far :

setwd("C:/Users/zain/Documents/R/win-library/3.6/ChAMPdata/ZK_data/")
mydata <-as.matrix(mydata)
phenotypicData <-as.matrix(phenotypicData)
myDMR=champ.DMR(beta=mydata, pheno=phenotypicData[,"Sample_Group"], compare.group=c("T","C"), arraytype="450K")


here is the files format (I just made it up because I can not share the real data because it is protected. the header in real data has the real patient ID not patient and case but I put the patient sample ID followed by control samples IDs):

Here is the beta values file https://ibb.co/hHrY7M8

I tried it with and without beta as a header and with and without patients IDs. All did not work.

Here is the phenotypic data file: https://ibb.co/z4zNhDC

When I run this code, I get the following error:

Error in 1 - Beta : non-numeric argument to binary operator

After I removed the first 2 rows from the beta file, the file became only the beta values without any header and without the patients' IDs

mydata <-read.table("Reduced_CaseNormalSamples.txt", header = F, sep="\t", row.names=1)
mydata <-as.matrix(mydata)
myDMR=champ.DMR(beta=mydata, pheno=phenotypicData[,"Sample_Group"], compare.group=c("T","C"), arraytype="450K")


It runs without any error and the output is https://ibb.co/QpxkDyc

Note: if the numbers do not make sense that is because they are made up numbers but the actual number is in a similar format.

I am not sure if what I did is right or I did something wrong. If it is right, how I can make sense of this result. How do I know what the cites that differentially methylated and the result does not have the CG islands' names?

Any help would highly be appreciated.

Best regards,

Zain.

champ tutorial • 155 views
modified 10 weeks ago by Yuan Tian110 • written 3 months ago by learning.iq840
Answer: Differential Methylation Analysis using ChAMP
0
10 weeks ago by
Yuan Tian110
University College London
Yuan Tian110 wrote:

Hi Zain:

Sorry that I just see this post, you could also send email to champ450K@gmail.com.

The error seems because of your beta matrix. I suspect after loading, the rowname of beta matrix would be read as first column. Could you post head(mydate) here as well?

So after running champ.DMR(), you get only one DMR right? If everything runs OK, the result should be correct. This list only contains DMR's information, like start, ends, length .e.g, CpG Island name is not included, but you can use DMR.GUI() function to check more detailed result.

Best Yuan Tian