-
Notifications
You must be signed in to change notification settings - Fork 0
/
RDavidQuery.R
35 lines (25 loc) · 1.43 KB
/
RDavidQuery.R
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
# This snippet illustrates how to query David from R, using the Bioconductor RDAVIDWebService package.
# Load RDAVIDWebService.
library("RDAVIDWebService")
# Create a DAVIDWebService object connected to David, using your registration email.
# To register, go to: http://david.abcc.ncifcrf.gov/content.jsp?file=WS.html.
david <- DAVIDWebService$new(email='[email protected]')
# Define foreground and background gene lists.
# The foreground list should be contained within the background list.
FG <- addList(david, myForegroundGenes, idType="REFSEQ_MRNA", listName="isClass", listType="Gene")
BG <- addList(david, myBackgroundGenes, idType="REFSEQ_MRNA", listName="all", listType="Background")
# Inspect FG and BG to see the proportion of genes recognized by David, and those that are unmapped.
FG
BG
# Inspect "david" object to see the gene lists selected as foreground and background.
david
# Specifiy annotation categories.
setAnnotationCategories(david, c("GOTERM_BP_ALL", "GOTERM_MF_ALL", "GOTERM_CC_ALL"))
# Get functional annotation chart as R object.
FuncAnnotChart <- getFunctionalAnnotationChart(david)
# Print functional annotation chart to file.
getFunctionalAnnotationChartFile(david, "FuncAnnotChart.tsv")
# Get functional annotation clustering (limited to 3000 genes).
FuncAnnotClust <- getClusterReport(david)
# Print functional annotation clustering to file (limited to 3000 genes).
getClusterReportFile(david, "FuncAnnotClust.tsv")