Unable to use biocLite in R centOS 7 - error in read.table

281 views Asked by At

I am using R on centos 7 When i try to install bioconductor packages i am getting the following error.

> source("http://bioconductor.org/biocLite.R")
Bioconductor version 3.0 (BiocInstaller 1.16.1), ?biocLite for help
> biocLite("affy")
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  no lines available in input

This error seems to be bigger than just biocLite because other functions(like rma in affy package) which use read.table are also throwing same error. I am clueless regarding how to solve this error. Any help is very much apprieciated. Thanks.

eset=rma(data,normalize=FALSE)
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  no lines available in input

@ Richie Cotton

I am not sure what you meant by option(error = recover) but i tried the following

> source("http://bioconductor.org/biocLite.R")
Bioconductor version 3.0 (BiocInstaller 1.16.1), ?biocLite for help
> biocLite("affy")
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  no lines available in input
> traceback()
9: stop("no lines available in input")
8: read.table(file = file, header = header, sep = sep, quote = quote, 
       dec = dec, fill = fill, comment.char = comment.char, ...)
7: utils::read.delim(file, header = TRUE, comment.char = "#", colClasses = c(rep.int("character", 
       3L), rep.int("logical", 4L)))
6: tools:::.read_repositories(p)
5: setRepositories(ind = 1:20)
4: .biocinstallRepos(biocVersion = biocVersion)
3: .getContribUrl(biocVersion())
2: bioconductorPackageIsCurrent()
1: biocLite("affy")
> options(error=recover)
> biocLite("affy")
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  no lines available in input

Enter a frame number, or 0 to exit   

1: biocLite("affy")
2: bioconductorPackageIsCurrent()
3: .getContribUrl(biocVersion())
4: .biocinstallRepos(biocVersion = biocVersion)
5: setRepositories(ind = 1:20)
6: tools:::.read_repositories(p)
7: utils::read.delim(file, header = TRUE, comment.char = "#", colClasses = c(re
8: read.table(file = file, header = header, sep = sep, quote = quote, dec = dec

Selection: 8
Called from: top level 
Browse[1]> 
eval(expr,envir,enclos)
eval(substitute(browser(skipCalls=skip),list(skip=7...
1

There are 1 answers

0
Martin Morgan On

The error message typically results when a file exists but is empty

> system("touch /tmp/123")
> read.table("/tmp/123")
Error in read.table("/tmp/123") : no lines available in input

The traceback says setRepositories() fails. Looking at the source

> head(setRepositories, 9)

1 function (graphics = getOption("menu.graphics"), ind = NULL, 
2     addURLs = character())                                   
3 {                                                            
4     if (is.null(ind) && !interactive())                      
5         stop("cannot set repositories non-interactively")    
6     p <- file.path(Sys.getenv("HOME"), ".R", "repositories") 
7     if (!file.exists(p))                                     
8         p <- file.path(R.home("etc"), "repositories")        
9     a <- tools:::.read_repositories(p)  

The file that exists but is empty is either a user customization

file.path(Sys.getenv("HOME"), ".R", "repositories")

(in which case the solution is to remove the file pointed to above) or a system file

file.path(R.home("etc"), "repositories")

For the later case, for me in a 'factory fresh' installation from source I get

> length(readLines(p))
[1] 20

but the poster probably gets 0. This is somehow a corrupted installation in centOS, so more information about the version and installation of R is needed. I believe there has been a post on R-devel, R-help, or in the R bug tracker about this recently, but I have not been able to find it.