dynverse / dyno

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

debugging "Error: Error during trajectory inference" #48

Open celinesin opened 5 years ago

celinesin commented 5 years ago

I'm having trouble running dynwrap::infer_trajectory() on my data. My installation seems to be okay, the methods work fine on the toy data.

However, on my data (and verbose=TRUE), I get a lot of package loading messages and:

1. dynwrap::infer_trajectory(dataset, method = ti_monocle_ddrtree(reduction_method = "DDRTree", 
 .     max_components = 5, norm_method = "log", filter_features_mean_expression = 0.1), 
 .     verbose = TRUE)
2. stop("Error during trajectory inference \n", crayon::bold(error), 
 .     call. = FALSE)

As my data was running as expected through Monocle in the past, I followed https://github.com/dynverse/ti_monocle_ddrtree/blob/master/run.R line by line, and everything runs up to line 79.

Do you have any tips on how I can debug this? (I tried several other ti_ methods as well, with similar results)

Thanks for this really cool package!

rcannood commented 5 years ago

Hello Celine!

I'm truly sorry for the late response. We have been swamped with work, and I must have missed your issue.

Could you update dynwrap and dynmethods? In all likelihood, your problem has been resolved.

To answer your question, if you want to debug a method in detail, you can use the debug = TRUE argument in infer_trajectory(). It's tedious but totally possible!

For example:

library(dyno)
dataset <- dyntoy::generate_dataset()
infer_trajectory(dataset, ti_monocle_ddrtree(), debug = TRUE)

This outputs:

Executing 'monocle_ddrtree' on '20190613_113944__toy__bp1chLJigw'
With parameters: list(reduction_method = "DDRTree", max_components = 2L, norm_method = "log",     auto_param_selection = TRUE, filter_features = TRUE, filter_features_mean_expression = 0.1),
inputs: counts, and
priors : 
Input saved to /tmp/Rtmp0zbXAT/file23c82480256b/ti
Running method using babelwhale
Use this command to enter the container: 
/usr/bin/docker run --entrypoint bash -it -e TMPDIR=/tmp2 --workdir /ti/workspace -v /tmp/Rtmp0zbXAT/file23c82480256b/ti:/ti -v /tmp/Rtmp0zbXAT/file23c8317b2cad/tmp:/tmp2 dynverse/ti_monocle_ddrtree:v0.9.9.02

You can then enter the container by using the command printed above. From there, open an R session (if the TI method uses R, otherwise open python).

/usr/bin/docker run --entrypoint bash -it -e TMPDIR=/tmp2 --workdir /ti/workspace -v /tmp/Rtmp0zbXAT/file23c82480256b/ti:/ti -v /tmp/Rtmp0zbXAT/file23c8317b2cad/tmp:/tmp2 dynverse/ti_monocle_ddrtree:v0.9.9.02
R

From there, you can start entering the commands from the run.R script. The only difference is that you need to replace task <- dyncli::main() with task <- dyncli::main(c("--dataset", "/ti/input.h5", "--output", "/ti/output.h5")) so that it can find the dataset that was stored in the first step.

Let me know if this works for you :) Robrecht