Intersection of differentially expressed genes

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, or NULL. Names or range of results. If set NULL, include all results per object. When passing in multiple objects, specify the desired results as a list with length matching the number of input objects, containing either character or numeric corresponding to each object.

alphaThreshold

numeric(1) or NULL. Adjusted P value ("alpha") cutoff. If left NULL, will use the cutoff defined in the object.

baseMeanThreshold

numeric(1) or NULL. Base mean (i.e. average expression across all samples) threshold. If left NULL, will use the cutoff defined in the object. Applies in general to DESeq2 RNA-seq differential expression output.

lfcThreshold

numeric(1) or NULL. Log (base 2) fold change ratio cutoff threshold. If left NULL, 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 with i 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.

Note

Updated 2021-03-15.

Examples

data(deseq) ## DESeqAnalysis ==== mat <- degIntersection(deseq, return = "matrix")
#> → Returning intersection matrix of 24 up-regulated DEGs.
class(mat)
#> [1] "matrix" "array"
type(mat)
#> [1] "logical"
head(mat)
#> condition_B_vs_A treatment_D_vs_C #> gene027 TRUE FALSE #> gene028 TRUE FALSE #> gene030 TRUE FALSE #> gene057 TRUE FALSE #> gene109 TRUE FALSE #> gene112 TRUE FALSE
count <- degIntersection(deseq, return = "count")
#> → Returning intersection count of 24 up-regulated DEGs.
class(count)
#> [1] "integer"
head(count)
#> gene027 gene028 gene030 gene057 gene109 gene112 #> 1 1 1 1 1 1
ratio <- degIntersection(deseq, return = "ratio")
#> → Returning intersection ratio of 24 up-regulated DEGs.
class(ratio)
#> [1] "numeric"
head(ratio)
#> gene027 gene028 gene030 gene057 gene109 gene112 #> 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 24 up-regulated DEGs.
class(names)
#> [1] "character"
head(names)
#> character(0)
## DESeqAnalysisList ==== object <- DESeqAnalysisList(list("object1" = deseq, "object2" = deseq)) print(object)
#> DESeqAnalysisList of length 2 #> names(2): object1 object2