monocle3 icon indicating copy to clipboard operation
monocle3 copied to clipboard

'choose_graph_segments' created error for 'plot_cells'

Open grimwoo opened this issue 3 years ago • 0 comments

Thanks for development of such a good package.

I am a new user for Monole 3. Here, I successfully create a trajectory plot according to your guidance.

However, error happened when I subset the cds object. Firstly, I subset cds object by cds_sub <- choose_graph_segments(cds = cds, clear_cds = F), which ran successfully without error information. But I find I cannot plot any figure I ploted in csd object.

Example: code of pseudotime plot ran with error and resulted in no figure for subset object .

> plot_cells(cds, color_cells_by = "pseudotime", label_cell_groups=FALSE, label_leaves=FALSE, label_branch_points=FALSE, graph_label_size=1.5) image

> plot_cells(cds_sub, color_cells_by = "pseudotime", label_cell_groups=FALSE, label_leaves=FALSE, label_branch_points=FALSE, graph_label_size=1.5) Error in names(root_pr_nodes) <- cds@principal_graph_aux[[reduction_method]]$root_pr_nodes : 'names' attribute [85] must be the same length as the vector [22]

Here, the object seems fine, could anyone help me? > cds class: cell_data_set dim: 3000 45870 metadata(2): cds_version citations assays(1): counts rownames(3000): RPS11 LDHB ... GM40383 GM38804 rowData names(2): id gene_short_name colnames(45870): AAACCCAGTATGGTAA-1 AAACCCAGTGATACCT-1 ... hsa.w20.BGI.3_CELL4327_N1 hsa.w20.BGI.3_CELL5415_N1 colData names(19): nCount_RNA nFeature_RNA ... Pseudotime_Scanpy Size_Factor reducedDimNames(2): PCA UMAP altExpNames(0):

> cds_sub class: cell_data_set dim: 3000 4958 metadata(2): cds_version citations assays(1): counts rownames(3000): RPS11 LDHB ... GM40383 GM38804 rowData names(2): id gene_short_name colnames(4958): AAACGCTAGTCAAGCG-1 AAAGGTATCGTAACTG-1 ... hsa.w20.BGI.3_CELL2172_N1 hsa.w20.BGI.3_CELL4201_N1 colData names(19): nCount_RNA nFeature_RNA ... Pseudotime_Scanpy Size_Factor reducedDimNames(2): PCA UMAP altExpNames(0):

PS: I tried another way to subset cds object (cds_sub.name_list <- choose_graph_segments(cds = cds, return_list = T) and cds_sub <- cds[,grepl(cds_sub.name_list, colData(cds)$Cell_ID, ignore.case=TRUE)]), which resulted in another kind of error.

grimwoo avatar Oct 19 '21 07:10 grimwoo