Get a table of differential expression expression statistics with DESeq2
Source:R/02_de_analyses.R
get_deg_list.Rd
Get a table of differential expression expression statistics with DESeq2
Usage
get_deg_list(
se,
coldata_column = "Generation",
parent1 = "P1",
parent2 = "P2",
offspring = "F1",
midparent = "midparent",
lfcThreshold = 0,
alpha = 0.01,
...
)
Arguments
- se
A
SummarizedExperiment
object with a count matrix and sample metadata.- coldata_column
Character indicating the name of column in
colData(se)
where information on the generation are stored. Default: "Generation".- parent1
Character indicating which level of the variable coldata_column represents parent 1. Default: "P1".
- parent2
Character indicating which level of the variable coldata_column represents parent 2. Default: "P2".
- offspring
Character indicating which level of the variable coldata_column represents the offspring (hybrid or allopolyploid). Default: "F1"
- midparent
Character indicating which level of the variable coldata_column represents the midparent value. Default: "midparent", as returned by
add_midparent_expression()
.- lfcThreshold
Numeric indicating the log2 fold-change threshold to use to consider differentially expressed genes. Default: 0.
- alpha
Numeric indicating the adjusted P-value threshold to use to consider differentially expressed genes. Default: 0.01.
- ...
Additional arguments to be passed to
DESeq2::results()
.
Value
A list of data frames with DESeq2's gene-wise tests statistics
for each contrast. Each data frame contains the same columns as the
output of DESeq2::results()
. Contrasts (list names) are:
- P2_vs_P1
Parent 2 (numerator) versus parent 1 (denominator).
- F1_vs_P1
Offspring (numerator) versus parent 1 (denominator).
- F1_vs_P2
Offspring (numerator) versus parent 2 (denominator).
- F1_vs_midparent
Offspring (numerator) versus midparent (denominator).
The data frame with gene-wise test statistics in each list element contains the following variables:
- baseMean
Numeric, base mean.
- log2FoldChange
Numeric, log2-transformed fold changes.
- lfcSE
Numeric, standard error of the log2-transformed fold changes.
- stat
Numeric, observed test statistic.
- pvalue
Numeric, p-value.
- padj
Numeric, P-value adjusted for multiple testing.
The list contains two additional attributes named ngenes (numeric, total number of genes), and plotdata, which is a 3-column data frame with variables "gene" (character, gene ID), "lFC_F1_vs_P1" (numeric, log2 fold change between F1 and P1), and "lFC_F1_vs_P2" (numeric, log2 fold change between F1 and P2).
Examples
data(se_chlamy)
se <- add_midparent_expression(se_chlamy)
se <- add_size_factors(se, spikein = TRUE)
#> converting counts to integer mode
deg_list <- get_deg_list(se)
#> using pre-existing size factors
#> estimating dispersions
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> final dispersion estimates
#> fitting model and testing