tl_calcFeatureScore: calculate average/median rescale expression of features (eg....

Description Usage Arguments Value

View source: R/tl.R

Description

calculate average/median rescale expression of features (eg. genes) for each cell

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
tl_calcFeatureScore(
  data,
  features,
  rescale_max = 10,
  rescale_min = 0,
  method = base::mean,
  by_log = T,
  log_base = base::exp(1),
  exclude_zero = F,
  outlier_cutoff = 1,
  cap_value = NULL,
  gene_force = F,
  rescale_again = T
)

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 calculated

rescale_max

rescale data

rescale_min

rescale data

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)

gene_force

Force gene suing zeros, which is missing in data.

rescale_again

do rescale again after summarisie

Value

a list of mean and percentage data


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