Closed Solyris83 closed 3 years ago
Hello @Solyris83 !
I should update dynmethods to use the newest version of each TI method soon. For now, you can manually pick the version of slingshot you would like using:
library(tidyverse)
library(dyno)
dataset <- example_dataset
# obtain priors
dimred <- prcomp(dataset$expression)$x[,1:2]
grouping <- kmeans(dimred, centers = 4)$cluster
start_id <- rownames(dimred)[[which.min(dimred[,1])]]
# add priors to dataset
dataset_with_prior <- dataset %>% add_prior_information(
dimred = dimred,
start_id = start_id,
groups_id = grouping
)
# fetch newest version of slingshot
method <- create_ti_method_container("dynverse/ti_slingshot:v2.0.1")
# run slingshot
model_slingshot <- infer_trajectory(
dataset = dataset_with_prior,
method = method(),
give_priors = c("start_id", "groups_id", "dimred"),
verbose = TRUE
)
dynplot::plot_dimred(model_slingshot, dimred = dimred)
Has this solved your problem?
Kind regards, Robrecht
HI Robrecht,
Yes, that did the trick! It made the warning message go away assumedly using the dimred now.
But the trajectory produced is not better, as in my criteria is that the trajectory should start from a cluster from a priori analysis, but now it starts further away from that. This probably should be a new question.
Just to be sure, the default space to infer trajectory from are the PCAs calculated from expression data, am I right? Reading the Slingshot Github issues messages I think this is the prefered space to work on for Slingshot at least. Probably I will stick to the previous one while I continue to stalk around in the Slingshot Github issue panel.
Thanks! Solyris
Just to be sure, the default space to infer trajectory from are the PCAs calculated from expression data, am I right?
PCA is the default dimred for Slingshot in dyno, but in the paper Slingshot is presented in a DR-agnostic way -- that is, it is up to the user to choose a good DR method prior to running Slingshot, according to the author.
In my opinion, choosing your own DR prior to running Slingshot will strongly bias your results. However, there is not really a golden bullet of DR for performing TI either, so some finetuning definitely is needed. It would be nice if this could be done in a data-driven way, but alas, this doesn't exist yet. For now, the tweaking is left up to the user :).
Hi, I am running ti_slingshot as below
model_slingshot <- infer_trajectory(dataset, methods_selected[1], give_priors = c("start_id", "groups_id", "dimred") ,verbose=TRUE)
but the run throw this message
I am using the docker image found below.
I read the code below and it supports "dimred" as a prior just not sure if this is in the docker image. If not, is there any simple way to use the ti_slingshot.R below? https://github.com/dynverse/ti_slingshot/blob/master/package/R/ti_slingshot.R