subset_by_size: Filter of ontology enrichment results by size

Description Usage Arguments Value Examples

View source: R/subset_by_size_enrichments.R

Description

This utility works to filter results of enrich* test from cluterProfiler-package, DOSE-package or ReactomePA-package

Usage

1
2
3
4
5
6
7
subset_by_size(
  x,
  minObsSize = 0,
  maxObsSize = Inf,
  minSetSize = 0,
  maxSetSize = Inf
)

Arguments

x

is an enrichResults instance

minObsSize

mininum number of genes must be observed per set

maxObsSize

maxinum number of genes must be in the set

minSetSize

mininum number of genes must be in the set

Value

filtered enrichResults isntance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(clusterProfiler)
data(gcSample)
x <- enrichGO(gcSample[[6]], 
              universe = unique(unlist((gcSample))),
              ont = "CC", 
              pvalueCutoff = 1, 
              qvalueCutoff = 1, 
              minGSSize = 0)
res <- summary(x)
res$geneID <- NULL
rownames(res) <- NULL
head(res)
cnetplot(x)

# E.g. the "cell", "cell part" & "cellular_component" seem too generic
x <- subset_by_size(x, maxObsSize=50)
res <- summary(x)
res$geneID <- NULL
rownames(res) <- NULL
# Now they are gone
head(res)
cnetplot(x)

vladpetyuk/vp.misc documentation built on June 25, 2021, 6:35 a.m.