lgeistlinger / EnrichmentBrowser

Seamless navigation through combined results of set-based and network-based enrichment analysis
20 stars 11 forks source link

SPIA file connection error #3

Closed Ju-Rien closed 6 years ago

Ju-Rien commented 6 years ago

Hi, it's me again!

While running SPIA with two different data sets (personal dataset and generated dataset with makeExampleData()), I get the same error message:

Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
In addition: Warning message:
In readChar(con, 5L, useBytes = TRUE) :
  cannot open compressed file 'C:/Users/jxxxxxxxx/Documents/R/win-library/3.5/SPIA/extdataSPIA.RData', probable reason 'No such file or directory'

Notice between "/extdata" and "SPIA.RData", there are no "/" where there should be one. I pinpointed the probable faulty line, which is the line 347 from nbea.R. I ran the line and got:

>  system.file("extdata/", package="SPIA")
[1] "C:/Users/jxxxxxxxx/Documents/R/win-library/3.5/SPIA/extdata"

I notice that there is no "/" at the end of extdata. This is the value given to SPIA data.dir argument, which I believe results in faulty outcome.

I suggest, when calling spia, to do something around the like of: res <- SPIA::spia(de=de, all=all, organism=organism, data.dir=paste0(data.dir, "/"), nB=perm) instead of res <- SPIA::spia(de=de, all=all, organism=organism, data.dir=data.dir, nB=perm).

Thank you!

lgeistlinger commented 6 years ago

Interesting, this seems to be a windows-specific behavior of system.file that trims the file path separator at the end.

On a Mac:

>  system.file("extdata/", package="SPIA")
[1] "/Library/Frameworks/R.framework/Versions/3.5/Resources/library/SPIA/extdata/"

I have fixed this - watch out for EnrichmentBrowser v2.10.3 (http://bioconductor.org/packages/EnrichmentBrowser). Thank you for reporting this.