problems with methRead function in methylKit

358 views
Skip to first unread message

Jenny Huo

unread,
Feb 3, 2021, 10:20:42 AM2/3/21
to methylkit_discussion
Hello,
I am having the following issue with the methRead function, and have outlined my steps to get to this position thus far. 
1. Received .tar.gz file
2. unzipped file includes 16 CX_report.txt files analyzed using Bismark
3. used the awk command line to filter the files, specified to only CpG sites

While using methRead, I am getting the following error on my .filter.txt files: 
Screen Shot 2021-02-03 at 10.13.16 AM.png
Although, I do provide sample.ids and assembly in the command line, which is: myobj.all=methRead(filelist,sample.id=as.list(sample.id),assembly= "mm10",pipeline="bismarkCytosineReport",treatment=c(1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0))

Here is what each of the filter.txt files look like: Screen Shot 2021-02-03 at 10.13.50 AM.png

Thanks very much.
Jenny

Alexander Blume

unread,
Feb 7, 2021, 3:12:40 PM2/7/21
to methylkit_discussion
Hi Jenny,

Could you please post the complete R code that leads to this error, especially how `file.list` and `sample.id` are created .
I suspect that the `file.list` is a simple vector and not a list. Please note that `file.list` has to be a list of character vectors if you want to read multiple samples into a methylRawList. 

Best,
Alex

Jenny Huo

unread,
Feb 10, 2021, 1:36:29 PM2/10/21
to methylkit_discussion
Hi Alexander, it worked! Thanks so much. 

Another question I had was further in the analysis in the Sample Correlation step. I do not want the values of each sample compared to one another, but would like a matrix in the beta value of each CpG. I am not sure what getCorrelation() is calculating because the number seems to vary between 0 and 1, but I do not want a correlation value. Does this make sense? 

Best,
Jenny

Alexander Blume

unread,
Feb 10, 2021, 3:30:13 PM2/10/21
to methylkit_...@googlegroups.com
Hi Jenny,

If I understand you correctly, you want to get the matrix of methylation percentages per sample, is this correct? 
We do not have a function that directly returns this matrix, but you may construct it yourself from the methylBase object:

```
library(methylKit)
data(methylKit)

df = getData(methylBase.obj)
meth.mat = df[,methCols]/(df[,methCols] + df[,unmethCols])
```

Best,
Alex


-- 
You received this message because you are subscribed to a topic in the Google Groups "methylkit_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/methylkit_discussion/S6Io5YvOd14/unsubscribe.
To unsubscribe from this group and all its topics, send an email to methylkit_discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/methylkit_discussion/e81b0bf5-9112-4c09-8c98-42fda4fdaff9n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages