Skip to content

Commit

Permalink
Fixed R CMD Check errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
enblacar committed Aug 20, 2024
1 parent 3d7a808 commit 6bbeaa9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion R/do_DotPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ do_DotPlot <- function(sample,
zscore.data = FALSE,
min.cutoff = NA,
max.cutoff = NA,
enforce_symmetry = ifelse(base::isTRUE(scale.data), TRUE, FALSE),
enforce_symmetry = ifelse(base::isTRUE(zscore.data), TRUE, FALSE),
legend.title = NULL,
legend.type = "colorbar",
legend.position = "bottom",
Expand Down
15 changes: 12 additions & 3 deletions R/do_RankedExpressionPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ do_RankedExpressionPlot <- function(sample,
key_col <- stringr::str_remove_all(key, "_")
# Obtain the DC embeddings, together with the enrichment scores.
suppressWarnings({
# Workaround parameter depreciation.
if (base::isTRUE(utils::packageVersion("Seurat") < "4.9.9")){
data <- Seurat::GetAssayData(object = sample,
assay = assay,
slot = slot)
} else {
data <- SeuratObject::LayerData(object = sample,
assay = assay,
layer = slot)
}

data.use <- sample@reductions[[reduction]]@cell.embeddings %>%
as.data.frame() %>%
tibble::rownames_to_column(var = "Cell") %>%
Expand All @@ -208,9 +219,7 @@ do_RankedExpressionPlot <- function(sample,
tibble::rownames_to_column(var = "Cell") %>%
tibble::as_tibble() %>%
dplyr::select(dplyr::all_of(c("Cell", group.by))) %>%
dplyr::left_join(y = {SeuratObject::GetAssayData(sample,
assay = assay,
slot = slot)[features, , drop = FALSE] %>%
dplyr::left_join(y = {data[features, , drop = FALSE] %>%
as.data.frame() %>%
t() %>%
as.data.frame() %>%
Expand Down
2 changes: 1 addition & 1 deletion man/do_DotPlot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions man/do_RankedExpressionPlot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions man/examples/examples_do_RankedExpressionPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
sample <- readRDS(system.file("extdata/seurat_dataset_example.rds", package = "SCpubr"))

# Genes have to be unique.
genes <- list("A" = rownames(sample)[1:5],
"B" = rownames(sample)[6:10],
"C" = rownames(sample)[11:15])
genes <- rownames(sample)[1:15]


# This will query, for the provided components, the expression of the genes
Expand Down

0 comments on commit 6bbeaa9

Please sign in to comment.