# NOT RUN {
# Load the XGR package and specify the location of built-in data
library(XGR)
RData.location <- "http://galahad.well.ox.ac.uk/bigdata/"
# a) provide the input nodes/genes with the significance info
## load human genes
org.Hs.eg <- xRDataLoader(RData='org.Hs.eg',
RData.location=RData.location)
sig <- rbeta(500, shape1=0.5, shape2=1)
data <- data.frame(symbols=org.Hs.eg$gene_info$Symbol[1:500], sig)
# b) find a series of maximum-scoring subnets with the desired node number=50
isubg <- xSubneterGenesAdv(data=data, network="STRING_high",
subnet.size=50, RData.location=RData.location)
# c) represent a series of subnets as a minimum spanning tree
mst <- xSubneterGenesMST(isubg)
mst$summary
head(mst$detail)
head(mst$matrix)
gp_mst <- xGGnetwork(mst, node.label='name', node.label.size=3,
node.label.force=1, node.xcoord='xcoord', node.ycoord='ycoord',
edge.size='weight_scaled', node.size='num_edges', node.size.title="Num
of \nedges", node.size.range=c(1,4))
# }
Run the code above in your browser using DataLab