celldiff: Find cell type specific differential features from bulk data

View source: R/interaction.R

celldiffR Documentation

Find cell type specific differential features from bulk data

Description

Find cell type specific inter-group differential features from bulk data and cell content information using a regression model containing an interaction term between the sample group and the specific cell type content.

Usage

celldiff(
  cellconts,
  vardat,
  responsedat,
  padjcutoff = NULL,
  pcutoff = NULL,
  gradientcutoff = NULL,
  threads = 1,
  int = TRUE
)

Arguments

cellconts

A matrix recording the cell contents of the samples. Each row is a sample and each column is a cell type. The row names are sample IDs and the column names are cell type names. The deconvolution result from refDeconv and methylpredict can be directly used here.

vardat

A data frame recording the sample group information, and must include 2 columns. One is named as "sampleid", recording the sample IDs same as the row names of cellconts, the other is "Samplegroup", recording the sample group to which each sample belongs. If there are any additional columns in this data frame, they will be deemed as confounding factors when selecting the cell type specific inter-group differential features using a linear regression model.

responsedat

A matrix reconding the feature values of the samples, and each row is a feature and each column is a sample. The column names are sample IDs and the row names are feature names. The cell type specific differential features will be selected from the features in this matrix.

padjcutoff

The adjusted p-value cutoff to select the significantly differential features. Default is NULL, and in this case, the original p-value will be used to select the differential features instead and its cutoff is defined by the parameter pcutoff, but if pcutoff is also NULL, the criterion of adjusted p-value < 0.05 will be used to find the differential features.

pcutoff

If padjcutoff is set as NULL, this parameter will be used to set a cutoff on the original p-value to select the significantly differential features. It default value is also NULL, and in the case that both padjcutoff and pcutoff are NULL, padjcutoff will be set as 0.05 automatically and used to find the differential features.

gradientcutoff

The cutoff on the gradient (i.e. the coefficient of the interaction term in the regression model between a specific cell type content and the sample group, which reflects the group difference on the partial derivative of the feature to the cell content) to find the cell type specific differential features. The default is NULL, and it will be deemed as 0. The cell type specific differential features between sample groups are selected using a regression model containing an interaction term between the sample group and the specific cell type content.

threads

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

int

A logical value indicating whether the cell contents need to be transformed to fit an inverse normal distribution before the differential feature regression model construction, so that the collinearity caused by the interaction term in the model can be reduced. Default is TRUE.

Value

A list with various slots recording the inter-group differential feature selection results for each cell type. Each slot contains a matrix and the feature names, p-values, adjusted p-values, etc, are included. In addition, volcano plots for the differential features for each cell type will also be generated.


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