Skip to content

Commit

Permalink
Update chemical reactions as Network of complexes.md
Browse files Browse the repository at this point in the history
updated for viewing graph for `0` or `Nothing` type of complex in reactant/product
  • Loading branch information
yewalenikhil65 committed Apr 9, 2021
1 parent 87f56c3 commit cb5806c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docs/src/tutorials/chemical reactions as Network of complexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,21 @@ function create_graph(incidence::Array{Int,2})
end
return graph
end
graph = create_graph(Array(B'))
G = create_graph(Array(B'))

complexes_names = []
for i 1:nc
push!(complexes_names ,sum(complexes_mat[i][:,1].*complexes_mat[i][:,2]))
if complexes_mat[i] == [Term[] Int64[]] # taking care of `Nothing` or `0` species
push!(complexes_names, 0)
else
push!(complexes_names ,
sum(complexes_mat[i][:,1].*complexes_mat[i][:,2]))
end

end

graphplot(graph,names=string.(complexes_names),

graphplot(G,names=string.(complexes_names),
nodesize=0.1,nodeshape=:circle,
curves = false)
```
Expand Down

0 comments on commit cb5806c

Please sign in to comment.