Differential Expression Analysis using edgeR LRT on pseudobulk data

differential_expression(
  pb_dat,
  formula,
  y_name,
  y_contin,
  coef,
  control,
  pval_adjust_method,
  adj_pval,
  verbose
)

Arguments

pb_dat

A list containing sumDat: matrix of the summed pseudobulk count values annot_pb: dataframe of the annotation data from the SCE rolled up based on the pseudobulk aggregation.

formula

the validated design formula of class type formula. Equation used to fit the model- data for the generalised linear model e.g. ~ sex + pmi + disease.

y_name

the column name in the SCE object for the return variable e.g. "diagnosis" - Case or disease. y can be discrete (logisitc regression) or continuous (linear regression)

y_contin

is the variable being modelled continuous e.g. if case/control then TRUE if level of Tau in AD study then FALSE

coef

character specifying which level to investigate for the differential expression analysis e.g. in a case/control study use "case" if case is the identifier in the y column to get positive fold changes to relate to case samples. leave as default value for continuous y. Default is NULL.

control

character specifying which control level for the differential expression analysis e.g. in a case/control/other study use "control" in the y column to compare against. NOTE only need to specify if more than two groups in y, leave as default value for two groups or continuous y. Default is NULL.

pval_adjust_method

the adjustment method for the p-value in the differential expression analysis. Default is benjamini hochberg "BH". See stats::p.adjust for available options

adj_pval

the adjusted p-value cut-off for the differential expression analysis, 0-1 range

verbose

logical indicating if extra information about the differential expression analysis should be printed

Value

a list containing differential expression data (a dataframe) for each cell type. The dataframe contains: log fold change (logFC), log counts per million (logCPM), log ratio (LR), p-value (PValue), adjusted p-value (adj_pval)