assignCellType: Align cell types when reference proportions are known

View source: R/assignCellType.R

assignCellTypeR Documentation

Align cell types when reference proportions are known

Description

Align target proportions with reference proportions by pearson correlation coefficients.

Usage

assignCellType(input,reference)

Arguments

input

Input proportiona matrix of dimension N by K.

reference

Reference proportion matrix of dimension N by K.

Value

The aligned proportion matrix, following the cell type ordering of reference proportion matrix.

Author(s)

Ziyi Li <zli16@mdanderson.org>

References

Ziyi Li, Zhijin Wu, Peng Jin, Hao Wu. "Dissecting differential signals in high-throughput data from complex tissues."

Examples


## generate estimated proportion matrix
estProp <- matrix(abs(runif(50*4,0,1)), 50, 4)
estProp <- sweep(estProp, 1, rowSums(estProp), "/")

## generate reference proportion matrix
refProp <- matrix(abs(runif(50*4,0,1)), 50, 4)
refProp <- sweep(refProp, 1, rowSums(refProp), "/")

estProp_aligned = assignCellType(input = estProp,
reference = refProp)


ziyili20/TOAST documentation built on Aug. 28, 2022, 11:28 a.m.