
Last chance! 50% off unlimited learning
Sale ends in
dcRWRpredict
is supposed to perform ontology term predictions
based on Random Walk with Restart (RWR) from input known annotations
and an input graph.
dcRWRpredict(data, g, output.file = NULL, ontology = c(NA, "GOBP",
"GOMF",
"GOCC", "DO", "HPPA", "HPMI", "HPON", "MP", "EC", "KW", "UP"),
method = c("indirect", "direct"), normalise = c("laplacian", "row",
"column", "none"), restart = 0.75, normalise.affinity.matrix =
c("none",
"quantile"), leave.one.out = T, propagation = c("max", "sum"),
scale.method = c("log", "linear", "none"), parallel = TRUE,
multicores = NULL, verbose = T, RData.ontology.customised = NULL,
RData.location =
"https://github.com/hfang-bristol/RDataCentre/blob/master/dcGOR")
Dnetwork
RData.ontology.customised
below)source("http://bioconductor.org/biocLite.R");
biocLite(c("foreach","doMC"))
. If not yet installed, this option will
be disableddcBuildOnto
for
how to creat this objectdcRDataLoader
for detailsdcRDataLoader
, dcAlgoPropagate
,
dcList2Matrix
## Not run:
# # 1) define an input network
# ## 1a) an igraph object that contains a functional protein association network in human.
# ### The network is extracted from the STRING database (version 9.1).
# ### Only those associations with medium confidence (score>=400) are retained
# org.Hs.string <- dnet::dRDataLoader(RData='org.Hs.string')
# ## 1b) restrict to those edges with confidence score>=999
# ### keep the largest connected component
# network <- igraph::subgraph.edges(org.Hs.string,
# eids=E(org.Hs.string)[combined_score>=999])
# g <- dnet::dNetInduce(g=network, nodes_query=V(network)$name,
# largest.comp=TRUE)
# ## Notably, in reality, 1b) can be replaced by:
# #g <- igraph::subgraph.edges(org.Hs.string, eids=E(org.Hs.string)[combined_score>=400])
# ## 1c) make sure there is a 'weight' edge attribute
# E(g)$weight <- E(g)$combined_score
# ### use EntrezGene ID as default 'name' node attribute
# V(g)$name <- V(g)$geneid
# g
#
# # 2) define the known annotations as seeds
# anno.file <- "http://dcgor.r-forge.r-project.org/data/Algo/HP_anno.txt"
# data <- dcSparseMatrix(anno.file)
#
# # 3) perform RWR-based ontology term predictions
# res <- dcRWRpredict(data=data, g=g, ontology="HPPA", parallel=FALSE)
# res[1:10,]
# # 4) calculate Precision and Recall
# GSP.file <- anno.file
# prediction.file <- res
# res_PR <- dcAlgoPredictPR(GSP.file=GSP.file,
# prediction.file=prediction.file, ontology="HPPA")
# res_PR
#
# # 5) Plot PR-curve
# plot(res_PR[,2], res_PR[,1], xlim=c(0,1), ylim=c(0,1), type="b",
# xlab="Recall", ylab="Precision")
# ## End(Not run)
Run the code above in your browser using DataLab