MethylKit read in issue
1
0
Entering edit mode
bekah ▴ 40
@bekah-12633
Last seen 5.8 years ago

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

methykit rrbs • 2.6k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode
Mike Smith ★ 6.6k
@mike-smith
Last seen 8 minutes ago
EMBL Heidelberg

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

please see above - already solved, but cheers :)

ADD REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

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