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     31    94           A+B
#> 2     22    17           A+C
#> 3     36    59           B+C
#> 4     21    13           A+D
#> 5     38    85           B+D
#> 6     11    85           C+D
#> 7     57    52           A+E
#> 8     66     8           B+E
#> 9     59    81           C+E
#> 10    82    28           D+E
#> 11    22    89           A+F
#> 12    38    30           B+F
#> 13    17    53           C+F
#> 14    13    69           D+F
#> 15    90    32           E+F