monocle3
monocle3 copied to clipboard
choose_graph_segments() keeping original path
I have a cds object in which I have run pseudotime analysis.
From here, I want to study the gene expression differences between the 2 paths that depart from root 1. I have been able to do this by running choose_cells(). However, I would prefer not having to manually gate the cells for reproducibility purposes, something that I can do by using choose_graph_segments(clear_cds = F). However, when I run choose_graph_segments() I run into the following error when running graph_test():
Error in intI(i, n = d[1], dn[[1]], give.dn = FALSE) : invalid character indexing
Something that I assume is due to the fact that there are parts of the original path missing, as seen in here:
choose_cells()
choose_graph_segments(clear_cds = F)
I don’t want to run learn_graph() again as I will lose my original trajectory.
Is there a way of making choose_graph_segments() keep the same information as choose_cells() so the downstream analysis can be performed with the original path? (as shown, this is not achieved by choosing clear_cds = F)
Thank you for your help!
Any updates on this? Running into the same issue :/
I would also like this answered- very frustrating!
I am running into exactly the same issue and would much prefer to be able to do this using choose_graph_segment()
instead of choose_cells()
for reproducibility purposes. Has this been answered or dealt with?
I actually found that updating the the newest version of Monocle (monocle3_1.2.9) solved my issue.
Hi! Thank you for a great package. Still running into this issue when I'm subsetting a specific branch in order to analyze pseudotime. Using Monocle3 version 1.3.1 - did anyone figure out how to solve this?
`> cds_sub_memory <- choose_graph_segments(cds, clear_cds = F)
plot_cells(cds_sub_memory) Error in names(root_pr_nodes) <- cds@principal_graph_aux[[reduction_method]]$root_pr_nodes : 'names' attribute [1] must be the same length as the vector [0] cds_sub_memory_genes <- graph_test(cds_sub_memory, neighbor_graph="principal_graph") Error in intI(i, n = d[1L], dn[[1L]], give.dn = FALSE) : invalid character indexing`
Hi!
Found a way around it, in case anyone else is looking for a solution. So far it's working! cds_sub_graph <- choose_graph_segments(cds, clear_cds = F, return_list = T) cds_sub_graph <- cds[,cds_sub_graph$cells]
Hi!
Found a way around it, in case anyone else is looking for a solution. So far it's working! cds_sub_graph <- choose_graph_segments(cds, clear_cds = F, return_list = T) cds_sub_graph <- cds[,cds_sub_graph$cells]
It works, thanks so much!