Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/inferAmbience.R

Infer the ambient profile from a filtered HTO count matrix containing only counts for cells.

1 | ```
inferAmbience(x, min.prop = 0.05)
``` |

`x` |
A numeric matrix-like object containing counts for each HTO (row) and cell (column). |

`min.prop` |
Numeric scalar in (0, 1) specifying the expected minimum proportion of barcodes contributed by each sample. |

In some cases, we want to know the ambient profile but we only have the HTO count matrix for the cell-containing libraries.
This can be useful in functions such as `hashedDrops`

or as a reference profile in `medianSizeFactors`

.
However, as we only have the cell-containing libraries, we cannot use `estimateAmbience`

.

This function allows us to obtain the ambient profile under the assumption that each HTO only labels a minority of the cells. Specifically, it will fit a two-component mixture model to each HTO's count distribution. All barcodes assigned to the lower component are considered to have background counts for that HTO, and the mean of those counts is used as an estimate of the ambient contribution.

The initialization of the mixture model is controlled by `min.prop`

,
which starts the means of the lower and upper components at the `min.prop`

and `1-min.prop`

quantiles, respectively.
This means that each sample is expected to contribute somewhere between `[min.prop, 1-min.prop]`

barcodes.
Larger values improve convergence but require stronger assumptions about the relative proportions of multiplexed samples.

A numeric vector of length equal to `nrow(x)`

, containing the estimated ambient proportions for each HTO.

Aaron Lun

`hashedDrops`

, where this function is used in the absence of an ambient profile.

`estimateAmbience`

, which should be used when the raw matrix (prior to filtering for cells) is available.

1 2 3 4 5 6 7 8 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.