shake_enrichResult {GeneTonic} | R Documentation

## Convert an enrichResult object

### Description

Convert an enrichResult object for straightforward use in `GeneTonic()`

### Usage

    shake_enrichResult(obj)

### Arguments

`obj` | An `enrichResult` object, obtained via `clusterProfiler` (or also via `reactomePA`)

### Details

This function is able to handle the output of `clusterProfiler` and `reactomePA`, as they both return an object of class `enrichResult` - and this in turn contains the information required to create correctly a `res_enrich` object.

### Value

A `data.frame` compatible for use in `GeneTonic()` as `res_enrich`

### See Also

Other shakers: `shake_davidResult()`, `shake_enrichrResult()`, `shake_fgseaResult()`, `shake_gprofilerResult()`, `shake_topGOtableResult()`

### Examples

    # dds
    library("macrophage")
    library("DESeq2")
    data(gse)
    dds_macrophage <- DESeqDataSet(gse, design = ~ line + condition)
    rownames(dds_macrophage) <- substr(rownames(dds_macrophage), 1, 15)

    # res object
    data(res_de_macrophage, package = "GeneTonic")
    res_de <- res_macrophage_IFNg_vs_naive
    de_symbols_IFNg_vs_naive <- res_macrophage_IFNg_vs_naive[
      (!(is.na(res_macrophage_IFNg_vs_naive$padj))) &
        (res_macrophage_IFNg_vs_naive$padj <= 0.05), "SYMBOL"
    ]
    bg_ids <- rowData(dds_macrophage)$SYMBOL[rowSums(counts(dds_macrophage)) > 0]
    ## Not run:
    library("clusterProfiler")
    library("org.Hs.eg.db")
    ego_IFNg_vs_naive <- enrichGO(
      gene = de_symbols_IFNg_vs_naive,
      universe = bg_ids,
      keyType = "SYMBOL",
      OrgDb = org.Hs.eg.db,
      ont = "BP",
      pAdjustMethod = "BH",
      pvalueCutoff = 0.01,
      qvalueCutoff = 0.05,
      readable = FALSE
    )

    res_enrich <- shake_enrichResult(ego_IFNg_vs_naive)
    head(res_enrich)

    ## End(Not run)

[Package GeneTonic version 1.4.1 Index]