Search
0
6 days ago by
bekah0
bekah0 wrote:

Afternoon!
I am having trouble with methylkit read in - I have the methylcall output context files from bismark which I am trying to read into MethylKit. However I am getting the same error after trying to read in as a raw methyl object

Input is either empty or fully whitespace after the skip or autostart. Run again with verbose=TRUE.

library(methylKit)
file.list=list( system.file("extdata",
"CpG_90.txt", package = "methylKit"),
system.file("extdata",
"CpG_91.txt", package = "methylKit"),
system.file("extdata",
"CpG_95.txt", package = "methylKit"),
system.file("extdata",
"CpG_96.txt", package = "methylKit") )

# read the files to a methylRawList object: myobj
sample.id=list("IN190","IN191","CON95","CON96"),
assembly="onilo11",
treatment=c(1,1,0,0),
context="CpG"
)

I tried adding in the verbose, but it just said it was an unused argument.
Has anyone else had this issue?

Best wishes,

Rebekah

modified 6 days ago by Mike Smith2.7k • written 6 days ago by bekah0

solved - no need for the extra script
file.list=list("CpG_90.txt", "CpG_96.txt")

# read the files to a methylRawList object: myobj
sample.id=list("IN190","CON96"),
assembly="onilo11",
treatment=c(1,0),
context="CpG"
)

0
6 days ago by
Mike Smith2.7k
EMBL Heidelberg / de.NBI
Mike Smith2.7k wrote:

It's not a helpful error message, but the list of files you're providing is empty and so the reading fails.  Here's the contents of file.list:

> file.list
[[1]]
[1] ""

[[2]]
[1] ""

[[3]]
[1] ""

[[4]]
[1] ""


This is because the system.file() function isn't what you need when you're working with your own data. It's a special function that helps R find files that were installed with a package, so examples like in the vignette can be run on any computer, regardless of where the user has installed R.

What you need when swapping in your own data is something more like:

file.list = list( "c:/path/to/my/data/CpG_90.txt",
"c:/path/to/my/data/CpG_91.txt",
"c:/path/to/my/data/CpG_95.txt",
"c:/path/to/my/data/CpG_96.txt" )


Of course you still need to adapt this to supply the path that is appropriate for you.  An alternative is to set the working directory to the folder where your data are, and then you can use only the file names e.g.

setwd("c:/path/to/my/data/")
file.list = list( "CpG_90.txt",
"CpG_91.txt",
"CpG_95.txt",
"CpG_96.txt" )


However the second script is still not working - is this likely to be an issue with the output format from bismark?
Error in [.data.frame(data, , 6) : undefined columns selected
Starting data input on line 2 and discarding line 1 because it has too few or too many items to be column names or data: Bismark methylation extractor version v0.19.0

EDIT: added in pipeline option to see if this will solve it