QPtransform: Quantile matching and power transformation

QPtransformR Documentation

Quantile matching and power transformation

Description

This function implements the preprocessing strategy discussed in Nguyen et al. (2020). We recommend this transformation when applying the PCzinb algorithm to real dataset.

Usage

QPtransform(x, ...)

## S4 method for signature 'SummarizedExperiment'
QPtransform(x, assay_from = "counts", assay_to = "processed", ...)

## S4 method for signature 'matrix'
QPtransform(x)

Arguments

x

the matrix of counts (n times p) or a SummarizedExperiment containing such matrix (transposed).

...

Additional arguments (currently not used).

assay_from

The assay with the input count data.

assay_to

The assay in which to store the processed data.

Details

Briefly, the transformation consists of two steps: (i) matching of the 95 percentile across cells to account for sequencing depth; (ii) adjusting the data to be closer to a zinb distribution by using a power transformation X^\alpha, where \alpha \in [0,1] is chosen to minimize the Kolmogorov-Smirnov statistic.

Value

if x is a matrix, a matrix with the processed data; if x is a SummarizedExperiment, a SummarizedExperiment object with the processed matrix as an additional assay.

References

Nguyen, T. K. H., Berge, K. V. D., Chiogna, M., & Risso, D. (2020). Structure learning for zero-inflated counts, with an application to single-cell RNA sequencing data. arXiv:2011.12044.

Examples

library(SummarizedExperiment)
se <- SummarizedExperiment(assays=list(counts=matrix(rpois(50, 5), ncol=10)))
suppressWarnings(se <- QPtransform(se))
se
mat <- matrix(rpois(50, 5), nrow=10)
suppressWarnings(QPtransform(mat))

drisso/learn2count documentation built on July 15, 2024, 11:13 p.m.