Skip to content
Snippets Groups Projects
Commit 74b8daf4 authored by Jeffrey Pullin's avatar Jeffrey Pullin
Browse files

Add Venice method

parent 26000796
Branches
Tags
No related merge requests found
......@@ -129,6 +129,11 @@ cosg_pars <- expand_grid(
) %>%
mutate(file_name = paste0(method))
venice_pars <- expand_grid(
method = "venice",
) %>%
mutate(file_name = paste0(method))
method_pars_data <- list(
findMarkers_pars,
scoreMarkers_pars,
......@@ -145,7 +150,8 @@ method_pars_data <- list(
smash_pars,
nsforest_pars,
cepo_pars,
cosg_pars
cosg_pars,
venice_pars
)
method_pars <- flatten(map(method_pars_data, ~ transpose(.x, .names = .x$file_name)))
......
#' Find marker genes using Venice.
#'
#' Wraps functions from the Venice package.
#'
#' @param sce A SingleCellExperiment object
#' @param pars parameters passed to the function
#'
#' @return A list containing the time of the computation and results of the
#' method.
#'
run_venice <- function(sce, pars) {
`%>%` <- dplyr::`%>%`
times <- system.time({
n_groups <- length(unique(colLabels(sce)))
out <- vector("list", length = n_groups)
for (j in seq_len(n_groups)) {
group <- levels(colLabels(sce))[[j]]
x <- colLabels(sce) == group
count_mat <- counts(sce)
if (!isS4(count_mat)) {
count_mat <- methods::as(count_mat, "sparseMatrix")
}
raw_group_out <- Signac::VeniceMarker(count_mat, x)
group_out <- raw_group_out %>%
tibble::as_tibble() %>%
dplyr::rename(
gene = Gene.Name,
log_fc = Log2.fold.change,
) %>%
dplyr::mutate(
p_value = 10^Log10.p.value,
p_value_adj = 10^Log10.adjusted.p.value
) %>%
dplyr::mutate(
cluster = group,
raw_statistic = log_fc,
scaled_statistic = 0
) %>%
tibble::as_tibble()
out[[j]] <- group_out
}
result <- dplyr::bind_rows(!!!out)
})
# Get the elapsed time.
time <- times[[3]]
validate_mgs_result(result)
list(time = time, result = result, raw_result = result, pars = pars)
}
smash-fork @ 5d40f5d7
Subproject commit 5d40f5d799452fcfb69b255989831b9a0ddd4547
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment