getArtificialDoublets: getArtificialDoublets

Description Usage Arguments Value Examples

View source: R/getArtificialDoublets.R

Description

Create expression profiles of random artificial doublets.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
getArtificialDoublets(
  x,
  n = 3000,
  clusters = NULL,
  resamp = 0.5,
  halfSize = 0.5,
  adjustSize = 0.2,
  propRandom = 0.1,
  selMode = c("proportional", "uniform", "sqrt"),
  n.meta.cells = 2,
  meta.triplets = TRUE
)

Arguments

x

A count matrix, with features as rows and cells as columns.

n

The approximate number of doublet to generate (default 3000).

clusters

The optional clusters labels to use to build cross-cluster doublets.

resamp

Logical; whether to resample the doublets using the poisson distribution. Alternatively, if a proportion between 0 and 1, the proportion of doublets to resample.

halfSize

Logical; whether to half the library size of doublets (instead of just summing up the cells). Alternatively, a number between 0 and 1 can be given, determining the proportion of the doublets for which to perform the size adjustment.

adjustSize

Logical; whether to adjust the size of the doublets using the ratio between each cluster's median library size. Alternatively, a number between 0 and 1 can be given, determining the proportion of the doublets for which to perform the size adjustment.

propRandom

The proportion of the created doublets that are fully random (default 0.1); the rest will be doublets created across clusters. Ignored if 'clusters' is NULL.

selMode

The cell pair selection mode for inter-cluster doublet generation, either 'uniform' (same number of doublets for each combination), 'proportional' (proportion expected from the clusters' prevalences), or 'sqrt' (roughly the square root of the expected proportion).

n.meta.cells

The number of meta-cell per cluster to create. If given, additional doublets will be created from cluster meta-cells. Ignored if 'clusters' is missing.

meta.triplets

Logical; whether to create triplets from meta cells. Ignored if 'clusters' is missing.

Value

A list with two elements: 'counts' (the count matrix of the artificial doublets) and 'origins' the clusters from which each artificial doublets originated (NULL if 'clusters' is not given).

Examples

1
2
3
m <- t(sapply( seq(from=0, to=5, length.out=50), 
               FUN=function(x) rpois(30,x) ) )
doublets <- getArtificialDoublets(m, 30)

scDblFinder documentation built on Nov. 8, 2020, 5:48 p.m.