Given a glmFit model, performs log ratio tests using edgeR function glmLRT and returns the genes that are differentially expressed between the reference and perturbation conditions. log ratios are expressed as log(perturbation/reference)

estimateDEGs(fit, reference, perturbation, p.value = 1, lfc = 0)

Arguments

fit

edgeR glmFit

reference

condition (or a vector of conditions) being considered as the reference for differential analysis. It should corresponds to a condition name, e.g. the string before the underscore and replicate number in your sample names.

perturbation

condition (or a vector of conditions) to compare to the reference for differential analysis. It should corresponds to a condition name, e.g. the string before the underscore and replicate number in your sample names.

p.value

numeric cutoff value for adjusted p-values. Only tags with adjusted p-values equal or lower than specified are returned

lfc

minimal absolute log fold change required for a gene to be considered as differentially expressed.

Value

topTags object, which table element contains DEGs dataframe.

Examples

data("abiotic_stresses")
tcc_object <- DIANE::normalize(abiotic_stresses$raw_counts, 
abiotic_stresses$conditions, iteration = FALSE)
threshold = 10*length(abiotic_stresses$conditions)
tcc_object <- DIANE::filter_low_counts(tcc_object, threshold)
fit <- DIANE::estimateDispersion(tcc = tcc_object, 
conditions = abiotic_stresses$conditions)
topTags <- DIANE::estimateDEGs(fit, reference = "C", perturbation = "H", p.value = 0.01)
DEGs <- topTags$table
head(DEGs)
#>                   genes    logFC   logCPM       LR        PValue           FDR
#> AT4G12400.2 AT4G12400.2 7.756985 7.564179 2272.130  0.000000e+00  0.000000e+00
#> AT5G48570.1 AT5G48570.1 7.067740 8.853736 1970.131  0.000000e+00  0.000000e+00
#> AT5G12110.1 AT5G12110.1 5.939006 7.952267 2202.123  0.000000e+00  0.000000e+00
#> AT5G64510.1 AT5G64510.1 5.879518 6.067228 2228.044  0.000000e+00  0.000000e+00
#> AT2G19310.1 AT2G19310.1 4.212070 7.686615 1389.691 3.651876e-304 1.406410e-300
#> AT2G29500.1 AT2G29500.1 7.731411 9.482692 1260.703 3.919280e-276 1.257828e-272

# For multiple conditions
topTags <- DIANE::estimateDEGs(fit, reference = "C", perturbation = c("H","M","S"), p.value = 0.01)
DEGs <- topTags$table
head(DEGs)
#>                   genes    logFC   logCPM       LR        PValue           FDR
#> AT5G48570.1 AT5G48570.1 2.944751 8.853736 494.1928 1.743902e-109 2.257907e-105
#> AT5G12110.1 AT5G12110.1 2.448426 7.952267 493.6015 2.345147e-109 2.257907e-105
#> AT5G64510.1 AT5G64510.1 2.489493 6.067228 337.1602  2.650524e-75  1.701283e-71
#> AT4G12400.2 AT4G12400.2 3.016083 7.564179 328.7910  1.762388e-73  8.484134e-70
#> AT2G19310.1 AT2G19310.1 1.661515 7.686615 304.9245  2.785603e-68  1.072791e-64
#> AT1G07350.1 AT1G07350.1 1.396260 7.417268 265.3094  1.194669e-59  3.834092e-56