Skip to contents

Combines the results of several methods run on the same samples into one score per cell lineage (B cell, CD4 T, CD8 T, NK, monocyte, macrophage, neutrophil, dendritic, fibroblast, endothelial) and one for tumor content (PUREE purity and the inverted ESTIMATE score).

Usage

bulkdeconv_consensus(results, min_methods = 2L, min_samples = 5L)

Arguments

results

A list of results from bulkdeconv(), for the same samples and species, one per method (each method at most once).

min_methods

A lineage is reported only when at least this many methods cover it. Default 2.

min_samples

The smallest number of samples accepted, because ranks need a cohort. Default 5.

Value

An object of class bulkdeconv_consensus, a list with score (samples x lineages, mean percentile rank in (0, 1)), agreement (per lineage, the mean pairwise Spearman correlation between the methods that cover it, NA with one method), n_methods, sources (which output columns of which method entered each lineage) and dropped (lineages, methods and columns left out, with the reason).

Details

Methods report different quantities (fractions, abundance scores, enrichment scores), so their numbers cannot be averaged. Each mapped output column is therefore replaced by its percentile rank among the samples of the run, (rank - 0.5) / n, inverted where a higher method score means less of the lineage. The ranks of the columns that belong to one lineage are averaged within a method, and the method values are averaged across methods. The mapping from method outputs to lineages is in bulkdeconv_lineages().

The result orders the samples within one lineage. It is not a fraction, and it cannot be compared between lineages or between runs: adding or removing samples changes every value.

Examples

if (FALSE) { # \dontrun{
res <- lapply(c("quantiseq", "mcp_counter", "xcell"), function(m) {
  bulkdeconv(tpm, expr = "tpm", species = "human", method = m)
})
cons <- bulkdeconv_consensus(res)
cons$score
cons$agreement
} # }