nsheff / LOLA

Locus Overlap Analysis: Enrichment of Genomic Ranges
http://code.databio.org/LOLA
70 stars 19 forks source link

Can't load an example regionDB. #33

Open lining-yuan opened 4 years ago

lining-yuan commented 4 years ago

No problem with the path.

regionDB = loadRegionDB(dbLocation=dbPath) Reading collection annotations: ucsc_example: found collection annotation:C:/Program Files/R/R-3.6.0/library/LOLA/extdata/hg19/ucsc_example/collection.txt Reading region annotations... C:/Program Files/R/R-3.6.0/library/LOLA/extdata/hg19//ucsc_example/regions In 'ucsc_example', found index file:C:/Program Files/R/R-3.6.0/library/LOLA/extdata/hg19/ucsc_example/index.txt

Collection: ucsc_example. Creating size file... Error in system(paste("wc -l ", filename), intern = TRUE) : 'wc' not found

In addition: Warning message: In readRegionSetAnnotation(dbLocation, collections) : You don't have simpleCache installed, so you won't be able to cache the regionDB after reading it in. Install simpleCache to speed up later database loading.

konsta-kukkonen commented 4 years ago

Hi all,

I have the same problem as OP. First I was trying to make my own custom regionsDB, but as that didn't work I tried the one provided with the package, but that didn't work either.

dbPath = system.file("extdata", "hg19", package="LOLA")
RegionsDB = loadRegionDB(dbPath)
Reading collection annotations: 
    ucsc_example: found collection annotation:C:/Documents/R/R-3.6.2/library/LOLA/extdata/hg19/ucsc_example/collection.txt
Reading region annotations...
::Creating cache::  C:/Documents/R/R-3.6.2/library/LOLA/extdata/hg19/ucsc_example//ucsc_example_files.RData
C:/Documents/R/R-3.6.2/library/LOLA/extdata/hg19//ucsc_example/regions
    In 'ucsc_example', found index file:C:/Documents/R/R-3.6.2/library/LOLA/extdata/hg19/ucsc_example/index.txt
Collection: ucsc_example. Creating size file...
Error in system(paste("wc -l ", filename), intern = TRUE) : 
  'wc' not found
In addition: Warning message:
In dir.create(cacheDir, recursive = TRUE) :
  'C:\Documents\R\R-3.6.2\library\LOLA\extdata\hg19\ucsc_example' already exists

It seems wc shouldn't even be needed if the collectionAnnoDT[,size] was assigned correctly. on line 218 of loadRegionDB.R: collectionAnnoDT[groupSizes, size:=size_int]

Here is my sessionInfo():

R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=Finnish_Finland.1252  LC_CTYPE=Finnish_Finland.1252    LC_MONETARY=Finnish_Finland.1252
[4] LC_NUMERIC=C                     LC_TIME=Finnish_Finland.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] LOLA_1.16.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.3             IRanges_2.20.2         bitops_1.0-6           GenomeInfoDb_1.22.0   
 [5] plyr_1.8.5             magrittr_1.5           stats4_3.6.2           stringi_1.4.5         
 [9] zlibbioc_1.32.0        reshape2_1.4.3         XVector_0.26.0         data.table_1.12.8     
[13] S4Vectors_0.24.3       tools_3.6.2            stringr_1.4.0          RCurl_1.98-1.1        
[17] parallel_3.6.2         compiler_3.6.2         simpleCache_0.4.1      BiocGenerics_0.32.0   
[21] GenomicRanges_1.38.0   GenomeInfoDbData_1.2.2

Any help would be appreciated!

-Konsta

nsheff commented 4 years ago

Are you by chance using windows? It doesn't have wc and so that causes problems. I fixed this in this commit but maybe I forgot to push this to bioc -- can you try with the version on github?

you can install it with devtools::install_github("nsheff/LOLA")

let me know if that solves it and if so I will push the update to bioconductor...

konsta-kukkonen commented 4 years ago

Hello, Nathan

I'm indeed using Windows. I tested to installing from devtools, and now it seems to be working.

regionDB = loadRegionDB(dbPath)
Reading collection annotations: 
    ucsc_example: found collection annotation:C:/Users/Documents/R/win-library/3.6/LOLA/extdata/hg19/ucsc_example/collection.txt
Reading region annotations...
::Creating cache::  C:/Users/Documents/R/win-library/3.6/LOLA/extdata/hg19/ucsc_example//ucsc_example_files.RData
C:/Users/Documents/R/win-library/3.6/LOLA/extdata/hg19//ucsc_example/regions
    In 'ucsc_example', found index file:C:/Users/Documents/R/win-library/3.6/LOLA/extdata/hg19/ucsc_example/index.txt
Collection: ucsc_example. Creating size file...
ucsc_example
::Creating cache::  C:/Users/Documents/R/win-library/3.6/LOLA/extdata/hg19/ucsc_example/ucsc_example.RData
Reading 5 files...
1: C:/Users/Documents/R/win-library/3.6/LOLA/extdata/hg19/ucsc_example/regions/cpgIslandExt.bed
2: C:/Users/Documents/R/win-library/3.6/LOLA/extdata/hg19/ucsc_example/regions/laminB1Lads.bed
3: C:/Users/Documents/R/win-library/3.6/LOLA/extdata/hg19/ucsc_example/regions/numtSAssembled.bed
4: C:/Users/Documents/R/win-library/3.6/LOLA/extdata/hg19/ucsc_example/regions/vistaEnhancers.bed
5: C:/Users/Documents/R/win-library/3.6/LOLA/extdata/hg19/ucsc_example/regions/vistaEnhancers_colNames.bed
Warning message:
In dir.create(cacheDir, recursive = TRUE) :
  'C:\Users\Documents\R\win-library\3.6\LOLA\extdata\hg19\ucsc_example' already exists

Like you see, I still get that one warning, but the database gets build. Thank you!

-Konsta