Search
Question: MethylKit read in issue
0
gravatar for bekah
8 weeks 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 

Error in fread(filepath, ...) : 
  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
myobj=methRead(file.list, 
               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

ADD COMMENTlink modified 8 weeks ago by Mike Smith2.8k • written 8 weeks 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
myobj=methRead(file.list, 
               sample.id=list("IN190","CON96"),
               assembly="onilo11",
               treatment=c(1,0),
               context="CpG"
)
Just read in as above instead

ADD REPLYlink written 8 weeks ago by bekah0
0
gravatar for Mike Smith
8 weeks ago by
Mike Smith2.8k
EMBL Heidelberg / de.NBI
Mike Smith2.8k 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" )
ADD COMMENTlink written 8 weeks ago by Mike Smith2.8k

please see above - already solved, but cheers :)

ADD REPLYlink written 8 weeks ago by bekah0

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
In addition: Warning message:
In fread(filepath, ...) :
  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

ADD REPLYlink modified 8 weeks ago • written 8 weeks ago by bekah0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 226 users visited in the last hour