dynverse / dynwrap

A common data format and inference environment for single-cell trajectories 📦
https://dynverse.org
Other
15 stars 7 forks source link

Error of dataset path parameter under Ubuntu18.04 when inferring trajectories #164

Open duohongrui opened 2 years ago

duohongrui commented 2 years ago

Hi, Dynverse is a powerful tool to infer and evaluate trajectories for single-cell RNA sequencing data. Several days ago, I met a tough problem under Ubuntu18.04 when inferring trajectories. The version of ti_slingshot is 1.0.3. The codes are below:

# Generate a reference data
set.seed(1)
a <- matrix(rpois(n = 2500, lambda = 2), nrow = 50)
rownames(a) <- paste0("cell_", 1:ncol(a))
colnames(a) <- paste0("gene_", 1:nrow(a))
dataset_ref <- dynwrap::wrap_expression(
  counts = a,
  expression = log2(a+1)
)
# Trajectory inference
model_ref <- dynwrap::infer_trajectory(dataset_ref, 'slingshot', verbose = T)

The error said:

Error: Error: --dataset should contain a pathname of a .loom or .h5 file. Add a '-h' flag for help.
Execution halted

However, the dataset path parameter is actually in the recording infomation.

Executing 'slingshot' on '20220404_163254__data_wrapper__pGINzXb8wh'
With parameters: list(cluster_method = "pam", ndim = 20L, shrink = 1L, reweight = TRUE,     reassign = TRUE, thresh = 0.001, maxit = 10L, stretch = 2L,     smoother = "smooth.spline", shrink.method = "cosine")
inputs: expression
priors : 
Input saved to /tmp/RtmpuWLzCH/file31c92a48d72a/ti
Running method using babelwhale
Running /usr/bin/docker run --name 20220404_202410__container__FqdSy8fabq -e 'TMPDIR=/tmp2' --workdir /ti/workspace \
  -v '/tmp/RtmpuWLzCH/file31c92a48d72a/ti:/ti' -v '/tmp/RtmpuWLzCH/file31c974a77030/tmp:/tmp2' \
  'dynverse/ti_slingshot:v1.0.3' --dataset /ti/input.h5 --output /ti/output.h5

Then, I tried these codes on Windows10 and everything is OK:

Executing 'slingshot' on '20220404_201956__data_wrapper__pGINzXb8wh'
With parameters: list(cluster_method = "pam", ndim = 20L, shrink = 1L, reweight = TRUE,     reassign = TRUE, thresh = 0.001, maxit = 10L, stretch = 2L,     smoother = "smooth.spline", shrink.method = "cosine")
inputs: expression
priors : 
Input saved to C:\Users\duoho\AppData\Local\Temp\RtmpE9y0LN\fileb1453c66742/ti
Running method using babelwhale
Running "C:\PROGRA~1\Docker\Docker\RESOUR~1\bin\docker.exe" run --name \
  20220404_202301__container__Rw9GHleUH5 -e "TMPDIR=/tmp2" --workdir /ti/workspace -v \
  "/c/Users/duoho/AppData/Local/Temp/RtmpE9y0LN/fileb1453c66742/ti:/ti" -v \
  "/c/Users/duoho/AppData/Local/Temp/RtmpE9y0LN/fileb147ed6081/tmp:/tmp2" "dynverse/ti_slingshot:v1.0.3" \
  --dataset /ti/input.h5 --output /ti/output.h5
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
Using diagonal covariance matrix
There were 50 or more warnings (use warnings() to see the first 50)
Output saved to C:\Users\duoho\AppData\Local\Temp\RtmpE9y0LN\fileb1453c66742/ti/output.h5
Attempting to read in output with hdf5

The R environment under Ubuntu is below:

R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTS

Matrix products: default
BLAS:   /usr/local/lib/R/lib/libRblas.so
LAPACK: /usr/local/lib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] amap_0.8-18        

