Skip to content

Commit

Permalink
fix more notes
Browse files Browse the repository at this point in the history
  • Loading branch information
kriemo committed Aug 23, 2024
1 parent ce895fc commit 1562dba
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/compute_similarity.R
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ vector_similarity <- function(vec1, vec2, compute_method, ...) {
}

if (!(compute_method %in% c("cosine", "kl_divergence"))) {
stop(paste(compute_method, "not implemented"), call. = FALSE)
stop(compute_method, " not implemented", call. = FALSE)
}

if (compute_method == "kl_divergence") {
Expand Down
2 changes: 1 addition & 1 deletion R/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ clustify.default <- function(input,
expand_unassigned = FALSE,
...) {
if (!compute_method %in% clustifyr_methods) {
stop(paste(compute_method, "correlation method not implemented"),
stop(compute_method, " correlation method not implemented",
call. = FALSE
)
}
Expand Down
14 changes: 12 additions & 2 deletions R/object_access.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,17 @@ so_pbmc <- function() {
#' @export
sce_pbmc <- function() {
x <- pbmc_example_data()
md <- x$metadata[, c(1:5, 7)]

cols_to_keep <- c(
"orig.ident",
"nCount_RNA",
"nFeature_RNA",
"percent.mt",
"RNA_snn_res.0.5",
"classified"
)

md <- x$metadata[, cols_to_keep]
# rename to more sce-like names
colnames(md) <- c("cell_source",
"sum",
Expand Down Expand Up @@ -295,7 +305,7 @@ seurat_ref.Seurat <- function(seurat_object,
SeuratObject::DefaultAssay(seurat_object) <- og_assay
}
} else {
stop("warning, not seurat3 object")
stop("Input is not a compatible Seurat object")
}

temp_res <- average_clusters(
Expand Down
3 changes: 2 additions & 1 deletion vignettes/clustifyr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ res <- clustify(
obj_out = TRUE # output Seurat object with cell type inserted as "type" column
)
res@meta.data[1:10, c("type", "r")]
# type and r are stored in the meta.data
res[[c("type", "r")]][1:10, ]
```

# Building reference matrix from single cell expression matrix
Expand Down

0 comments on commit 1562dba

Please sign in to comment.