Genome scale network model
From CSBLwiki
(Difference between revisions)
Line 50: | Line 50: | ||
dev.off() | dev.off() | ||
</pre> | </pre> | ||
- | :result = [file:net.pdf|net.pdf] | + | :*result = [[file:net.pdf|net.pdf]] |
Revision as of 16:30, 21 July 2011
- Graph Visualization
- Bioconductor Install
- Rgraphviz
- rsbml
- BiGGR
- Drawing network graphs (nodes and edges) with R/BioConductor [1]
source("http://bioconductor.org/biocLite.R") ## requirement: libsbml, graphviz library biocLite("rsbml","Rgraphviz","BiGGR",type="source") # compiling from source code ### ### visualization of stoichiometric matrix ### library("BiGGR") # <- related packages automatically ON (graph, igraph,...) load("shewanella.rdata") #sm # stoichiometric matrix metabo = rownames(sm) # metabolites fluxname = colnames(sm) # reactions dim(sm) am = matrix(0,729,729) # null adj. matrix dimnames(am) = list(metabo,metabo); am[1:5,1:5] ## converting sm to am for(i in 1:ncol(sm)) { # i = 1 ind = names(sm[which(sm[,i]!=0),i]) am[ind,ind] = 1 # print(i) } diag(am) = 0 # set digonal '0' ## Too many edges such as ATP, H2O, PPi.... cofact = sort(rowSums(am),decreasing=T)[1:100] cofact # top 100; mostly cofactors, tRNA... cof.ind = which(metabo %in% names(cof)) am.m = am[-cof.ind,-cof.ind] dim(am.m) # 629 629 ## adjacency matrix to graph obj. gl = new("graphAM",adjMat=am.m) #> gl #A graphAM graph with undirected edges #Number of Nodes = 629 #Number of Edges = 1091 ### draw network pdf(file="net.pdf") plot(gl) dev.off()
- result = File:Net.pdf