Function to assess changes in expression between two groups of cells (mean and over-dispersion)
BASiCS_TestDE(Chain1, Chain2, EpsilonM = log2(1.5), EpsilonD = log2(1.5),
ProbThresholdM = NULL, ProbThresholdD = NULL, OrderVariable = "Prob",
GroupLabel1 = "Group1", GroupLabel2 = "Group2", Plot = TRUE,
PlotOffset = TRUE, Offset = TRUE, EFDR_M = 0.1, EFDR_D = 0.1,
GenesSelect = NULL, ...)Minimum fold change tolerance threshold for detecting
changes in overall expression (must be a positive real number).
Default value: EpsilonM = log2(1.5) (i.e. 50% increase).
Minimum fold change tolerance threshold for detecting
changes in biological over-dispersion (must be a positive real number).
Default value: EpsilonM = log2(1.5) (i.e. 50% increase).
Optional parameter. Probdence threshold for detecting changes in overall expression (must be a positive value, between 0 and 1)
Optional parameter. Probdence threshold for detecting changes in cell-to-cell biological over-dispersion (must be a positive value, between 0 and 1)
Ordering variable for output.
Possible values: 'GeneIndex', 'GeneName' and 'Prob'.
Label assigned to reference group.
Default: GroupLabel1 = 'Group1'
Label assigned to reference group.
Default: GroupLabel2 = 'Group2'
If Plot = TRUE, MA and volcano plots are generated.
If Plot = TRUE, the offset effect is visualised.
Optional argument to remove a fix offset effect (if not
previously removed from the MCMC chains). Default: Offset = TRUE.
Target for expected false discovery rate related to
the comparison of means. Default EFDR_M = 0.10.
Target for expected false discovery rate related to
the comparison of dispersions. Default EFDR_D = 0.10.
Optional argument to provide a user-defined list
of genes to be considered for the comparison.
Default: GenesSelect = NULL. When used, this argument must be a vector
of TRUE (include gene) / FALSE (exclude gene) indicator,
with the same length as the number of intrinsic genes and following the same
order as how genes are displayed in the table of counts.
This argument is necessary in order to have a meaningful EFDR calibration
when the user decides to exclude some genes from the comparison.
Graphical parameters (see par).
BASiCS_TestDE returns a list of 4 elements:
TableMeanA data.frame containing the
results of the differential mean test
GeneNameGene name
MeanOverallFor each gene, the estimated mean expression parameter \(\mu_i\) is averaged across both groups of cells (weighted by sample size).
Mean1Estimated mean expression parameter \(\mu_i\) for each biological gene in the first group of cells.
Mean2Estimated mean expression parameter \(\mu_i\) for each biological gene in the second group of cells.
MeanFCFold change in mean expression parameters between the first and second groups of cells.
MeanLog2FCLog2-transformed fold change in mean expression between the first and second groups of cells.
ProbDiffMeanPosterior probability for mean expression difference between the first and second groups of cells.
ResultDiffExpIndicator if a gene has a higher mean expression in the first or second groups of cells.
TableDispA data.frame containing the
results of the differential dispersion test (excludes genes for which
the mean does not changes).
GeneNameGene name
MeanOverallFor each gene, the estimated mean expression parameter \(\mu_i\) is averaged across both groups of cells (weighted by sample size).
DispOverallFor each gene, the estimated over-dispersion parameter \(\delta_i\) is averaged across both groups of cells (weighted by sample size).
Disp1Estimated over-dispersion parameter \(\delta_i\) for each biological gene in the first group of cells.
Disp2Estimated over-dispersion parameter \(\delta_i\) for each biological gene in the second group of cells.
DispFCFold change in over-dispersion parameters between the between the first and second groups of cells.
DispLog2FCLog-transformed fold change in over-dispersion between the first and second groups of cells.
ProbDiffDispPosterior probability for over-dispersion difference between the first and second groups of cells.
ResultDiffDispIndicator if a gene has a higher over-dispersion in the first or second groups of cells.
DiffExpSummaryA list containing the following information for the differential mean expression test:
ProbThresholdPosterior probability threshold.
EFDRExpected false discovery rate for the given thresholds.
EFNRExpected false negative rate for the given thresholds.
DiffOverDispSummaryA list containing the following information for the differential over-dispersion test:
ProbThresholdPosterior probability threshold.
EFDRExpected false discovery rate for the given thresholds.
EFNRExpected false negative rate for the given thresholds.
Chain1_offsetan BASiCS_Chain object:
Chain1 after offset removal.
Chain2_offsetan BASiCS_Chain object:
Chain2 after offset removal (this is only provided for
completeness; Chain2 is not affected by the offset).
OffsetChainMCMC chain calculated for the offset effect.
OffsetEstimated offset (posterior median of
OffsetChain). Default value set equal to 1 when offset
correction is not performed.
Vallejos, Richardson and Marioni (2016). Genome Biology.
# NOT RUN {
# Loading two 'BASiCS_Chain' objects (obtained using 'BASiCS_MCMC')
data(ChainSC)
data(ChainRNA)
Test <- BASiCS_TestDE(Chain1 = ChainSC, Chain2 = ChainRNA,
GroupLabel1 = 'SC', GroupLabel2 = 'P&S',
EpsilonM = log2(1.5), EpsilonD = log2(1.5),
OffSet = TRUE)
# Results for the differential mean test
head(Test$TableMean)
# Results for the differential over-dispersion test
# This only includes genes marked as 'NoDiff' in Test$TableMean
head(Test$TableDisp)
# }
Run the code above in your browser using DataLab