Description Usage Arguments Details Value See Also
View source: R/mean_expression.R
For each given combination of phenotype and expression parameter, report the mean expression of the given marker in the specified cells.
1 2 3 4 5 6 7 8 9 | compute_mean_expression_many(
csd,
phenotypes,
params,
tissue_categories = NULL,
percentile = NULL,
count = NULL,
.by = "Slide ID"
)
|
csd |
Cell seg data to use. This should already have been filtered
for the slides or fields of interest. It may already be nested by
!!.by and |
phenotypes |
A named list of phenotype selectors (see phenoptr::parse_phenotypes). |
params |
A named list matching phenotype names to expression column names. |
tissue_categories |
Optional vector of tissue category names to include. |
percentile |
The percentile cutoff for top-expressing cells. For example, to measure the top quartile, the percentile is 0.75. Negative numbers will use low-expressing cells; to measure the bottom decile, use a percentile of -0.1. |
count |
The number of top expressing cells to use. Only one of
|
.by |
Column to aggregate by |
This is a very flexible function. If percentile
and count
are both
omitted, it will compute the mean expression for all cells in the
given phenotype. If either percentile
or count
is given, the mean
expression of the highest expressing cells is computed. If a negative
percentile
is given, the lowest percentile is used; for example
percentile=-.1
would give the expression of the lowest-expressing
decile.
By default, this function aggregates by Slide ID
and Tissue Category
.
To compute mean expression by a different aggregate, pass a column name in
the .by
parameter.
To aggregate over all cells, include "Total Cells"=NA
as one of the
phenotypes.
A data frame with a column for mean for each param_pair
.
Other aggregation functions:
compute_density_from_cell_summary()
,
compute_density_from_table()
,
compute_h_score_from_score_data()
,
compute_h_score()
,
compute_mean_expression()
,
compute_positivity_many()
,
compute_positivity()
,
count_phenotypes()
,
counts_to_percents()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.