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 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.