This is a test version of Biostars. For the public version, visit https://www.biostars.org.
'find_gene_modules' error in the Monocle 3 tutorial

Dear all,

I have just started the 'Monocle 3' and followed it using the same code and data in the tutorial here.

When I run the code as below,

pr_graph_test_res <- graph_test(cds_subset, neighbor_graph="knn", cores=8)
pr_deg_ids <- row.names(subset(pr_graph_test_res, morans_I > 0.01 & q_value < 0.05))

gene_module_df <- find_gene_modules(cds_subset[pr_deg_ids,], resolution=1e-3)

it returns the error as below.

*Error in uwot(X = X, n_neighbors = n_neighbors, n_components = n_components, :

n_neighbors must be smaller than the dataset size*

I will very much appreciate it if you give me any advice or suggestion about this error.

Thanks,

Joshua

monocle 3 monocle rna-seq single cell

2 answers

The code works. There is no error. By mistake, I skipped running the previous code. Sorry for the confusion.

Hello,

I'm encountering the same exact error after running all the previous lines of code. How did you go about rectifying this? I'd love any help you could provide! Thanks!

Hi,

Most likely your rownames(cds@preprocess_aux$gene_loadings) are different gene ID type than rownames(cds). It could happen e.g. when you change rownames(cds) after running preprocess_cds(). Just modify your rownames(cds) and make sure that your gene subset you provide for find_gene_modules() is present in rownames(cds@preprocess_aux$gene_loadings).

Best, Michal

Log in to answer this question.