refDeconv: Deconvolve cell contents using reference from the same omics

View source: R/scdeconv.R

refDeconvR Documentation

Deconvolve cell contents using reference from the same omics

Description

Deconvolve cell contents using reference from the same omics.

Usage

refDeconv(
  ref,
  targetdat,
  targetlogged = FALSE,
  resscale = FALSE,
  plot = FALSE,
  pddat = NULL,
  threads = 1
)

Arguments

ref

The reference matrix recording the signature of each cell type. Each row represents one feature, and each column is one cell type. Each entry should be a non-log transformed value, such as TPM value for RNA data, and beta value for DNA methylation data. Column names are cell type names and row names are feature names.

targetdat

The target cell mixture data need to be deconvolved. Should be a matrix with each column representing one sample and each row for one feature. Row names are feature names and column names are sample IDs. If the reference matrix is generated with the function scRef, and both the scRNA-seq and the target cell mixture data were transferred to it, the result reference matrix can be transferred to ref and the adjusted target data returned by scRef can be transferred to this parameter.

targetlogged

Whether the feature values in targetdat are log2 transformed values or not.

resscale

For each sample, whether its cell contents result should be scaled so that the sum of different cell types is 1. Default is FALSE.

plot

Whether generate a box plot and heatmaps for the cell contents deconvolved. Default is FALSE.

pddat

If set plot as TRUE, this parameter can be used to show the sample group information, so that the box plot generated will also compare the group difference for each cell type, and heatmaps with this comparison will also be generated. It should be a data frame recording the sample groups, and must include 2 columns. One is named as "sampleid", recording the sample IDs same as the column names of targetdat, the other is "Samplegroup", recording the sample group to which each sample belongs. It can also be NULL, meaning all the samples are from the same group, and in this case, only a box plot showing the cell content for each cell type will be made when plot is set as TRUE.

threads

Number of threads need to be used to do the computation. Its default value is 1.

Value

A matrix recording the cell composition result for the samples.


yuabrahamliu/scDeconv documentation built on March 28, 2024, 3:15 p.m.