Skip to content

Commit

Permalink
build based on 89c7d52
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Nov 12, 2024
1 parent 7141c31 commit 9c1dc49
Show file tree
Hide file tree
Showing 69 changed files with 6,043 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stable
2 changes: 1 addition & 1 deletion v2
2 changes: 1 addition & 1 deletion v2.0
1 change: 1 addition & 0 deletions v2.0.2/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"documenter":{"julia_version":"1.10.6","generation_timestamp":"2024-11-12T20:50:11","documenter_version":"1.7.0"}}
160 changes: 160 additions & 0 deletions v2.0.2/assets-compile/custom-tikz.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
% Tikz libraries
\usepackage{tikz}
\usetikzlibrary{%
patterns, plotmarks, backgrounds, shapes, arrows, calc, trees, positioning,
chains, shapes.geometric, decorations.pathreplacing,
decorations.pathmorphing, shapes.arrows, decorations.markings, quotes,
shapes.geometric, arrows.meta, spy, fit, matrix, math, bending, graphs,
graphs.standard, through
}

%% Define main node types
% Vertical split circle with either sides filled with different colours
\makeatletter
\tikzset{circle split part fill/.style args={#1,#2}{%
alias=tmp@name,%
postaction={%
insert path={%
\pgfextra{%
\pgfpointdiff{\pgfpointanchor{\pgf@node@name}{center}}
{\pgfpointanchor{\pgf@node@name}{east}}
\pgfmathsetmacro\insiderad{\pgf@x}
\fill[#1] (\pgf@node@name.base)
([xshift=-\pgflinewidth]\pgf@node@name.east)
arc
(0:180:\insiderad-\pgflinewidth)--cycle;
\fill[#2] (\pgf@node@name.base)
([xshift=\pgflinewidth]\pgf@node@name.west)
arc
(180:360:\insiderad-\pgflinewidth)--cycle;
}
}
}
}
}
\makeatother

\tikzstyle{gem_node} = [% black gem node for the input metabolic network
circle,
draw=black,
fill=black,
minimum height=0.15cm
]
\tikzstyle{gem_node_ph} = [% placeholder gem node for input metabolic network
circle,
draw=none,
fill=none,
minimum height=0.15cm
]
\tikzstyle{gem_edge} = [% edge style linking gem nodes
-,
line width=2pt
]
\tikzstyle{carbonDraw} = [% edge style linking molecules
-,
draw,
line width=1.75pt
]
\tikzstyle{ball} = [%
circle,
draw=black,
minimum height=0.70cm,
line width=1.0pt,
align=center,
fill=cgrey,
fill opacity=1.0,
text opacity=1.0,
text centered,
text=black,
inner sep=0.5pt,
font=\LARGE
]
\tikzstyle{carbon} = [% individual carbon atom node
circle,
draw=black,
fill=white,
inner sep=3.0pt,
line width=0.75pt
]
\tikzstyle{carbonBlank} = [% carbon atom node for white background
circle,
draw=white,
fill=white,
inner sep=3.0pt,
line width=0.75pt
]
\tikzstyle{carbonGrey} = [% greyed out carbon atom node
circle,
draw,
draw opacity=0.25,
fill opacity=0.25,
inner sep=3.0pt,
line width=0.75pt
]
\tikzstyle{ring6} = [%
regular polygon,
regular polygon sides=6,
draw,
inner sep=0.5cm,
line width=1.75pt
]
\tikzstyle{ring5} = [%
regular polygon,
regular polygon sides=5,
draw,
inner sep=0.5cm,
line width=1.75pt
]
\tikzstyle{reactionArrow} = [% reaction arrow style
-stealth,
line width=3.0pt,
draw=black
]
\tikzstyle{chmcArrow} = [% reaction arrow style
-stealth,
line width=6.0pt,
draw=black
]
\tikzstyle{chmcArrow2} = [% reaction arrow style
-stealth,
line width=12.0pt,
draw=black
]
\tikzstyle{subpanelArrow} = [% reaction arrow style
-stealth,
line width=9.0pt,
draw=black
]
\tikzstyle{labelFont} = [% standard label font size
font=\LARGE
]
\tikzset{%
labelSankey/.style={%
fill=white,
fill opacity=0.0,
text opacity=1,
inner sep=3pt,
text=black!50!black!50!black,
inner xsep=3pt,
font=\Large,
align=center,
},
}

\tikzmath{%
\sep=0.5pt;
\innerspace=0.25pt;
\outerspace=1.0pt;
\rxnspace=5pt;
\fluxspace=0.5pt;
\multispace = 0.5pt;
}

\tikzset{
double arrow/.style args={#1 colored by #2 and #3}{
-stealth,line width=#1,#2, % first arrow
postaction={draw,-stealth,#3,line width=(#1)/2.5,
shorten <=(#1)/3,shorten >=2*(#1)/3}, % second arrow
}
}
%\draw[double arrow=1pt colored by blue and white]
81 changes: 81 additions & 0 deletions v2.0.2/assets-compile/generate-plots.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/usr/bin/env bash

## Tutorial: CHMC (metabolic networks)
# Plot toy network and CHMC as PDF and PNG
pdflatex -shell-escape toy-network-1.tex
pdflatex -shell-escape toy-network-1-chmc.tex

# Plot toy network CHMC via MarkovWeightedEFMs
julia toy-network-1-chmc-analysis.jl # generates toy-network-1-chmc-makie.png

# Crop PNGs and set background solid white
magick toy-network-1.png -gravity East -chop 672x0 toy-network-1.png
magick toy-network-1.png -gravity West -chop 632x0 -background white -alpha remove -alpha off toy-network-1.png
magick toy-network-1-chmc.png -background white -alpha remove -alpha off toy-network-1-chmc.png
magick toy-network-1-chmc-makie.png -gravity East -chop 250x0 toy-network-1-chmc-makie.png
magick toy-network-1-chmc-makie.png -gravity West -chop 250x0 -background white -alpha remove -alpha off toy-network-1-chmc-makie.png

# Remove logs
rm toy-network-1.aux toy-network-1.log
rm toy-network-1-chmc.aux toy-network-1-chmc.log

# Move PNGs to assets
mv toy-network-1.png ../assets/
mv toy-network-1-chmc.png ../assets/
mv toy-network-1-chmc-makie.png ../assets/

## Tutorial: CHMC (ion channels)
# Plot Markov state model as PDF and PNG
pdflatex -shell-escape ion-channel-mc.tex

# Plot toy network CHMC via MarkovWeightedEFMs
julia ion-channel-chmc-analysis.jl # generates ion-channel-chmc-makie.png

# Set background solid white
magick ion-channel-mc.png -background white -alpha remove -alpha off ion-channel-mc.png

# Remove logs
rm ion-channel-mc.aux ion-channel-mc.log

# Move PNGs to assets
mv ion-channel-mc.png ../assets/
mv ion-channel-chmc-makie.png ../assets/

## Tutorial ACHMC (one-carbon)
# Plot toy network as PDF and PNG
pdflatex -shell-escape toy-network-2-achmc.tex

# Set background solid white
magick toy-network-2-achmc.png -background white -alpha remove -alpha off toy-network-2-achmc.png

# Remove logs
rm toy-network-2-achmc.aux toy-network-2-achmc.log

# Move PNGs to assets
mv toy-network-2-achmc.png ../assets/

## Tutorial: ACHMC (glucose)
# Plot network as PDF and PNG
pdflatex -shell-escape toy-network-1-achmc.tex

# Set background solid white
magick toy-network-1-achmc.png -background white -alpha remove -alpha off toy-network-1-achmc.png

# Remove logs
rm toy-network-1-achmc.aux toy-network-1-achmc.log

# Move PNGs to assets
mv toy-network-1-achmc.png ../assets/

## Logo
pdflatex -shell-escape logo.tex

# Remove logs
rm logo.aux logo.log

# Convert to SVG
inkscape --export-type=svg logo.pdf

# Move logo to assets
mv logo.svg ../assets/

62 changes: 62 additions & 0 deletions v2.0.2/assets-compile/ion-channel-chmc-analysis.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using MarkovWeightedEFMs
using CairoMakie

# Parameters
c = 0.1 # Ca2+ (uM)
I = 0.1 # IP3 (uM)
a1 = 50
a2 = 0.035
a4 = 3.5
a5 = 65
a6 = 25
a7 = 10
a8 = 0.035
a9 = 0.15
a10 = 1.25
a11 = 110
b1 = 2.5
b2 = 1.25
b3 = 0.25
b4 = 12.5
b5 = 10
b7 = 0.25
b9 = 0.2
b10 = 2.5
b11 = 20
K1 = b1 / a1
K2 = b2 / a2
K4 = b4 / a4
K5 = b5 / a5
K7 = b7 / a7
K9 = b9 / a9
K10 = b10 / a10
a3 = (b3 * K4) / (K1 * K2)
b6 = (a6 * K5 * K7) / K1
b8 = (a8 * K2 * K10) / K9

# Markov transition rate matrix
Q = [
0 c*a6 0 I*a7 0 0 0 0 0 0
b6 0 c*a4 0 I*a1 0 0 0 0 0
0 b4 0 0 0 I*a3 0 0 0 0
b7 0 0 0 c*a5 0 a9 0 0 0
0 b1 0 b5 0 c*a2 0 a9 0 a11
0 0 b3 0 b2 0 0 0 a10 0
0 0 0 b9 0 0 0 c*a5 0 0
0 0 0 0 b9 0 b5 0 c*a8 0
0 0 0 0 0 b10 0 b8 0 0
0 0 0 0 b11 0 0 0 0 0
];

# Markov transition probability matrix
T = Q ./ sum(Q, dims=2)

res = steady_state_efm_distribution(T);

# Static backend for plotting
CairoMakie.activate!(type = "png")

# Plot and save
fig = plot_chmc(T, 1)
save("ion-channel-chmc-makie.png", fig)

Empty file.
Empty file.
Loading

0 comments on commit 9c1dc49

Please sign in to comment.