dynverse / dyno

Inferring, interpreting and visualising trajectories using a streamlined set of packages 🦕
https://dynverse.github.io/dyno
Other
163 stars 32 forks source link

Error using infer_trajectory #69

Closed royfrancis closed 4 years ago

royfrancis commented 4 years ago

This part goes well.

dynwrap::test_docker_installation(detailed = TRUE)
✔ Docker is installed
✔ Docker daemon is running
✔ Docker is at correct version (>1.0): 1.39
✔ Docker is in linux mode
✔ Docker can pull images
✔ Docker can run image
✔ Docker can mount temporary volumes
✔ Docker test successful -----------------------------------------------------------------

dataset <- wrap_expression(expression = example_dataset$expression,
                            counts = example_dataset$counts)
dataset <- add_prior_information(dataset,start_id = "Cell1")

answers <- dynguidelines::answer_questions(
  multiple_disconnected = TRUE, 
  expect_topology = NULL, 
  expected_topology = NULL, 
  n_cells = 1000, 
  n_features = 3, 
  memory = "30GB", 
  prior_information = "start_id", 
  docker = TRUE
)
guidelines <- dynguidelines::guidelines(answers = answers) 

This runs into error.

model <- infer_trajectory(dataset,"paga")

/usr/local/lib/python3.7/site-packages/scanpy/preprocessing/_deprecated/highly_variable_genes.py:168: RuntimeWarning: invalid value encountered in true_divide
  / disp_mad_bin[df['mean_bin'].values].values
Traceback (most recent call last):
  File "/code/run.py", line 60, in <module>
    sc.pp.recipe_zheng17(adata, n_top_genes=n_top_genes)
  File "/usr/local/lib/python3.7/site-packages/scanpy/preprocessing/_recipes.py", line 108, in recipe_zheng17
    adata.X, flavor='cell_ranger', n_top_genes=n_top_genes, log=False)
  File "/usr/local/lib/python3.7/site-packages/scanpy/preprocessing/_deprecated/highly_variable_genes.py", line 175, in filter_genes_dispersion
    disp_cut_off = dispersion_norm[n_top_genes-1]
IndexError: index 2 is out of bounds for axis 0 with size 0

I think infer_trajectory() may not be using docker. Is there an argument to specify that it should use docker and not a local python source. Also, Where is the workflow all the options in answers/guidelines actually used?

R version 3.6.0

Session Info

