Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pipeline/bin/computeSignaturesNF.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ source(paste0(baseDir, '/bin/utils.R'))
method_normalizations <- read.table(paste0(baseDir, '/optimal_normalizations.csv'), sep = ',', header = TRUE)

# find method-specific normalizations for sc and bulk
sc_norm <- method_normalizations[method_normalizations$method == method, 2]
bulk_norm <- method_normalizations[method_normalizations$method == method, 3]
print(paste0('Method: ', method, '; sc-norm: ', sc_norm, '; bulk-norm: ', bulk_norm))
if(method %in% method_normalizations$method){
sc_norm <- method_normalizations[method_normalizations$method == method, 2]
bulk_norm <- method_normalizations[method_normalizations$method == method, 3]
print(paste0('Method: ', method, '; sc-norm: ', sc_norm, '; bulk-norm: ', bulk_norm))
} else {
stop(paste0('Method ', method, ' is not currently supported. Exiting.'))
}

# check if preprocessing has been performed
if(args$run_preprocessing == 'true'){
Expand Down
48 changes: 45 additions & 3 deletions pipeline/bin/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ signature_workflow_general <- function(sc_matrix, annotations, annotation_catego
verbose = TRUE
)$basis

} else if (method == "momf") {

signature <- omnideconv::build_model_momf(
sc_matrix,
annotations,
bulk_matrix
)

} else if(method == "scaden"){
unlink(tmp_dir_path, recursive=TRUE)
if(!dir.exists(paste0(tmp_dir_path))){
Expand All @@ -257,7 +265,7 @@ signature_workflow_general <- function(sc_matrix, annotations, annotation_catego
verbose = TRUE
)

}else if (method %in% c('autogenes', 'bayesprism', 'bisque', 'music')){
} else if (method %in% c('autogenes', 'bayesprism', 'bisque', 'cdseq', 'cpm', 'music')){
signature <- NULL

} else {
Expand Down Expand Up @@ -328,6 +336,21 @@ deconvolution_workflow_general <- function(sc_matrix, annotations, annotation_ca
batch_ids = sc_batch,
verbose = TRUE,
)$bulk.props)

} else if (method=="cdseq"){

deconvolution_cdseq <- omnideconv::deconvolute_cdseq(
bulk_gene_expression = bulk_matrix,
single_cell_object = sc_matrix,
cell_type_annotations = annotations,
batch_ids = sc_batch,
block_number=10,
gene_subset_size=1000,
verbose = TRUE,
)

deconvolution <- t(deconvolution_cdseq$cdseq_prop_merged)
print(deconvolution)

} else if (method=="cibersortx"){

Expand Down Expand Up @@ -365,6 +388,15 @@ deconvolution_workflow_general <- function(sc_matrix, annotations, annotation_ca
unlink(cx_input, recursive=TRUE)
unlink(cx_output, recursive=TRUE)

} else if (method=="cpm"){

deconvolution <- omnideconv::deconvolute_cpm(
bulk_gene_expression = bulk_matrix,
single_cell_object = sc_matrix,
cell_type_annotations = annotations,
verbose = TRUE,
)$cellTypePredictions

} else if(method=="dwls") {

deconvolution <- omnideconv::deconvolute_dwls(
Expand Down Expand Up @@ -396,8 +428,18 @@ deconvolution_workflow_general <- function(sc_matrix, annotations, annotation_ca
#)
print(deconvolution)

} else if (method == "music"){
deconvolution <- omnideconv::deconvolute_music(
} else if (method == "momf"){
deconvolution_momf <- omnideconv::deconvolute_momf(
bulk_matrix,
signature,
sc_matrix,
verbose = TRUE,
)

deconvolution <- deconvolution_momf$cell.prop

} else if (method == "music"){
deconvolution <- omnideconv::deconvolute_momf(
bulk_gene_expression = bulk_matrix,
single_cell_object = sc_matrix,
cell_type_annotations = annotations,
Expand Down
21 changes: 12 additions & 9 deletions pipeline/optimal_normalizations.csv
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
method,sc_norm,bulk_norm
autogenes,cpm,tpm
bayesprism,counts,counts
bisque,counts,counts
cibersortx,cpm,tpm
dwls,counts,tpm
music,counts,tpm
scaden,counts,tpm
scdc,counts,tpm
method,sc_norm,bulk_norm
autogenes,cpm,tpm
bayesprism,counts,counts
bisque,counts,counts
cdseq,counts,counts
cibersortx,cpm,tpm
cpm,counts,counts
dwls,counts,tpm
momf,counts,counts
music,counts,tpm
scaden,counts,tpm
scdc,counts,tpm
rectangle,counts,tpm