This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Methylkit (differential methylation analysis) error in data frame

Hi Friends, I am performing the differential methylation analysis using methylkit but it is throwing error in data frame. " Error in [.data.frame(data, , 6) : undefined columns selected". Can anyone help me to solve this error. Following is my R cmmand lnes. Thanks Raj

> library(methylKit)
> library(methylKit)
> file.list=list( "CpG_context_ST12_B1_F_bismark_hisat2_pe.txt","CpG_context_ST12_B2_F_bismark_hisat2_pe.txt","CpG_context_ST12_B3_F_bismark_hisat2_pe.txt","CpG_context_ST2_B1_F_bismark_hisat2_pe.txt","CpG_context_ST2_B2_F_bismark_hisat2_pe.txt","CpG_context_ST2_B3_F_bismark_hisat2_pe.txt")
> 
> myobj=methRead(file.list,
+                  sample.id=list("test1","test2","test3","ctrl1","ctrl2","ctrl3"),
+                  assembly="Edwards",
+                  treatment=c(1,1,1,0,0,0),
+                  context="CpG",
+                  mincov = 10,
+                  pipeline = "bismark"
+   )
Received list of locations.
Reading file.
|--------------------------------------------------|
|==================================================|
Error in `[.data.frame`(data, , 6) : undefined columns selected
methylation differential analysis r methylkit

Maybe your file format is not the adequate for the import of the files by methylKit with the method pipeline = "bismark" ? It says in the methRead documentation that it expects a tabular format as shown in the github:

chrBase chr base    strand  coverage    freqC   freqT
chr21.9764539   chr21   9764539 R   12  25.00   75.00
chr21.9764513   chr21   9764513 R   12  0.00    100.00

Are the files you're imputting in that format? If not, you may input Bismark coverage or cytosine report files using the other pipeline options available in the function

Hi. Thank you for your response.

My file look like this. Do you think it is wrong format?

(base) harshraj@harshraj-XPS-8930:~/Desktop/DMR$ head -10 CpG_context_ST12_B1_F_bismark_hisat2_pe.txt 
Bismark methylation extractor version v0.23.0
A00821:696:H77L5DSX2:1:1101:12454:1016_1:N:0:TATAGCGG+GAACTGAC  -   7   336731  z
A00821:696:H77L5DSX2:1:1101:12454:1016_1:N:0:TATAGCGG+GAACTGAC  -   7   336941  z
A00821:696:H77L5DSX2:1:1101:12454:1016_1:N:0:TATAGCGG+GAACTGAC  -   7   336883  z
A00821:696:H77L5DSX2:1:1101:13774:1016_1:N:0:TATAGCGG+GAACTGAC  +   14  2476108 Z
A00821:696:H77L5DSX2:1:1101:19759:1016_1:N:0:TATAGCGG+GAACTGAC  +   7   1367984 Z
A00821:696:H77L5DSX2:1:1101:25699:1031_1:N:0:TATAGCGG+GAACTGAC  +   6   6834064 Z
A00821:696:H77L5DSX2:1:1101:25699:1031_1:N:0:TATAGCGG+GAACTGAC  +   6   6834057 Z
A00821:696:H77L5DSX2:1:1101:25699:1031_1:N:0:TATAGCGG+GAACTGAC  -   6   6833845 z
A00821:696:H77L5DSX2:1:1101:18240:1047_1:N:0:TATAGCGG+GAACTGAC  -   9   9152550 z

Hmm no it does not look like the same format. As I said, I would suggest imputing either Bismark coverage or cytosine report files and using pipeline = "bismarkCoverage" or "bismarkCytosineReport". You can recognize the files from Bismark by doing head and checking with the Bismark manual.

Use either those ending in "bismark.cov.gz" or "CpG_report.txt.gz" with pipeline = "bismarkCoverage"orpipeline = "bismarkCytosineReport", respectively.

It worked i used "bismark.cov.gz" file with pipeline = "bismarkCoverage". Thank you so much, i was struggling with this for week

0 answers

No answers yet.

Log in to answer this question.