SummariseDataByGroup: calculate average/median and percentage expression of...

Description Usage Arguments Value

View source: R/utils.R

Description

calculate average/median and percentage expression of features (eg. genes) in groups

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
SummariseDataByGroup(
  data,
  features,
  group_by,
  groups = NULL,
  method = base::mean,
  by_log = F,
  log_base = base::exp(1),
  exclude_zero = F,
  outlier_cutoff = 1,
  cap_value = NULL,
  do_scale = F,
  gene_force = F
)

Arguments

data

expression matrix of feature by cell, ususally normalized (in log scale) but not feature scaled. A matrix is better than data.frame in case of duplicated features.

features

features to be visualized

group_by

a vector including cell annotations

groups

only these selected groups to be visualized

method

using base::mean or stats::median or your custom function for each feature vector;

by_log

calculate by log scale ; If TRUE log_base will be ignored.

log_base

base::exp(1) or 2 or other else, depends on your normalization method.

exclude_zero

exclude zeros when calculate average/median feature value. Note exclude_zero first, outlier_cutoff second.

outlier_cutoff

sometimes outliers (several extremely high cells) should be excluded when do summarise. Set 0.99 to exclude top 1 percent cells. (default: 1)

cap_value

the max value to show in dotplot. Any value larger than it will be capped to this value. (default: NA)

do_scale

scale the summarised value across groups. Useful to demonstrate the differences among groups.

gene_force

Force gene suing zeros, which is missing in data.

Value

a list of summarised and percentage data


zzwch/convgene documentation built on July 11, 2021, 9:41 a.m.