From 58c96ac793bd72bca95db8819e9691b4e156c9ec Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Thu, 11 Aug 2016 11:26:38 -0700 Subject: [PATCH] use knitr for formalism --- Makefile | 6 ++--- kinetic_formalism.Rnw | 41 +++++++++++++++---------------- kinetic_formalism_competition.Rnw | 22 ++++++++--------- references.bib | 2 +- 4 files changed, 35 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index 4662459..10fdd67 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,10 @@ R=R bmeps -lpdf -olevel=1.4 $< $@ %.tex: %.Rnw - $(R) CMD Sweave $< + $(R) --encoding=utf-8 -e "library('knitr'); knit('$<')" %.pdf: %.tex $(wildcard *.bib) $(wildcard *.tex) - rubber -fd $< + latexmk -pdf -pdflatex='xelatex -interaction=nonstopmode %O %S' -bibtex -use-make $< clean: rubber -d --clean *.tex @@ -27,4 +27,4 @@ clean: .PHONY: clean all -.DELETE_ON_ERROR: %.tex \ No newline at end of file +.DELETE_ON_ERROR: %.tex diff --git a/kinetic_formalism.Rnw b/kinetic_formalism.Rnw index 8c4fe20..d38a231 100644 --- a/kinetic_formalism.Rnw +++ b/kinetic_formalism.Rnw @@ -59,7 +59,7 @@ \begin{document} %\maketitle -<>= +<>= require(lattice) require(grid) require(Hmisc) @@ -162,14 +162,13 @@ affect the rate of the insertion positively or negatively, so we do not include a term for it in this formalism. -\setkeys{Gin}{width=3.2in} -<>= +<>= curve(2^x,from=0,to=sd(c(0,4)), main="Unsaturation Forward", xlab="Standard Deviation of Unsaturation of Vesicle", ylab="Unsaturation Forward Adjustment") @ -<>= +<>= curve(to.kcal(2^x),from=0,to=sd(c(0,4)), main="Unsaturation forward", xlab="Standard Deviation of Unsaturation of Vesicle", @@ -205,7 +204,7 @@ a range of $\Delta \Delta G^\ddagger$ from $\Sexpr{format(digits=3,to.kcal(60^(-.165*-1)))} \frac{\mathrm{kcal}}{\mathrm{mol}}$ to $0\frac{\mathrm{kcal}}{\mathrm{mol}}$. -<>= +<>= x <- seq(-1,0,length.out=20) y <- seq(-1,0,length.out=20) grid <- expand.grid(x=x,y=y) @@ -219,7 +218,7 @@ print(wireframe(z~x*y,grid,cuts=50, zlab=list("Charge Forward",rot=93))) rm(x,y,grid) @ -<>= +<>= x <- seq(-1,0,length.out=20) y <- seq(-1,0,length.out=20) grid <- expand.grid(x=x,y=y) @@ -276,9 +275,9 @@ of $\Sexpr{format(digits=3,to.kcal(10^(0.13*0.213)))} relatively matched curvatures in our environment. % 1.5 to 0.75 3 to 0.33 -<>= +<>= grid <- expand.grid(x=seq(0,max(c(sd(abs(log(c(1,3)))), -y sd(abs(log(c(1,0.33)))),sd(abs(log(c(0.33,3)))))),length.out=20), + sd(abs(log(c(1,0.33)))),sd(abs(log(c(0.33,3)))))),length.out=20), y=seq(0,max(c(mean(log(c(1,3)), mean(log(c(1,0.33))), mean(log(c(0.33,3)))))),length.out=20)) @@ -291,7 +290,7 @@ print(wireframe(z~x*y,grid,cuts=50, zlab=list("Vesicle Curvature Forward",rot=93))) rm(grid) @ -<>= +<>= grid <- expand.grid(x=seq(0,max(c(sd(abs(log(c(1,3)))), sd(abs(log(c(1,0.33)))),sd(abs(log(c(0.33,3)))))),length.out=20), y=seq(0,max(c(mean(log(c(1,3)), @@ -362,13 +361,13 @@ From Nichols85: The association rate constant is independent of acyl chain length. {take into account for the formula; rz 8/17/2010}. -<>= +<>= curve(2^x,from=0,to=sd(c(12,24)), main="Length forward", xlab="Standard Deviation of Length of Vesicle", ylab="Length Forward Adjustment") @ -<>= +<>= curve(to.kcal(2^x),from=0,to=sd(c(12,24)), main="Length forward", xlab="Standard Deviation of Length of Vesicle", @@ -430,7 +429,7 @@ $\Sexpr{format(digits=3,to.kcal(7^(1-1/(5*(2^-1.7-2^-4)^2+1))))}\frac{\mathrm{kc for monomers with 4 unsaturations. -<>= +<>= grid <- expand.grid(x=seq(0,4,length.out=20), y=seq(0,4,length.out=20)) grid$z <- (7^(1-1/(5*(2^-grid$x-2^-grid$y)^2+1))) @@ -442,7 +441,7 @@ print(wireframe(z~x*y,grid,cuts=50, zlab=list("Unsaturation Backward",rot=93))) rm(grid) @ -<>= +<>= grid <- expand.grid(x=seq(0,4,length.out=20), y=seq(0,4,length.out=20)) grid$z <- to.kcal((7^(1-1/(5*(2^-grid$x-2^-grid$y)^2+1)))) @@ -477,7 +476,7 @@ $0\frac{\mathrm{kcal}}{\mathrm{mol}}$ for monomers with charge $0$. -<>= +<>= x <- seq(-1,0,length.out=20) y <- seq(-1,0,length.out=20) grid <- expand.grid(x=x,y=y) @@ -490,7 +489,7 @@ print(wireframe(z~x*y,grid,cuts=50, zlab=list("Charge Backwards",rot=93))) rm(x,y,grid) @ -<>= +<>= x <- seq(-1,0,length.out=20) y <- seq(-1,0,length.out=20) grid <- expand.grid(x=x,y=y) @@ -534,7 +533,7 @@ $\Sexpr{format(digits=3,to.kcal(7^(1-1/(20*(-0.013-log(1.3))^2+1))))}\frac{\math for monomers with curvature 1.3 to $0\frac{\mathrm{kcal}}{\mathrm{mol}}$ for monomers with curvature near 1. -<>= +<>= grid <- expand.grid(x=seq(0.8,1.33,length.out=20), y=seq(0.8,1.33,length.out=20)) grid$z <- 7^(1-1/(20*(log(grid$x)-log(grid$y))^2+1)) @@ -546,7 +545,7 @@ print(wireframe(z~x*y,grid,cuts=50, zlab=list("Curvature Backward",rot=93))) rm(grid) @ -<>= +<>= grid <- expand.grid(x=seq(0.8,1.33,length.out=20), y=seq(0.8,1.33,length.out=20)) grid$z <- to.kcal(7^(1-1/(20*(log(grid$x)-log(grid$y))^2+1))) @@ -585,7 +584,7 @@ $\Sexpr{format(digits=3,to.kcal(3.2^abs(24-17.75)))}\frac{\mathrm{kcal}}{\mathrm for monomers with length 24 to $0\frac{\mathrm{kcal}}{\mathrm{mol}}$ for monomers with curvature near 18. -<>= +<>= grid <- expand.grid(x=seq(12,24,length.out=20), y=seq(12,24,length.out=20)) grid$z <- 3.2^(abs(grid$x-grid$y)) @@ -597,7 +596,7 @@ print(wireframe(z~x*y,grid,cuts=50, zlab=list("Length Backward",rot=93))) rm(grid) @ -<>= +<>= grid <- expand.grid(x=seq(12,24,length.out=20), y=seq(12,24,length.out=20)) grid$z <- to.kcal(3.2^(abs(grid$x-grid$y))) @@ -646,7 +645,7 @@ $0\frac{\mathrm{kcal}}{\mathrm{mol}}$ for monomers with complex formation $0$. -<>= +<>= grid <- expand.grid(x=seq(-1,3,length.out=20), y=seq(-1,3,length.out=20)) grid$z <- 1.5^(grid$x*grid$y-abs(grid$x*grid$y)) @@ -658,7 +657,7 @@ print(wireframe(z~x*y,grid,cuts=50, zlab=list("Complex Formation Backward",rot=93))) rm(grid) @ -<>= +<>= grid <- expand.grid(x=seq(-1,3,length.out=20), y=seq(-1,3,length.out=20)) grid$z <- to.kcal(1.5^(grid$x*grid$y-abs(grid$x*grid$y))) diff --git a/kinetic_formalism_competition.Rnw b/kinetic_formalism_competition.Rnw index 917ef85..88cebad 100644 --- a/kinetic_formalism_competition.Rnw +++ b/kinetic_formalism_competition.Rnw @@ -76,7 +76,7 @@ \begin{document} \maketitle -<>= +<>= require(lattice) require(grid) require(Hmisc) @@ -160,7 +160,7 @@ the $i$th component in the vesicle. \subsection{Per-Lipid Kinetic Parameters} -<>= +<>= kf.prime <- c(3.7e6,3.7e6,5.1e7,3.7e6,2.3e6) kf <- (as.numeric(kf.prime)*10^-3)/(63e-20*6.022e23) @ @@ -587,7 +587,7 @@ values depicted in Figure~\ref{fig:unf_graph}. \setkeys{Gin}{width=6.4in} \begin{figure} -<>= +<>= layout(matrix(1:2,nrow=1,ncol=2)) curve(2^x,from=0,to=sd(c(0,4)), xlab=expression(paste(stdev,group("(",italic(un[vesicle]),")"))), @@ -653,7 +653,7 @@ values seen in Figure~\ref{fig:chf_graph}. \begin{figure} -<>= +<>= trellis.device(new=F,color=TRUE) trellis.par.set(list(axis.line =list(col="transparent"))) pushViewport(viewport(layout=grid.layout(nrow=1,ncol=2),clip="off")) @@ -748,7 +748,7 @@ $cu_\mathrm{f}$ values possible are shown in Figure~\ref{fig:cuf_graph}. % 1.5 to 0.75 3 to 0.33 \begin{figure} -<>= +<>= trellis.device(new=F,color=TRUE) trellis.par.set(list(axis.line =list(col="transparent"))) pushViewport(viewport(layout=grid.layout(nrow=1,ncol=2),clip="off")) @@ -862,7 +862,7 @@ $\Sexpr{format(digits=3,to.kcal(2^(3.4)))} \begin{figure} -<>= +<>= layout(matrix(1:2,nrow=1,ncol=2)) curve(2^x,from=0,to=sd(c(12,24)), xlab=expression(paste(stdev,group("(",italic(l[vesicle]),")"))), @@ -960,7 +960,7 @@ the full range of possible values. \begin{figure} -<>= +<>= trellis.device(new=F,color=TRUE) trellis.par.set(list(axis.line =list(col="transparent"))) pushViewport(viewport(layout=grid.layout(nrow=1,ncol=2),clip="off")) @@ -1028,7 +1028,7 @@ of $ch_\mathrm{b}$. \begin{figure} -<>= +<>= trellis.device(new=F,color=TRUE) trellis.par.set(list(axis.line =list(col="transparent"))) pushViewport(viewport(layout=grid.layout(nrow=1,ncol=2),clip="off")) @@ -1125,7 +1125,7 @@ Figure~\ref{fig:cub_graph} \begin{figure} -<>= +<>= trellis.device(new=F,color=TRUE) trellis.par.set(list(axis.line =list(col="transparent"))) pushViewport(viewport(layout=grid.layout(nrow=1,ncol=2),clip="off")) @@ -1209,7 +1209,7 @@ $l_\mathrm{b}$ are shown in Figure~\ref{fig:lb_graph} \begin{figure} -<>= +<>= trellis.device(new=F,color=TRUE) trellis.par.set(list(axis.line =list(col="transparent"))) pushViewport(viewport(layout=grid.layout(nrow=1,ncol=2),clip="off")) @@ -1298,7 +1298,7 @@ depicted in Figure~\ref{fig:cf1b_graph}. \begin{figure} -<>= +<>= trellis.device(new=F,color=TRUE) trellis.par.set(list(axis.line =list(col="transparent"))) pushViewport(viewport(layout=grid.layout(nrow=1,ncol=2),clip="off")) diff --git a/references.bib b/references.bib index 434f02c..13eef8b 120000 --- a/references.bib +++ b/references.bib @@ -1 +1 @@ -../paper/references.bib \ No newline at end of file +../ool_paper_2010/references.bib \ No newline at end of file -- 2.39.2