vignettes/Functional_Enrichment_Analysis.R

## ------------------------------------------------------------------------
library(CopTea)
options(scipen=0)

## ------------------------------------------------------------------------
load("GO_BP_300.RData")

## ------------------------------------------------------------------------
dim(annotation)

## ------------------------------------------------------------------------
load("PPI.RData")	

## ------------------------------------------------------------------------
dim(adj_matrix)

## ------------------------------------------------------------------------
load("active_gene.RData")

## ------------------------------------------------------------------------
True_Categories <- c("GO:0019614", "GO:1903249", "GO:2000506", "GO:0015985", "GO:0071962")

## ------------------------------------------------------------------------
Enriched_Categories <- netgen(annotation, adj_matrix, active_gene,
                              p1 = 0.8, p2 = 0.1, q = 0.001, alpha = 5, trace=TRUE)

## ------------------------------------------------------------------------
Enriched_Categories

## ------------------------------------------------------------------------
setdiff(True_Categories, Enriched_Categories[,1])

## ------------------------------------------------------------------------
p1 <- c(0.5, 0.8)
p2 <- c(0.1, 0.3)
q  <- 0.001
Enriched_Categories <- netgen(annotation, adj_matrix, active_gene,
                              p1, p2, q, alpha = 3, trace=FALSE)

## ------------------------------------------------------------------------
Enriched_Categories$Term_combined_pvalue

## ------------------------------------------------------------------------
Enriched_Categories$mix_result[which.min(Enriched_Categories$Term_combined_pvalue)]

## ------------------------------------------------------------------------
library(CopTea)
options(scipen=0)

## ------------------------------------------------------------------------
load("GO_BP_300.RData")
load("active_gene.RData")

## ------------------------------------------------------------------------
True_Categories <- c("GO:0019614", "GO:1903249", "GO:2000506", "GO:0015985", "GO:0071962")

## ------------------------------------------------------------------------
sum(active_gene %in% rownames(annotation))

## ------------------------------------------------------------------------
Enrich_result <- CEA(annotation, active_gene, d = 0, times = 5, trace = TRUE)

## ------------------------------------------------------------------------
names(Enrich_result)

## ------------------------------------------------------------------------
Enrich_result$category[1:5]

## ------------------------------------------------------------------------
Enrich_result$p.values[1:5]
Enrich_result$coverage[1:5]

## ------------------------------------------------------------------------
setdiff(True_Categories, Enrich_result$category[[1]])

## ------------------------------------------------------------------------
Enrich_result <- CEA(annotation, active_gene, d = 1, times = 500, trace = FALSE)

## ------------------------------------------------------------------------
Enrich_result$p.values[1]
wulingyun/CopTea documentation built on Dec. 4, 2019, 2:59 p.m.