assignCellType: Align cell types when reference proportions are known

Description Usage Arguments Value Author(s) References Examples

View source: R/assignCellType.R

Description

Align target proportions with reference proportions by pearson correlation coefficients.

Usage

1
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 <ziyi.li@emory.edu>

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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)

TOAST documentation built on Nov. 8, 2020, 5:55 p.m.