Compute stats for samples grouped by one or more annotations

group_stats(
  data_df,
  value_cols = NULL,
  anno,
  grouping,
  stat = c("median", "mean", "tmean", "prop_gt0", "prop_gt1", "prop_gt_cutoff", "min",
    "max"),
  cutoff = NULL
)

Arguments

data_df

a data.frame with sample_name and expression values

value_cols

The values to use for computation. If NULL (default), will select all columns in data_df except sample_name.

anno

a data.frame with sample_name and sample annotations

grouping

one or more column names of anno to use for sample grouping

stat

Which statistic to compute for grouped samples.
options are:

  • "median"

  • "mean"

  • "tmean" (25% trimmed mean)

  • "nzmean" (mean of non-zero values)

  • "nzmedian" (median of non-zero values)

  • "prop_gt0" (proportion of samples > 0)

  • "prop_gt1" (proportion of samples > 1)

  • "prop_gt_cutoff" (proportion of samples > cutoff)

  • "min"

  • "max"

cutoff

A cutoff for use in stats calculations. Most ignore this value. Default is 0.

Examples

group_stats(melt_df, value_cols = NULL, anno, grouping = "mouse_line", stat = "mean")
#> Error in group_stats(melt_df, value_cols = NULL, anno, grouping = "mouse_line",     stat = "mean"): object 'melt_df' not found