cole-trapnell-lab / monocle3

Other
338 stars 101 forks source link

plot_genes_by_group() error #419

Closed MartaBenegas closed 4 years ago

MartaBenegas commented 4 years ago

I've been following the clustering tutorial with my own dataset and when I reach the gene markers plotting it raises an error that I don't know how to solve:

Error: Problem with `filter()` input `..1`. x object 'gene_short_name' not found ℹ Input `..1` is `rowname %in% markers | gene_short_name %in% markers`.

Here is my code: monocle_analysis.txt (it's an R notebook file but I renamed it as .txt so I can upload it)

The link to the count matrix.

And the traceback:

19. stop(fallback)
18. signal_abort(cnd)
17. abort(c(cnd_bullet_header(), x = conditionMessage(e), i = cnd_bullet_input_info(), i = cnd_bullet_cur_group_label()), class = "dplyr_error")
16. h(simpleError(msg, call))
15. .handleSimpleError(function (e) { local_call_step(dots = dots, .index = env_filter$current_expression, .fn = "filter") ...
14. gene_short_name %in% markers
13. mask$eval_all_filter(dots, env_filter)
12. withCallingHandlers(mask$eval_all_filter(dots, env_filter), error = function(e) { local_call_step(dots = dots, .index = env_filter$current_expression, .fn = "filter") abort(c(cnd_bullet_header(), x = conditionMessage(e), i = cnd_bullet_input_info(), ...
11. filter_rows(.data, ...)
10. filter.data.frame(., rowname %in% markers | gene_short_name %in% markers)
9. dplyr::filter(., rowname %in% markers | gene_short_name %in% markers)
8. function_list[[i]](value)
7. freduce(value, `_function_list`)
6. `_fseq`(`_lhs`)
5. eval(quote(`_fseq`(`_lhs`)), env, env)
4. eval(quote(`_fseq`(`_lhs`)), env, env)
3. withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
2. as.data.frame(fData(cds)) %>% tibble::rownames_to_column() %>% dplyr::filter(rowname %in% markers | gene_short_name %in% markers) %>% dplyr::pull(rowname)
1. plot_genes_by_group(dge, top_specific_marker_ids, group_cells_by = "cluster", ordering_type = "maximal_on_diag", max.size = 3)

Thank you in advance!

hpliner commented 4 years ago

Hello, This error is because you don't have a gene_short_name column in your rowData. If your row.names are already symbols, you can add this line with rowData(cds)$gene_short_name <- row.names(rowData(cds)). I am adding a better error message in the meantime!

MartaBenegas commented 4 years ago

Thanks for your answer!