tl_calcSimilarity: calculate inter-similarity or intra-similarity of clusters

Description Usage Arguments Details Value Source

View source: R/tl.R

Description

calculate inter-similarity or intra-similarity of clusters

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
tl_calcSimilarity(
  data,
  group_by,
  groups = NULL,
  subset_by = NULL,
  subsets = NULL,
  dist_fun = stats::dist,
  metric = "euclidean",
  transform_to_similarity = T,
  transform_method = function(x) 1(1 + x),
  ...
)

Arguments

data

feature by cell matrix

group_by

vector of cell annotation

groups

only consider subset cells belonging to these groups

subset_by

if setted, calc intra-/inter-similarity of groups restricted to each subset

subsets

only consider cells belonging to these subsets

dist_fun

function to calculate distance/similarity. see Details.

metric

metric passed to dist_fun

transform_to_similarity

from dist to similarity

transform_method

dist to similarity function, see Details

...

ohter params passed to dist_fun

Details

dist_fun: stats::dist, ClassDiscovery::distanceMatrix (pearson, sqrt pearson, spearman, absolute pearson and so on), philentropy::distance (46 different distances/similarities),

transform_method: 1) 1/(1+x) 2) 1-x/max(x) 3) sqrt(1-x/max(x)) 4) 1-x 5) 1-abs(x) any meaningful function

Value

a slimilarity matrix, usually 0-1

Source

Fig. 4A at https://doi.org/10.1016/j.cell.2019.11.010


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