Tutorial:Differential Methylation Analysis using ChAMP
1
0
Entering edit mode
@learningiq84-21072
Last seen 5.4 years 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 :

setwd("C:/Users/zain/Documents/R/win-library/3.6/ChAMPdata/ZK_data/")
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,

Zain.

champ Tutorial • 2.4k views
ADD COMMENT
0
Entering edit mode
Yuan Tian ▴ 290
@yuan-tian-13904
Last seen 7 months ago
United Kingdom

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

ADD COMMENT

Login before adding your answer.

Traffic: 723 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