Skip to content

Commit

Permalink
Add new args to bootstrap_enrichment_test 2
Browse files Browse the repository at this point in the history
  • Loading branch information
bschilder committed Nov 14, 2023
1 parent cccf523 commit 43bf2db
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
5 changes: 2 additions & 3 deletions R/bootstrap_enrichment_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ bootstrap_enrichment_test <- function(sct_data = NULL,
geneSizeControl = geneSizeControl,
controlledCT = controlledCT,
control_network = control_network,
store_gene_data = store_gene_data,
verbose = verbose
)
hit.cells <- sumProp$hit.cells
Expand Down Expand Up @@ -340,9 +341,7 @@ bootstrap_enrichment_test <- function(sct_data = NULL,
report_results(
results = results,
verbose = verbose
)
#### Omit gene_data to save memory ####
if(isFALSE(store_gene_data)) gene_data <- NULL
)
#### Return results list ####
full_results <- list(
results = results,
Expand Down
17 changes: 11 additions & 6 deletions R/get_summed_proportions.r
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ get_summed_proportions <- function(hits,
geneSizeControl,
controlledCT = NULL,
control_network = NULL,
store_gene_data = TRUE,
verbose = TRUE) {

controlledCT <- fix_celltype_names(celltypes = controlledCT)
Expand Down Expand Up @@ -83,12 +84,16 @@ get_summed_proportions <- function(hits,
annotLevel=annotLevel,
no_cores=no_cores)
#### Get gene scores #####
gene_data <- compute_gene_scores(sct_data = sct_data,
annotLevel = annotLevel,
bootstrap_list = bootstrap_list,
hits = hits,
combinedGenes = combinedGenes,
verbose = verbose)
if(isTRUE(store_gene_data)){
gene_data <- compute_gene_scores(sct_data = sct_data,
annotLevel = annotLevel,
bootstrap_list = bootstrap_list,
hits = hits,
combinedGenes = combinedGenes,
verbose = verbose)
} else {
gene_data <- NULL
}
#### Get celltypes scores ####
bootstrap_data <- as.matrix(
lapply(bootstrap_list,function(x){x$celltypes}) |>
Expand Down
7 changes: 7 additions & 0 deletions man/get_summed_proportions.Rd

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

0 comments on commit 43bf2db

Please sign in to comment.