loaded via a namespace (and not attached):
  [1] babelwhale_1.0.3            plyr_1.8.7                  igraph_1.3.0                lazyeval_0.2.2             
  [5] proxyC_0.2.4                splines_4.0.0               dynwrap_1.2.2               listenv_0.8.0              
  [9] scattermore_0.8             usethis_2.1.5               GenomeInfoDb_1.26.7         ggplot2_3.3.5              
 [13] digest_0.6.29               htmltools_0.5.2             fansi_1.0.3                 memoise_2.0.1              
 [17] magrittr_2.0.3              dynfeature_1.0.0            carrier_0.1.0               tensor_1.5                 
 [21] cluster_2.1.3               ROCR_1.0-11                 tzdb_0.3.0                  remotes_2.4.2              
 [25] globals_0.14.0              readr_2.1.2                 RcppParallel_5.1.5          matrixStats_0.61.0         
 [29] dynutils_1.0.9              spatstat.sparse_2.1-0       prettyunits_1.1.1           colorspace_2.0-3           
 [33] ggrepel_0.9.1               dplyr_1.0.8                 callr_3.7.0                 crayon_1.5.1               
 [37] RCurl_1.98-1.6              jsonlite_1.8.0              spatstat.data_2.1-4         survival_3.3-1             
 [41] zoo_1.8-9                   ape_5.6-2                   glue_1.6.2                  polyclip_1.10-0            
 [45] gtable_0.3.0                zlibbioc_1.36.0             XVector_0.30.0              leiden_0.3.9               
 [49] DelayedArray_0.16.3         pkgbuild_1.3.1              future.apply_1.8.1          SingleCellExperiment_1.12.0
 [53] BiocGenerics_0.36.1         dynparam_1.0.0              abind_1.4-5                 scales_1.1.1               
 [57] spatstat.random_2.2-0       miniUI_0.1.1.1              Rcpp_1.0.8.3                viridisLite_0.4.0          
 [61] xtable_1.8-4                ctc_1.64.0                  reticulate_1.24             spatstat.core_2.4-2        
 [65] stats4_4.0.0                htmlwidgets_1.5.4           httr_1.4.2                  RColorBrewer_1.1-2         
 [69] ellipsis_0.3.2              Seurat_4.1.0                ica_1.0-2                   pkgconfig_2.0.3            
 [73] uwot_0.1.11                 deldir_1.0-6                utf8_1.2.2                  tidyselect_1.1.2           
 [77] rlang_1.0.2                 reshape2_1.4.4              later_1.3.0                 cachem_1.0.6               
 [81] munsell_0.5.0               tools_4.0.0                 cli_3.2.0                   generics_0.1.2             
 [85] ranger_0.13.1               devtools_2.4.3              ggridges_0.5.3              stringr_1.4.0              
 [89] fastmap_1.1.0               yaml_2.3.5                  goftest_1.2-3               fs_1.5.2                   
 [93] processx_3.5.3              fitdistrplus_1.1-8          dyneval_0.9.9               purrr_0.3.4                
 [97] RANN_2.6.1                  pbapply_1.5-0               future_1.24.0               nlme_3.1-157               
[101] mime_0.12                   rstudioapi_0.13             brio_1.1.3                  compiler_4.0.0             
[105] curl_4.3.2                  plotly_4.10.0               png_0.1-7                   testthat_3.1.3             
[109] spatstat.utils_2.3-0        tibble_3.1.6                stringi_1.7.6               ps_1.6.0                   
[113] desc_1.4.1                  lattice_0.20-45             Matrix_1.4-1                dynmethods_1.0.5           
[117] vctrs_0.4.0                 pillar_1.7.0                lifecycle_1.0.1             spatstat.geom_2.4-0        
[121] lmtest_0.9-40               RcppAnnoy_0.0.19            data.table_1.14.2           cowplot_1.1.1              
[125] bitops_1.0-7                irlba_2.3.5                 httpuv_1.6.5                patchwork_1.1.1            
[129] GenomicRanges_1.42.0        R6_2.5.1                    promises_1.2.0.1            KernSmooth_2.23-20         
[133] gridExtra_2.3               IRanges_2.24.1              parallelly_1.30.0           sessioninfo_1.2.2          
[137] codetools_0.2-18            MASS_7.3-56                 assertthat_0.2.1            pkgload_1.2.4              
[141] SummarizedExperiment_1.20.0 rprojroot_2.0.2             withr_2.5.0                 SeuratObject_4.0.4         
[145] sctransform_0.3.3           harmony_0.1.0               S4Vectors_0.28.1            GenomeInfoDbData_1.2.4     
[149] mgcv_1.8-40                 parallel_4.0.0              hms_1.1.1                   grid_4.0.0                 
[153] rpart_4.1.16                tidyr_1.2.0                 MatrixGenerics_1.2.1        Rtsne_0.15                 
[157] Biobase_2.50.0              shiny_1.7.1   

I guess that this error is generated by fix_windows_path() function in the original codes because the change of path may not be valid under Linux OS.

## https://github.com/dynverse/dynwrap/blob/master/R/method_create_ti_method_container.R

output <- babelwhale::run(
    container_id = method$run$container_id,
    command = NULL,
    args = args,
    volumes = paste0(preproc_meta$dir_dynwrap %>% fix_windows_path(), ":/ti"),
    workspace = "/ti/workspace",
    verbose = preproc_meta$verbose,
    debug = preproc_meta$debug
  )

Could you please find out the reason and solve this problem? Thanks very much!