Methylkit (differential methylation analysis) error in data frame
0
0
Entering edit mode
3.3 years ago
harshraje19 ▴ 40

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 • 2.4k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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
ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

]Can i use these files, enter image description here

ADD REPLY
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

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