``` >> devtools::session_info() ─ Session info ────────────── setting value version R version 3.6.0 (2019-04-26) os Ubuntu 18.04.3 LTS system x86_64, linux-gnu ui RStudio language en_GB:en collate en_GB.UTF-8 ctype en_GB.UTF-8 tz Europe/Stockholm date 2019-09-18 ─ Packages ──────────────── package * version date lib source acepack 1.4.1 2016-10-29 [1] CRAN (R 3.6.0) akima 0.6-2 2016-12-20 [1] CRAN (R 3.6.0) assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0) babelwhale 1.0.1 2019-09-17 [1] Github (dynverse/babelwhale@a043848) backports 1.1.4 2019-04-10 [1] CRAN (R 3.6.0) base64enc 0.1-3 2015-07-28 [1] CRAN (R 3.6.0) bit 1.1-14 2018-05-29 [1] CRAN (R 3.6.0) bit64 0.9-7 2017-05-08 [1] CRAN (R 3.6.0) broom 0.5.2 2019-04-07 [1] CRAN (R 3.6.0) callr 3.3.1 2019-07-18 [1] CRAN (R 3.6.0) carrier 0.1.0 2018-10-16 [1] CRAN (R 3.6.0) cellranger 1.1.0 2016-07-27 [1] CRAN (R 3.6.0) checkmate 1.9.4 2019-07-04 [1] CRAN (R 3.6.0) cli 1.1.0 2019-03-19 [1] CRAN (R 3.6.0) cluster 2.0.8 2019-04-05 [2] CRAN (R 3.6.0) codetools 0.2-16 2018-12-24 [2] CRAN (R 3.6.0) colorspace 1.4-1 2019-03-18 [1] CRAN (R 3.6.0) cowplot 1.0.0 2019-07-11 [1] CRAN (R 3.6.0) crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0) data.table 1.12.2 2019-04-07 [1] CRAN (R 3.6.0) desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.0) devtools 2.1.0 2019-07-06 [1] CRAN (R 3.6.0) digest 0.6.20 2019-07-04 [1] CRAN (R 3.6.0) dplyr * 0.8.3 2019-07-04 [1] CRAN (R 3.6.0) dyndimred 1.0.2.9000 2019-09-17 [1] Github (dynverse/dyndimred@5680317) dynfeature * 1.0.0.9000 2019-09-17 [1] Github (dynverse/dynfeature@93d8964) dynguidelines * 1.0.0 2019-09-17 [1] Github (dynverse/dynguidelines@5181f75) dynmethods * 1.0.5 2019-09-17 [1] Github (dynverse/dynmethods@53c6d1d) dyno * 0.1.1 2019-09-17 [1] Github (dynverse/dyno@d605ec9) dynparam 1.0.0 2019-09-17 [1] Github (dynverse/dynparam@0979184) dynplot * 1.0.2.9000 2019-09-17 [1] Github (dynverse/dynplot@7c239aa) dynutils 1.0.4.9000 2019-09-17 [1] Github (dynverse/dynutils@c160231) dynwrap * 1.1.4 2019-09-17 [1] Github (dynverse/dynwrap@019c3e6) fansi 0.4.0 2018-10-05 [1] CRAN (R 3.6.0) farver 1.1.0 2018-11-20 [1] CRAN (R 3.6.0) forcats * 0.4.0 2019-02-17 [1] CRAN (R 3.6.0) foreach 1.4.7 2019-07-27 [1] CRAN (R 3.6.0) foreign 0.8-71 2018-07-20 [2] CRAN (R 3.6.0) Formula 1.2-3 2018-05-03 [1] CRAN (R 3.6.0) fs 1.3.1 2019-05-06 [1] CRAN (R 3.6.0) GA 3.2 2019-01-10 [1] CRAN (R 3.6.0) generics 0.0.2 2018-11-29 [1] CRAN (R 3.6.0) ggforce 0.3.1 2019-08-20 [1] CRAN (R 3.6.0) ggplot2 * 3.2.1 2019-08-10 [1] CRAN (R 3.6.0) ggraph 2.0.0 2019-09-02 [1] CRAN (R 3.6.0) ggrepel 0.8.1 2019-05-07 [1] CRAN (R 3.6.0) glue 1.3.1 2019-03-12 [1] CRAN (R 3.6.0) graphlayouts 0.5.0 2019-08-20 [1] CRAN (R 3.6.0) gridExtra 2.3 2017-09-09 [1] CRAN (R 3.6.0) gtable 0.3.0 2019-03-25 [1] CRAN (R 3.6.0) haven 2.1.1 2019-07-04 [1] CRAN (R 3.6.0) hdf5r 1.2.0 2019-04-20 [1] CRAN (R 3.6.0) Hmisc 4.2-0 2019-01-26 [1] CRAN (R 3.6.0) hms 0.5.1 2019-08-23 [1] CRAN (R 3.6.0) htmlTable 1.13.1 2019-01-07 [1] CRAN (R 3.6.0) htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.6.0) htmlwidgets 1.3 2018-09-30 [1] CRAN (R 3.6.0) httpuv 1.5.2 2019-09-11 [1] CRAN (R 3.6.0) httr 1.4.1 2019-08-05 [1] CRAN (R 3.6.0) igraph 1.2.4.1 2019-04-22 [1] CRAN (R 3.6.0) irlba 2.3.3 2019-02-05 [1] CRAN (R 3.6.0) iterators 1.0.12 2019-07-26 [1] CRAN (R 3.6.0) jsonlite 1.6 2018-12-07 [1] CRAN (R 3.6.0) knitr 1.24 2019-08-08 [1] CRAN (R 3.6.0) later 0.8.0 2019-02-11 [1] CRAN (R 3.6.0) lattice 0.20-38 2018-11-04 [2] CRAN (R 3.6.0) latticeExtra 0.6-28 2016-02-09 [1] CRAN (R 3.6.0) lazyeval 0.2.2 2019-03-15 [1] CRAN (R 3.6.0) lifecycle 0.1.0 2019-08-01 [1] CRAN (R 3.6.0) lmds 0.1.0 2019-09-17 [1] Github (dynverse/lmds@4c9229a) lubridate 1.7.4 2018-04-11 [1] CRAN (R 3.6.0) magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0) MASS 7.3-51.4 2019-03-31 [2] CRAN (R 3.6.0) Matrix 1.2-17 2019-03-22 [2] CRAN (R 3.6.0) memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.0) mime 0.7 2019-06-11 [1] CRAN (R 3.6.0) modelr 0.1.5 2019-08-08 [1] CRAN (R 3.6.0) munsell 0.5.0 2018-06-12 [1] CRAN (R 3.6.0) nlme 3.1-139 2019-04-09 [2] CRAN (R 3.6.0) nnet 7.3-12 2016-02-02 [2] CRAN (R 3.6.0) patchwork 0.0.1 2019-09-17 [1] Github (thomasp85/patchwork@36b4918) pillar 1.4.2 2019-06-29 [1] CRAN (R 3.6.0) pkgbuild 1.0.5 2019-08-26 [1] CRAN (R 3.6.0) pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.6.0) pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.6.0) plyr 1.8.4 2016-06-08 [1] CRAN (R 3.6.0) polyclip 1.10-0 2019-03-14 [1] CRAN (R 3.6.0) prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.6.0) processx 3.4.1 2019-07-18 [1] CRAN (R 3.6.0) promises 1.0.1 2018-04-13 [1] CRAN (R 3.6.0) proxyC 0.1.5 2019-07-21 [1] CRAN (R 3.6.0) ps 1.3.0 2018-12-21 [1] CRAN (R 3.6.0) purrr * 0.3.2 2019-03-15 [1] CRAN (R 3.6.0) R6 2.4.0 2019-02-14 [1] CRAN (R 3.6.0) ranger 0.11.2 2019-03-07 [1] CRAN (R 3.6.0) RColorBrewer 1.1-2 2014-12-07 [1] CRAN (R 3.6.0) Rcpp 1.0.2 2019-07-25 [1] CRAN (R 3.6.0) RcppParallel 4.4.3 2019-05-22 [1] CRAN (R 3.6.0) readr * 1.3.1 2018-12-21 [1] CRAN (R 3.6.0) readxl 1.3.1 2019-03-13 [1] CRAN (R 3.6.0) remotes 2.1.0 2019-06-24 [1] CRAN (R 3.6.0) reshape2 1.4.3 2017-12-11 [1] CRAN (R 3.6.0) rje 1.10.10 2019-08-28 [1] CRAN (R 3.6.0) rlang 0.4.0 2019-06-25 [1] CRAN (R 3.6.0) rpart 4.1-15 2019-04-12 [2] CRAN (R 3.6.0) rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.0) rstudioapi 0.10 2019-03-19 [1] CRAN (R 3.6.0) rvest 0.3.4 2019-05-15 [1] CRAN (R 3.6.0) scales 1.0.0 2018-08-09 [1] CRAN (R 3.6.0) sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0) shiny * 1.3.2 2019-04-22 [1] CRAN (R 3.6.0) shinyjs 1.0 2018-01-08 [1] CRAN (R 3.6.0) shinyWidgets 0.4.9 2019-09-10 [1] CRAN (R 3.6.0) sp 1.3-1 2018-06-05 [1] CRAN (R 3.6.0) stringi 1.4.3 2019-03-12 [1] CRAN (R 3.6.0) stringr * 1.4.0 2019-02-10 [1] CRAN (R 3.6.0) survival 2.44-1.1 2019-04-01 [2] CRAN (R 3.6.0) testthat 2.2.1 2019-07-25 [1] CRAN (R 3.6.0) tibble * 2.1.3 2019-06-06 [1] CRAN (R 3.6.0) tidygraph 1.1.2 2019-02-18 [1] CRAN (R 3.6.0) tidyr * 1.0.0 2019-09-11 [1] CRAN (R 3.6.0) tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.6.0) tidyverse * 1.2.1 2017-11-14 [1] CRAN (R 3.6.0) tweenr 1.0.1 2018-12-14 [1] CRAN (R 3.6.0) usethis 1.5.1 2019-07-04 [1] CRAN (R 3.6.0) utf8 1.1.4 2018-05-24 [1] CRAN (R 3.6.0) vctrs 0.2.0 2019-07-05 [1] CRAN (R 3.6.0) viridis 0.5.1 2018-03-29 [1] CRAN (R 3.6.0) viridisLite 0.3.0 2018-02-01 [1] CRAN (R 3.6.0) withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.0) xfun 0.9 2019-08-21 [1] CRAN (R 3.6.0) xml2 1.2.2 2019-08-09 [1] CRAN (R 3.6.0) xtable 1.8-4 2019-04-21 [1] CRAN (R 3.6.0) yaml 2.2.0 2018-07-25 [1] CRAN (R 3.6.0) zeallot 0.1.0 2018-01-28 [1] CRAN (R 3.6.0) ```

royfrancis commented 4 years ago

I tried on a different dataset now. And this works!

data("fibroblast_reprogramming_treutlein")

dataset <- wrap_expression(
  counts = fibroblast_reprogramming_treutlein$counts,
  expression = fibroblast_reprogramming_treutlein$expression
)
dataset <- add_prior_information(dataset,start_id = "711_508_1gg_22d1_C36")

answers <- dynguidelines::answer_questions(
  multiple_disconnected = TRUE, 
  expect_topology = NULL, 
  expected_topology = NULL, 
  n_cells = 392, 
  n_features = 2000, 
  memory = "30GB", 
  prior_information = "start_id", 
  docker = TRUE
)
guidelines <- dynguidelines::guidelines(answers = answers) 

model <- infer_trajectory(dataset,"paga")
plot_dimred(model)
zouter commented 4 years ago

Hiya! I think that PAGA was filtering out all your genes in the first dataset (for some reason), and that's why you got the error. I'm happy that it works on the second dataset. Does this solve your issue? :slightly_smiling_face: