Skip to contents

Given a vector of cluster labels, returns pairs of cross-cluster cells

Usage

getCellPairs(
  clusters,
  n = 1000,
  ls = NULL,
  q = c(0.1, 0.9),
  selMode = "proportional",
  soft.min = 5
)

Arguments

clusters

A vector of cluster labels for each cell, or a list containing metacells and graph

n

The number of cell pairs to obtain

ls

Optional library sizes

q

Library size quantiles between which to include cells (ignored if `ls` is NULL)

selMode

How to decide the number of pairs of each kind to produce. Either 'proportional' (default, proportional to the abundance of the underlying clusters), 'uniform' or 'sqrt'.

soft.min

Minimum number of pairs of a given type.

Value

A data.frame with the columns

Examples

# create random labels
x <- sample(head(LETTERS), 100, replace=TRUE)
getCellPairs(x, n=6)
#>    cell1 cell2 orig.clusters
#> 1     65    16           A+B
#> 2     47    96           A+C
#> 3     44     7           B+C
#> 4     32    45           A+D
#> 5     44    53           B+D
#> 6     79    54           C+D
#> 7     82    59           A+E
#> 8     23     6           B+E
#> 9     79   100           C+E
#> 10    24    29           D+E
#> 11    99     2           A+F
#> 12    23     2           B+F
#> 13    96    50           C+F
#> 14    71    83           D+F
#> 15    57    85           E+F