R/differential_expression.R
differential_expression.Rd
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
)
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.
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.
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)
is the variable being modelled continuous e.g. if case/control then TRUE if level of Tau in AD study then FALSE
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.
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.
the adjustment method for the p-value in the differential expression analysis. Default is benjamini hochberg "BH". See stats::p.adjust for available options
the adjusted p-value cut-off for the differential expression analysis, 0-1 range
logical indicating if extra information about the differential expression analysis should be printed
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)