Tutorial:Differential Methylation Analysis using ChAMP
Entering edit mode
Last seen 23 months ago

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 :

mydata <-read.table("Reduced_CaseNormalSamples.txt", header = TRUE, sep="\t")
mydata <-as.matrix(mydata)
phenotypicData <-read.table("Reduced_NT_TP_PatientsIDs.csv", header = TRUE, sep=",")
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 beta values matrix 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: phenotypic data 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,


champ Tutorial • 526 views
Entering edit mode
Yuan Tian ▴ 220
Last seen 3 months ago
University College London

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


Login before adding your answer.

Traffic: 395 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6