Skip to contents

Returns a logical vector indicating whether each gene was simulated to be differentially expressed between two conditions in a SingleCellExperiment generated by the rescueSim package.

Usage

isDEbetweenConditions(sce, condition1, condition2)

Arguments

sce

A SingleCellExperiment object simulated using rescueSim::simRescueData(), with log2 fold change annotations stored in the rowData.

condition1

A character string specifying the first condition. This can be a baseline reference (e.g. "time0", "group0", or "time0_group0") or a condition present in rowData (without the "deLog2FC." prefix).

condition2

A character string specifying the second condition, interpreted the same way as condition1.

Value

A named logical vector indicating whether each gene was simulated to be differentially expressed between condition1 and condition2. Names correspond to gene names.

Details

All log2 fold changes are defined relative to a baseline or reference condition—typically "time0", "group0", or "time0_group0"—and stored in the rowData with column names of the form "deLog2FC.<condition>". Reference conditions are not included in the rowData.

If one of the specified conditions is a reference, the function checks whether the corresponding log2 fold change column is non-zero. If both are non-reference, it checks whether the two log2 fold change columns differ.

This function does not perform a statistical test; it simply reports whether each gene was simulated to be differentially expressed between the two conditions based on the stored simulation parameters.

Examples

# Read in data
 data("RecAM_sce")

 # Calculate sim parameters for first 50 genes
RecAM_sce <- RecAM_sce[1:50,]
RecAM_params<-estRescueSimParams(RecAM_sce, sampleVariable = "sampleID",
subjectVariable = "subjectID", timepointVariable = "time")


# Simulate data
simDat=simRescueData(RecAM_params)

is_de <- isDEbetweenConditions(simDat, "time1", "time0")