Conduct Functional Enrichment Analysis.

ConductFE(
  deres,
  out.folder = NULL,
  data.type = c("RNA", "ChIP", "ATAC"),
  peak.anno.key = c("Promoter", "5' UTR", "3' UTR", "Exon", "Intron", "Downstream",
    "Distal Intergenic", "All"),
  signif = "padj",
  signif.threshold = 0.05,
  l2fc.threshold = 1,
  gene.key = NULL,
  gene.type = c("ENSEMBL", "ENTREZID", "SYMBOL"),
  org.db = "org.Mm.eg.db",
  enrich.type = c("ALL", "GO", "KEGG"),
  go.type = c("ALL", "BP", "MF", "CC"),
  enrich.pvalue = 0.05,
  enrich.qvalue = 0.05,
  organism = "mmu",
  padj.method = c("BH", "holm", "hochberg", "hommel", "bonferroni", "BY", "fdr",
    "none"),
  show.term = 15,
  str.width = 30,
  plot.resolution = 300,
  plot.width = 7,
  plot.height = 9,
  save = TRUE
)

Arguments

deres

Data frame contains all genes.

out.folder

Folder to save enrichment results. Default: wording directory.

data.type

Input data type, choose from RNA, ChIP, ATAC. Default: RNA.

peak.anno.key

Peak location, chosen from "Promoter", "5' UTR", "3' UTR", "Exon", "Intron", "Downstream", "Distal Intergenic","All". Default: "Promoter".

signif

Significance criterion. For DESeq2 results, can be chosen from padj, pvalue. For edgeR results, can be chosen from FDR, PValue. Default: padj.

signif.threshold

Significance threshold to get differentially expressed genes or accessible/binding peaks. Default: 0.05.

l2fc.threshold

Log2 fold change threshold to get differentially expressed genes or accessible/binding peaks. Default: 1.

gene.key

Column name in deres to conduct analysis. Default: NULL (use rownames of deres).

gene.type

Gene name type. Chosen from ENSEMBL, ENTREZID,SYMBOL. Default: ENSEMBL.

org.db

Organism database. Default: org.Mm.eg.db.

enrich.type

Enrichment type, chosen from ALL, GO, KEGG. Default: ALL.

go.type

GO enrichment type, chosen from ALL, BP, MF, CC. Default: ALL.

enrich.pvalue

Cutoff value of pvalue. Default: 0.05.

enrich.qvalue

Cutoff value of qvalue. Default: 0.05.

organism

Supported organism listed in 'http://www.genome.jp/kegg/catalog/org_list.html'. Default: mmu.

padj.method

One of "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none". Default: BH.

show.term

Number of enrichment term to show. Default: 15.

str.width

Length of enrichment term in plot. Default: 30.

plot.resolution

Resolution of plot. Default: 300.

plot.width

The width of plot. Default: 7.

plot.height

The height of plot. Default: 9.

save

Logical value, whether to save all results. Default: TRUE.

Value

If save is TRUE, return NULL (all results are in out.folder), else retutn list contains all results.

Examples

#> 载入需要的程辑包:SummarizedExperiment
#> 载入需要的程辑包:MatrixGenerics
#> 载入需要的程辑包:matrixStats
#> #> 载入程辑包:‘matrixStats’
#> The following objects are masked from ‘package:Biobase’: #> #> anyMissing, rowMedians
#> #> 载入程辑包:‘MatrixGenerics’
#> The following objects are masked from ‘package:matrixStats’: #> #> colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse, #> colCounts, colCummaxs, colCummins, colCumprods, colCumsums, #> colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs, #> colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats, #> colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds, #> colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads, #> colWeightedMeans, colWeightedMedians, colWeightedSds, #> colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet, #> rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods, #> rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps, #> rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins, #> rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks, #> rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars, #> rowWeightedMads, rowWeightedMeans, rowWeightedMedians, #> rowWeightedSds, rowWeightedVars
#> The following object is masked from ‘package:Biobase’: #> #> rowMedians
library(DEbPeak) count.file <- system.file("extdata", "snon_count.txt", package = "DEbPeak") meta.file <- system.file("extdata", "snon_meta.txt", package = "DEbPeak") count.matrix <- read.table(file = count.file, header = TRUE, sep = "\t") meta.info <- read.table(file = meta.file, header = TRUE) dds <- DESeq2::DESeqDataSetFromMatrix(countData = count.matrix, colData = meta.info, design = ~condition)
#> Warning: some variables in design formula are characters, converting to factors
keep.genes <- rowSums(DESeq2::counts(dds, normalized = FALSE)) >= 10 dds <- dds[keep.genes, ] dds$condition <- relevel(dds$condition, ref = "WT") dds <- DESeq(dds)
#> estimating size factors
#> estimating dispersions
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> final dispersion estimates
#> fitting model and testing
dds.results <- results(dds, contrast = c("condition", "KO", "WT")) dds.results.ordered <- dds.results[order(dds.results$log2FoldChange, decreasing = TRUE), ] ConductFE(deres = dds.results.ordered, signif = "pvalue", l2fc.threshold = 0.3)
#> Differential expression analysis with DESeq2!
#> Convert ENSEMBL to ENTREZID!
#> 'select()' returned 1:many mapping between keys and columns
#> Warning: 25.28% of input gene IDs are fail to map...
#> conduct ALL GO enrichment analysis on: UP
#> conduct KEGG enrichment analysis: UP
#> Reading KEGG annotation online: "https://rest.kegg.jp/link/mmu/pathway"...
#> Reading KEGG annotation online: "https://rest.kegg.jp/list/pathway/mmu"...
#> wrong orderBy parameter; set to default `orderBy = "x"`
#> Scale for y is already present. #> Adding another scale for y, which will replace the existing scale.
#> wrong orderBy parameter; set to default `orderBy = "x"`
#> Scale for y is already present. #> Adding another scale for y, which will replace the existing scale.
#> wrong orderBy parameter; set to default `orderBy = "x"`
#> Scale for y is already present. #> Adding another scale for y, which will replace the existing scale.
#> wrong orderBy parameter; set to default `orderBy = "x"`
#> Scale for y is already present. #> Adding another scale for y, which will replace the existing scale.
#> Convert ENSEMBL to ENTREZID!
#> 'select()' returned 1:1 mapping between keys and columns
#> Warning: 18.04% of input gene IDs are fail to map...
#> conduct ALL GO enrichment analysis on: DOWN
#> conduct KEGG enrichment analysis: DOWN
#> NULL