tanaylab / mcATAC

Metacell analysis for ATAC data
https://tanaylab.github.io/mcATAC/
Other
1 stars 0 forks source link

generate_pheatmap_annotation returns error when fed with a cell type annotation vector #19

Closed yonatans2 closed 2 years ago

yonatans2 commented 2 years ago

This should work (mcmd$st is a cell-type annotation): ann_list = generate_pheatmap_annotation(clust_vec = mcmd$st, feature_type = "cell_type", feature_annotation = "color")

But gives an error:

` Error in stop_vctrs(class = c(class, "vctrs_error_names"), ...): Names must be unique. ✖ These names are duplicated:

  1. generate_pheatmap_annotation(clust_vec = mcmd$st, feature_type = "cell_type", . feature_annotation = "color")
  2. tibble(name = cts, color = chameleon::distinct_colors(length(cts))$name) %>% . rename(:=(!!feature_annotation, name)) # at line 67-68 of file /home/feshap/src/mcATAC/R/utils.R
  3. rename(., :=(!!feature_annotation, name))
  4. rename.data.frame(., :=(!!feature_annotation, name))
  5. tidyselect::eval_rename(expr(c(...)), .data)
  6. rename_impl(data, names(data), as_quosure(expr, env), strict = strict, . name_spec = name_spec)
  7. with_subscript_errors(vctrs::vec_as_names(names, repair = "check_unique"))
  8. tryCatch(instrument_base_errors(expr), vctrs_error_subscript = function(cnd) { . cnd$subscript_action <- subscript_action(type) . cnd$subscript_elt <- "column" . cnd_signal(cnd) . })
  9. tryCatchList(expr, classes, parentenv, handlers)
  10. tryCatchOne(expr, names, parentenv, handlers[[1L]])
  11. doTryCatch(return(expr), name, parentenv, handler)
  12. instrument_base_errors(expr)
  13. withCallingHandlers(expr, simpleError = function(cnd) { . abort(conditionMessage(cnd), parent = cnd) . })
  14. vctrs::vec_as_names(names, repair = "check_unique")
  15. (function () . validate_unique(names = names, arg = arg))()
  16. validate_unique(names = names, arg = arg)
  17. stop_names_must_be_unique(names, arg)
  18. stop_names(class = "vctrs_error_names_must_be_unique", arg = arg, . names = names)
  19. stop_vctrs(class = c(class, "vctrs_error_names"), ...)
  20. abort(message, class = c(class, "vctrs_error"), ...)
  21. signal_abort(cnd, .file)`