-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using PseudotimeDE for more than one lineage #16
Comments
Hi Daniela, You can also set Let me know if it works! Best, |
Hi Dongyuan, thank you for your response. There are no NAs in my ori.tbl or sub.tbl; running summary(is.na(traj_ori_tbl1)) returns only FALSE, the same with my sub.tbl. Additionally, when using sub.tbl = NULL I do not get any results, it is all NAs (like before). Do you know if it is a bug related to a pseudotime inference with >1 lineage? Best, |
Hi Daniela, Best, |
For later users: |
Dear developers,
thank you very much for a great package that circumvents well known pitfalls in DEG calculation along pseudotime.
I have a dataset with 4 relevant biological lineages. What would be your advice for the workflow of pseudotimeDE?
Right now, I do this:
// preprocessed single cell data seurat object == seu_tropho
sce = as.SingleCellExperiment(seu_tropho, assay = "RNA")
rd = reducedDims(sce)$UMAP
fit_ori = slingshot(sce, colData(sce)$integrated_snn_res.0.3, reducedDim = rd, start.clus = "5")
traj_ori_tbl1 = tibble(cell = colnames(sce), pseudotime = rescale(colData(fit_ori)$slingPseudotime_1))
// subset sce based on cells in lineage1
lin1.sce = fit_ori[, !is.na(colData(fit_ori)$slingPseudotime_1)]
rd = reducedDims(lin1.sce)$UMAP
test = slingshot(lin1.sce, colData(lin1.sce)$integrated_snn_res.0.3, reducedDim = rd, start.clus = "5", end.clus = "1") #give end cluster so there will be only one lineage
n = 1000
set.seed(1234)
traj_indext = mclapply(seq_len(n), function(x, sce) {
sample(x = c(1:dim(sce)[2]), size = 0.8*dim(sce)[2], replace = FALSE) # dim(sce[2]) should == ncol, not a specific pseudotime
}, sce = lin1.sce)
set.seed(1234)
traj_sub_tbl1 = mclapply(traj_indext, function(x, sce, ori_tbl) {
sce = sce[, x]
rd = reducedDims(sce)$UMAP
fit = slingshot(sce, colData(sce)$integrated_snn_res.0.3, reducedDim = rd, start.clus = "5", end.clus = "1")
tbl = tibble(cell = colnames(sce), pseudotime = (rescale(colData(fit)$slingPseudotime_1)))
merge.tbl = left_join(tbl, ori_tbl, by = "cell")
if(cor(merge.tbl$pseudotime.x, merge.tbl$pseudotime.y, use = "complete.obs") < 0) {
tbl = dplyr::mutate(tbl, pseudotime = 1-pseudotime)
}
tbl
}, sce = lin1.sce, ori_tbl = traj_ori_tbl1)
res = PseudotimeDE::runPseudotimeDE(gene.vec = c("PGF", "CGA"),
ori.tbl = traj_ori_tbl1,
sub.tbl = traj_sub_tbl1, #test with 100 subsamples, run with 1k
mat = seu_tropho,
model = "nb",
mc.cores = 20
)
When running the DEG on the 2 genes above, I get a tibble with only NA values. I see from the example some NA's for particular columns are expected. However, I get no numerical nor logical output for any of the columns.
I would appreciate your help with this. Many thanks!!
Daniela Valdes
The text was updated successfully, but these errors were encountered: