Intersection of differentially expressed genes
Source:R/AllGenerics.R
, R/degIntersection-methods.R
degIntersection.Rd
Intersection of differentially expressed genes
Usage
degIntersection(object, ...)
# S4 method for DESeqAnalysis
degIntersection(
object,
i = NULL,
alphaThreshold = NULL,
baseMeanThreshold = NULL,
lfcThreshold = NULL,
direction = c("up", "down"),
return = c("matrix", "count", "ratio", "names")
)
# S4 method for DESeqAnalysisList
degIntersection(
object,
i = NULL,
alphaThreshold = NULL,
baseMeanThreshold = NULL,
lfcThreshold = NULL,
direction = c("up", "down"),
return = c("matrix", "count", "ratio", "names")
)
# S4 method for DESeqResultsList
degIntersection(
object,
direction = c("up", "down"),
alphaThreshold = NULL,
baseMeanThreshold = NULL,
lfcThreshold = NULL,
return = c("matrix", "count", "ratio", "names")
)
Arguments
- object
Object.
- i
character
,numeric
, orNULL
. Names or range of results. If setNULL
, include all results per object. When passing in multiple objects, specify the desired results as alist
with length matching the number of input objects, containing eithercharacter
ornumeric
corresponding to each object.- alphaThreshold
numeric(1)
orNULL
. Adjusted P value ("alpha") cutoff. If leftNULL
, will use the cutoff defined in the object.- baseMeanThreshold
numeric(1)
orNULL
. Base mean (i.e. average expression across all samples) threshold. If leftNULL
, will use the cutoff defined in the object. Applies in general to DESeq2 RNA-seq differential expression output.- lfcThreshold
numeric(1)
orNULL
. Log (base 2) fold change ratio cutoff threshold. If leftNULL
, will use the cutoff defined in the object.- direction
character(1)
. Include "up" or "down" directions. Must be directional, and intentionally does not support "both".- return
character(1)
."matrix"
:logical matrix
; Intersection matrix."count"
:integer
; Number of times the gene is significant across contrasts."ratio"
:numeric
; The ratio of how many times the gene is significant across contrasts."names"
:character
; Names of genes that intersect across all contrasts defined. Input of specific contrasts withi
argument is recommended here.
- ...
Passthrough arguments to
DESeqResultsList
method.
Value
integer
.
Integer denoting the number of intersections, sorted from highest to
lowest. Gene identifiers are defined as the names.
Examples
data(deseq)
## DESeqAnalysis ====
mat <- degIntersection(deseq, return = "matrix")
#> → Returning intersection matrix of 17 up-regulated DEGs.
print(class(mat))
#> [1] "matrix" "array"
print(head(mat))
#> condition_B_vs_A treatment_D_vs_C
#> gene164 TRUE FALSE
#> gene190 TRUE FALSE
#> gene202 TRUE FALSE
#> gene203 TRUE FALSE
#> gene226 TRUE FALSE
#> gene271 TRUE FALSE
count <- degIntersection(deseq, return = "count")
#> → Returning intersection count of 17 up-regulated DEGs.
print(class(count))
#> [1] "integer"
print(head(count))
#> gene164 gene190 gene202 gene203 gene226 gene271
#> 1 1 1 1 1 1
ratio <- degIntersection(deseq, return = "ratio")
#> → Returning intersection ratio of 17 up-regulated DEGs.
print(class(ratio))
#> [1] "numeric"
print(head(ratio))
#> gene164 gene190 gene202 gene203 gene226 gene271
#> 0.5 0.5 0.5 0.5 0.5 0.5
names <- degIntersection(deseq, i = c(1L, 2L), return = "names")
#> → Returning intersection names of 17 up-regulated DEGs.
print(class(names))
#> [1] "character"
print(head(names))
#> character(0)
## DESeqAnalysisList ====
object <- DESeqAnalysisList(list("object1" = deseq, "object2" = deseq))
print(object)
#> DESeqAnalysisList of length 2
#> names(2): object1 object2