genomation readTrancriptFeature error reading UCSC bed

250 views
Skip to first unread message

eguevara

unread,
Aug 20, 2017, 2:00:17 PM8/20/17
to methylkit_discussion
Hi all,

I would like to annotate DM CpGs. But I am getting stuck on the very first step trying to import my annotations and so am hoping someone here will be able to offer some guidance!

I followed the instructions to download a bed file of RefSeq genes for my species and assembly (panTro4) (attached here). However, when I try to import the file using this command:

gene.obj=readTranscriptFeatures(system.file("extdata","panTro4-RefSeqGenes.bed.txt", package = "methylKit"))

I get the following error:

Reading the table...
Error in read.table(file = filename, sep = sep, skip = skip, nrows = 30,  : 
  no lines available in input
In addition: Warning messages:
1: In file(filename, open = "r") :
  file("") only supports open = "w+" and open = "w+b": using the former
2: In file(file, "rt") :
  file("") only supports open = "w+" and open = "w+b": using the former

I've googled around on the contents of the error and it seems like it could be to do with how the file is called or permissions, but haven't been able to find a solution. I see there have been plenty of errors reported here resulting from converted files, but this was downloaded straight from UCSC. I've tried simplifying the number of fields from what is output by default by the Table Browser, but that doesn't help.

If anyone has any suggestions, they would be greatly appreciated! Or, if I am making a rookie mistake or missing something obvious, my apologies in advance! Or it may be more appropriate to direct this to the genomation community specifically, but figured I would give it a shot here.
Cheers,
Elaine
panTro4-RefSeqGenes.bed.txt

Altuna Akalin

unread,
Aug 21, 2017, 4:34:55 AM8/21/17
to methylkit_...@googlegroups.com


gene.obj=readTranscriptFeatures(system.file("extdata","panTro4-RefSeqGenes.bed.txt", package = "methylKit"))


why are you using system.file(), did you put the file in the installed directory of the package ?

 
I get the following error:

Reading the table...
Error in read.table(file = filename, sep = sep, skip = skip, nrows = 30,  : 
  no lines available in input
In addition: Warning messages:
1: In file(filename, open = "r") :
  file("") only supports open = "w+" and open = "w+b": using the former
2: In file(file, "rt") :
  file("") only supports open = "w+" and open = "w+b": using the former

I've googled around on the contents of the error and it seems like it could be to do with how the file is called or permissions, but haven't been able to find a solution. I see there have been plenty of errors reported here resulting from converted files, but this was downloaded straight from UCSC. I've tried simplifying the number of fields from what is output by default by the Table Browser, but that doesn't help.

If anyone has any suggestions, they would be greatly appreciated! Or, if I am making a rookie mistake or missing something obvious, my apologies in advance! Or it may be more appropriate to direct this to the genomation community specifically, but figured I would give it a shot here.
Cheers,
Elaine

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit_discussion@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.

eguevara

unread,
Aug 21, 2017, 7:50:28 AM8/21/17
to methylkit_discussion
Hi Altuna,

Thanks for the reply!

I used system.file () because I was following (clearly too literally!! and without enough thought) this vignette using the example data.

I did try using file() and read.table() in lieu of system.file(), as it did seem to me like that could be the problem, but those also gave errors. But I did not think try using simply (embarrassingly obvious now!):

gene.obj=readTranscriptFeatures("panTro4-RefSeqGenes.bed.txt")

which works beautifully, just as it should. Thanks again for your help pointing out where I was going wrong.

Cheers,
Elaine
Reply all
Reply to author
Forward
0 new messages