Skip to content

Can I use plotCHOIR to show the prediction accuracy scores of my pre-generated clusters? #40

Description

@FY10086

Hello, I am very interested in the CHOIR you have developed. Currently, I am trying to use plotCHOIR to show the prediction accuracy scores of my clusters, but I have encountered some issues and would like to seek your help. I have already run the code and here is the error:

tmp=select(seu@meta.data,"seurat_cluster.rpca_GSE_c5_c14_c6_c18_c21_c22_c36_sub")
cluster_labels=tmp$seurat_cluster.rpca_GSE_c5_c14_c6_c18_c21_c22_c36_sub
names(cluster_labels)=rownames(tmp)
reduction=as.matrix(seu@reductions$umap.rpca_GSE@cell.embeddings)
reduction=reduction[names(cluster_labels),]

cluster_tree=inferTree(cluster_labels, ## A named vector of cluster IDs. Names must correspond to cell IDs.
dist_matrix = NULL, ## An optional distance matrix of cell to cell distances (based on dimensionality reduction cell embeddings).
reduction = reduction, ## An optional matrix of dimensionality reduction cell embeddings to be used for distance calculations.
verbose = TRUE)

input_matrix <- as.matrix(GetAssayData(seu, assay = "RNA", slot = "data"))

seu=pruneTree(
seu,
cluster_tree = cluster_tree,
input_matrix = input_matrix,
nn_matrix = as(seu@graphs$RNA_nn, "dgCMatrix"),
snn_matrix = as(seu@graphs$RNA_snn, "dgCMatrix"),
reduction = reduction,
n_cores = 4,
verbose = TRUE
)

All the above steps have been successfully completed.

plotCHOIR(seu_sampled,
reduction = "umap.rpca_GSE",
group_by = "seurat_cluster.rpca_GSE_c5_c14_c6_c18_c21_c22_c36_sub",
accuracy_scores = TRUE,
plot_nearest = FALSE)

Error in .validInput(reduction, "reduction", list("plotCHOIR", object, : Input value 'umap.rpca_GSE' for 'reduction' was not found in the provided object, please supply valid input!
Traceback:

  1. .validInput(reduction, "reduction", list("plotCHOIR", object,
    . key))
  2. stop("Input value '", input, "' for '", name, "' was not found in the provided object, please supply valid input!")
  3. .handleSimpleError(function (cnd)
    . {
    . watcher$capture_plot_and_output()
    . cnd <- sanitize_call(cnd)
    . watcher$push(cnd)
    . switch(on_error, continue = invokeRestart("eval_continue"),
    . stop = invokeRestart("eval_stop"), error = NULL)
    . }, "Input value 'umap.rpca_GSE' for 'reduction' was not found in the provided object, please supply valid input!",
    . base::quote(.validInput(reduction, "reduction", list("plotCHOIR",
    . object, key))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions