Identify Genes Simulated to Be Differentially Expressed Between Conditions
Source:R/runPowerAnalysis.R
isDEbetweenConditions.Rd
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.
Arguments
- sce
A
SingleCellExperiment
object simulated usingrescueSim::simRescueData()
, with log2 fold change annotations stored in therowData
.- 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 inrowData
(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")