{
##Load the Gene Functional Classification Tool file report for the
##input demo list 1 file to create a DAVIDGeneCluster object.
setwd(tempdir())
fileName<-system.file("files/geneClusterReport1.tab.tar.gz",
package="RDAVIDWebService")
untar(fileName)
davidGeneCluster1<-DAVIDGeneCluster(untar(fileName, list=TRUE))
davidGeneCluster1
##Now we can invoke DAVIDCluster ancestor functions to inspect the report
##data, of each cluster. For example, we can call summary to get a general
##idea, and the inspect the cluster with higher Enrichment Score, to see
##which members belong to it, etc. Or simply returning the whole cluster as
##a list with EnrichmentScore and Members.
summary(davidGeneCluster1)
higherEnrichment<-which.max(enrichment(davidGeneCluster1))
clusterGenes<-members(davidGeneCluster1)[[higherEnrichment]]
wholeCluster<-cluster(davidGeneCluster1)[[higherEnrichment]]
##Then, we can obtain the ids of the members calling clusterGenes object
##which is a DAVIDGenes class or directly using ids on davidGeneCluster1.
ids(clusterGenes)
ids(davidGeneCluster1)[[higherEnrichment]]
##Obtain the genes of the first cluster using davidGeneCluster1 object.
##Or, using genes on DAVIDGenes class once we get the members of the cluster.
genes(davidGeneCluster1)[[1]]
genes(members(davidGeneCluster1)[[1]])
##Finally, we can inspect a 2D tile membership plot, to visually inspect for
##overlapping of genes across the clusters. Or use a scaled version of gene
##names to see the association of gene cluster, e.g., cluster 3 is related to
##ATP genes.
plot2D(davidGeneCluster1)
plot2D(davidGeneCluster1,names=TRUE)+
theme(axis.text.y=element_text(size=rel(0.9)))
}
Run the code above in your browser using DataLab