1919# ' List of methods that support the use of a custom signature
2020# '
2121# ' The available methods are
22- # ' `epic`, `cibersort`, `cibersort_abs`, `consensus_tme`, `base `
22+ # ' `epic`, `cibersort`, `cibersort_abs`, `consensus_tme`, `seqimmucc `
2323# '
2424# ' The object is a named vector. The names correspond to the display name of the method,
2525# ' the values to the internal name.
@@ -29,7 +29,7 @@ custom_deconvolution_methods <- c(
2929 " EPIC" = " epic" ,
3030 " CIBERSORT" = " cibersort" ,
3131 " ConsensusTME" = " consensus_tme" ,
32- " BASE " = " base "
32+ " seqImmuCC " = " seqimmucc "
3333)
3434
3535
@@ -153,25 +153,29 @@ deconvolute_consensus_tme_custom <- function(gene_expression_matrix, signature_g
153153}
154154
155155
156-
157- # ' Deconvolute using BASE and a custom signature matrix
156+ # ' Deconvolute using seqImmuCC (LLSR regression) and a custom signature matrix
158157# '
159158# ' @param gene_expression_matrix a m x n matrix with m genes and n samples. Data
160159# ' should be TPM normalized and log10 scaled.
161- # ' @param signature_matrix a m x l matrix with m genes and l cell types. Data
162- # ' should be non normalized, as the normalization wil be done in the construction
163- # ' of the compendium (internal structure)
164- # ' @param n_permutations the number of permutations of each sample expression
165- # ' to generate. These are used to normalize the results.
166- # ' @param log10 logical. if TRUE, log10 transforms the expression matrix.
160+ # ' @param signature_matrix a m x l matrix with m genes and l cell types. The
161+ # ' matrix should contain only a subset of the genes useful for the analysis.
162+ # ' @param ... passed to the original seqImmuCC_LLSR function
167163# ' @export
168164# '
169- deconvolute_base_custom <- function (gene_expression_matrix ,
170- signature_matrix ,
171- n_permutations = 100 ,
172- log10 = TRUE ) {
173- new.cell.compendium <- create_base_compendium(signature_matrix )
174- results <- base_algorithm(gene_expression_matrix , new.cell.compendium , perm = n_permutations )
165+ deconvolute_seqimmucc_custom <- function (gene_expression_matrix ,
166+ signature_matrix ,
167+ ... ) {
168+ arguments <- dots_list(
169+ signature = signature_matrix ,
170+ SampleData = gene_expression_matrix , ... , .homonyms = " last"
171+ )
172+
173+ call <- rlang :: call2(seqImmuCC_LLSR , !!! arguments )
174+ results <- eval(call )
175+
176+
177+ # results <- seqImmuCC_LLSR(signature_matrix, gene_expression_matrix, ..., .homonyms = "last")
178+ results <- results [, ! colnames(results ) %in% c(" Correlation" , " RSEM" )]
175179
176180 return (t(results ))
177181}
0 commit comments