Closed MDHowe4 closed 5 months ago
This should do the trick:
# load up example data
data(PBMC_fs, PBMC_panel, PBMC_md)
sce <- prepData(PBMC_fs, PBMC_panel, PBMC_md)
# mock up some cluster IDs
kid <- factor(sample(c("la", "le", "lu"), ncol(sce), TRUE))
# setup 'cluster_codes'
tbl <- data.frame(som100=seq(ncol(sce)), annotation=kid)
# assign cell index as base 'cluster_id'
sce$cluster_id <- tbl$som100
# add codes to 'metadata'
metadata(sce)$cluster_codes <- tbl
# spot-check
identical(cluster_ids(sce, "annotation"), kid)
## > TRUE
# exemplary plotting
sce <- runDR(sce, "UMAP", cells=100)
plotDR(sce, color_by="annotation")
Hello,
In my case I have already annotated cell types outside of CATALYST using Maxpar Pathsetter. I can import this data into CATALYST and can access it through in the
cell_id
column.Is there way to make this compatible for plotting with CATALYST (I really like the visualizations). I tried:
But this causes problems with functions that rely upon the cluster_codes field for plotting. I basically just want to visualize my cell annotation labels in the same way as done after running the cluster() function. I would also like to merge those number labels to their actual cell type names (e.g. CD4 T-cells) later since I have that information for each
cell_id
.