Extract expression values, with the possibility to select other assay slots
Arguments
- de_container
An object containing the data for a Differential Expression workflow (e.g.
DESeq2
,edgeR
orlimma
). Currently, this can be aDESeqDataSet
object, normally obtained after running your data through theDESeq2
framework.- gene
Character, specifies the identifier of the feature (gene) to be extracted
- intgroup
A character vector of names in
colData(de_container)
to use for grouping.- assay
Character, specifies with assay of the
de_container
object to use for reading out the expression values. Defaults to "counts".- normalized
Logical value, whether the expression values should be normalized by their size factor. Defaults to TRUE, applies when
assay
is "counts"
Examples
library("macrophage")
library("DESeq2")
library("org.Hs.eg.db")
library("AnnotationDbi")
# dds object
data(gse, package = "macrophage")
dds_macrophage <- DESeqDataSet(gse, design = ~ line + condition)
#> using counts and average transcript lengths from tximeta
rownames(dds_macrophage) <- substr(rownames(dds_macrophage), 1, 15)
keep <- rowSums(counts(dds_macrophage) >= 10) >= 6
dds_macrophage <- dds_macrophage[keep, ]
# dds_macrophage <- DESeq(dds_macrophage)
df_exp <- get_expr_values(
de_container = dds_macrophage,
gene = "ENSG00000125347",
intgroup = "condition"
)
#> using 'avgTxLength' from assays(dds), correcting for library size
head(df_exp)
#> exp_value condition
#> SAMEA103885102 819.3101 naive
#> SAMEA103885347 31872.5798 IFNg
#> SAMEA103885043 17931.2679 SL1344
#> SAMEA103885392 71740.9927 IFNg_SL1344
#> SAMEA103885182 1230.1864 naive
#> SAMEA103885136 41761.1942 IFNg