SimBiology model creates a diagram and visualization diagram

The graph theory function in the bioinformatics toolbox is based on sparse matrices. The only restriction is that these matrices must be square matrices. In this model, protein A inhibits protein B, protein B inhibits protein C, and C in turn inhibits protein A. MATLAB provides many operation functions for sparse matrices. For example, the Spy function can be displayed in the non-zero position of the matrix*. The sparse matrix indicates the number of edges in the graph, and it can be found that Figure 2 is asymmetric, so it is a directed graph. However, the specific visualization results cannot be displayed using only the matrix. Another way to represent graphs in the bioinformatics toolbox is the biograph object.
load oscillatorgraph
spy(g)
gObj=biograph(g,names)
gObj=view(gObj);
pANode=find(strcmp('pA',names));
pBNode=find(strcmp('pB',names));
pCNode =find(strcmp('pC',names));
set(gObj.nodes(pANode),'color',[1 0 0],'size',[40 30]);
set(gObj.nodes(pBNode) ,'color',[0 1 0],'size',[40 30]);
set(gObj.nodes(pCNode),'color',[0 0 1],'size',[40 30]);
dolayout(gObj);
Insert picture description here
Insert picture description here

Bioinformatics Analysis and Practice-Application of MATLAB Bioinformatics Toolbox

Guess you like

Origin blog.csdn.net/m0_38127487/article/details/113919346