merge_enrich_terms-methods: Merge enriched GO terms.

Description Usage Arguments Details Value References See Also Examples

Description

combine results from GO enrichment tests (obtained with topGO package) or from fgsea (obtained with runfgsea method), for a given ontology (MF, BP, or CC).

Usage

1
2
3
4
merge_enrich_terms(Input, cutoff = 0.01, envir = .GlobalEnv)

## S4 method for signature 'list'
merge_enrich_terms(Input, cutoff = 0.01, envir = .GlobalEnv)

Arguments

Input

a list containing named elements. Each element must contain the name of:

  • topGO: topGOdata-class object created by create_topGOdata method and the associated topGOresult-class object.

  • fgsea: fgsea-class object created by runfgsea method.

cutoff

default pvalue cutoff (default to 0.01). Several cutoff can be use in the same order as list elements.

envir

objects environment (default to .GlobalEnv).

Details

This method extracts for each result of GO enrichment test: informations about GO term (identifiant, name, and description), gene frequency (number of significant genes / Annotated genes), pvalue, -log10(pvalue), significant genes identifiants (GeneID, or Ensembl ID, or uniprot accession), and gene symbols. At the last, this method builds a merged data.table of enriched GO terms at least once and provides all mentionned columns.

Value

an enrich_GO_terms-class object.

References

Matt Dowle and Arun Srinivasan (2017). data.table: Extension of data.frame. R package version 1.10.4. https://CRAN.R-project.org/package=data.table

Herve Pages, Marc Carlson, Seth Falcon and Nianhua Li (2017). AnnotationDbi: Annotation Database Interface. R package version 1.38.0.

See Also

Other GO_terms: GOcount(), GOterms_heatmap(), annotate(), create_topGOdata(), gene2GO-class, runfgsea()

Examples

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
## topGO terms enrichment

# load genes identifiants (GeneID,ENS...) universe/background (Expressed genes)
background_L<-scan(
    system.file(
        "extdata/data/input",
        "background_L.txt",
        package = "ViSEAGO"
    ),
    quiet=TRUE,
    what=""
)

# load Differentialy Expressed (DE) gene identifiants from files
PregnantvslactateDE<-scan(
    system.file(
        "extdata/data/input",
        "pregnantvslactateDE.txt",
        package = "ViSEAGO"
    ),
    quiet=TRUE,
    what=""
)

VirginvslactateDE<-scan(
    system.file(
        "extdata/data/input",
        "virginvslactateDE.txt",
        package = "ViSEAGO"
    ),
    quiet=TRUE,
    what=""
)

VirginvspregnantDE<-scan(
    system.file(
        "extdata/data/input",
        "virginvspregnantDE.txt",
        package="ViSEAGO"
    ),
    quiet=TRUE,
    what=""
)

## Not run: 
# connect to Bioconductor
Bioconductor<-ViSEAGO::Bioconductor2GO()

# load GO annotations from Bioconductor
myGENE2GO<-ViSEAGO::annotate(
    "org.Mm.eg.db",
    Bioconductor
)

# create topGOdata for BP for each list of DE genes
BP_Pregnantvslactate<-ViSEAGO::create_topGOdata(
    geneSel=PregnantvslactateDE,
    allGenes=background_L,
    gene2GO=myGENE2GO,
    ont="BP",
    nodeSize=5
)

BP_Virginvslactate<-ViSEAGO::create_topGOdata(
    geneSel=VirginvslactateDE,
    allGenes=background_L,
    gene2GO=myGENE2GO,
    ont="BP",
    nodeSize=5
)

BP_Virginvspregnant<-ViSEAGO::create_topGOdata(
    geneSel=VirginvspregnantDE,
    allGenes=background_L,
    gene2GO=myGENE2GO,
    ont="BP",
    nodeSize=5
)

# perform TopGO tests
elim_BP_Pregnantvslactate<-topGO::runTest(
    BP_L_pregnantvslactate,
    algorithm ="elim",
    statistic = "fisher"
)

elim_BP_Virginvslactate<-topGO::runTest(
    BP_L_virginvslactate,
    algorithm ="elim",
    statistic = "fisher"
)

elim_BP_Virginvspregnant<-topGO::runTest(
    BP_L_virginvspregnant,
    algorithm ="elim",
    statistic = "fisher"
)

# merge topGO results
BP_sResults<-ViSEAGO::merge_enrich_terms(
    Input=list(
        Pregnantvslactate=c("BP_Pregnantvslactate","elim_BP_Pregnantvslactate"),
        Virginvslactate=c("BP_Virginvslactate","elim_BP_Virginvslactate"),
        Virginvspregnant=c("BP_Virginvspregnant","elim_BP_Virginvspregnant")
    )
)

## End(Not run)

## fgsea analysis

# load gene identifiants and padj test results from Differential Analysis complete tables
PregnantvsLactate<-data.table::fread(
    system.file(
        "extdata/data/input",
        "pregnantvslactate.complete.txt",
        package = "ViSEAGO"
    ),
    select = c("Id","padj")
)

VirginvsLactate<-data.table::fread(
    system.file(
        "extdata/data/input",
        "virginvslactate.complete.txt",
        package = "ViSEAGO"
   ),
   select = c("Id","padj")
)

VirginvsPregnant<-data.table::fread(
    system.file(
       "extdata/data/input",
       "virginvspregnant.complete.txt",
        package = "ViSEAGO"
    ),
    select = c("Id","padj")
)

# rank Id based on statistical value (padj)
PregnantvsLactate<-data.table::setorder(PregnantvsLactate,padj)

VirginvsLactate<-data.table::setorder(VirginvsLactate,padj)

VirginvsPregnant<-data.table::setorder(VirginvsPregnant,padj)

## Not run: 
# connect to Bioconductor
Bioconductor<-ViSEAGO::Bioconductor2GO()

# load GO annotations from Bioconductor
myGENE2GO<-ViSEAGO::annotate(
    "org.Mm.eg.db",
    Bioconductor
)

# perform fgseaMultilevel tests
BP_PregnantvsLactate<-runfgsea(
    geneSel=PregnantvsLactate,
    gene2GO=myGENE2GO, 
    ont="BP",
    params = list(
        scoreType = "pos",
        minSize=5
    )
)

BP_VirginvsLactate<-runfgsea(
    geneSel=VirginvsLactate,
    gene2GO=myGENE2GO, 
    ont="BP",
    params = list(
        scoreType = "pos",
        minSize=5
    )
)

BP_VirginvsPregnant<-runfgsea(
    geneSel=VirginvsPregnant,
    gene2GO=myGENE2GO, 
    ont="BP",
    params = list(
        scoreType = "pos",
        minSize=5
    )
)

# merge fgsea results
BP_sResults<-merge_enrich_terms(
    cutoff=0.01,
    Input=list(
        PregnantvsLactate="BP_PregnantvsLactate",
        VirginvsLactate="BP_VirginvsLactate",
        VirginvsPregnant="BP_VirginvsPregnant"
    )
)

## End(Not run)

ViSEAGO documentation built on Nov. 8, 2020, 6:51 p.m.