Learn R Programming

SimEvolEnzCons (version 2.0.0)

simul.evol.graph.methods: Graphic methods for simulations of enzyme evolution

Description

Graphics illustrating enzyme evolution simulations obtained by function simul.evol.enz.multiple.

Function graph.simul.by.time.by.sim gives graphics depending on time, colored by simulations.

Function graph.simul.by.time.by.enz gives graphics depending on time, colored by enzymes, with series of graphics for each simulation.

Function graph.simul.others.by.sim gives different graphics depending on other variables than time in x-axis.

Function graph.simul.by.time.RNV gives graphics of Range of Neutral Variation (RNV) for each enzyme.

Function graph.simul.group gives graphics depending on time, colored by simulations, specifically for regulation groups.

Usage

graph.simul.by.time.by.sim(all_res_sim,new.window=FALSE,add.eq=TRUE,which.sim=NULL,
gr.J.time=FALSE,gr.e.time=TRUE,gr.E.time=FALSE,gr.Etot.time=FALSE,
gr.kin.time=FALSE,gr.A.time=FALSE,gr.tau.time=FALSE,
lwd.eq=1.5,...)

graph.simul.by.time.by.enz(all_res_sim,new.window=FALSE,add.eq=TRUE,which.sim=NULL, gr.J.time=TRUE,gr.e.time=TRUE,gr.E.time=FALSE,gr.Etot.time=FALSE, gr.kin.time=FALSE,gr.A.time=FALSE,gr.tau.time=FALSE, gr.rep.time=FALSE,gr.sim.heading=FALSE,lwd.eq=1.5,...)

graph.simul.others.by.sim(all_res_sim,new.window=FALSE,add.eq=TRUE,which.sim=NULL, gr.Ef.E0=FALSE, gr.Af.A0=FALSE, gr.Ef.Af=FALSE, gr.J.A.E=TRUE, gr.J.e=FALSE, gr.J.E=FALSE, env.curve=FALSE, gr.J.A=FALSE, ...)

graph.simul.by.time.RNV(all_res_sim,new.window=FALSE,add.eq=TRUE,which.sim=NULL, gr.RNV.E=TRUE,gr.RNV.size=FALSE,gr.RNV.delta=FALSE, gr.RNV.J=FALSE,zoom.RNV.J=NULL,gr.sim.heading=FALSE, col_RNV=c("grey60","grey80"),lty_RNV=c("dashed","longdash"),lwd.eq=1.5,...)

graph.simul.group(all_res_sim,new.window=FALSE,add.eq=TRUE,which.sim=NULL,which.grp=NULL, gr.eiq.time=TRUE,gr.eq.time=TRUE,gr.ei.time=FALSE,gr.Eq.time=FALSE,gr.Ei.time=FALSE, gr.tauq.time=FALSE,lwd.eq=1.5,...)

Arguments

all_res_sim

List, the output of function simul.evol.enz.multiple (results of evolution simulation).

new.window

Logical. Do graphics appear in a new window?

add.eq

Logical. Do equilibrium appear on graph?

which.sim

Numeric vector containing integer numbers between 1 and nsim. Which simulations would you represent? If NULL (default), all simulations would be represented.

gr.J.time, gr.e.time, gr.E.time, gr.Etot.time, gr.kin.time, gr.A.time

Logical. Add graph flux J / relative concentrations e / absolute concentrations E / total concentration Etot / kinetic parameters kin / activities A in relation to time?

gr.tau.time

Logical. Add graph depending on driving variable \(\tau\) if exists?

lwd.eq

Numeric. Line width for equilibrium line only.

...

Arguments to be passed in plot function, such as lwd or cex.

gr.rep.time

Logical. Add graph response coefficients in relation to time?

gr.sim.heading

Logical. Add an heading before each series of graphics corresponding to current simulation?

gr.Ef.E0

Logical. Add graph of final concentrations (absolute E and relative e) depending its initial value?

gr.Af.A0

Logical. Add graph of final activities (resp. kinetic parameters) depending its initial value?

gr.Ef.Af

Logical. Add graph of final concentrations (absolute E and relative e) depending on final activities A?

gr.J.A.E

Logical. Add 3D-graph of flux J depending on concentrations E and activities A?

gr.J.e

Logical. Add graph of flux J depending on relative concentrations e?

gr.J.E

Logical. Add graph of flux J depending on absolute concentrations E?

env.curve

Logical. Add envelope curve of competition dome? Available only for gr.J.E=T or gr.J.e=T.

gr.J.A

Logical. Add graph of of flux J depending on activities A?

gr.RNV.E, gr.RNV.size, gr.RNV.delta

Logical. Add graph concentrations E with its RNV / RNV size and RNV size divided by Etot / apparent mutation effect delta corresponding to RNV in relation to time?

gr.RNV.J

Logical. Add graph of flux depending on time and depending on concentrations with RNV and neutral zone?

zoom.RNV.J

Numeric vector of length 2, corresponding to ylim of graphics flux with RNV. If NULL (by default), ylim is zoomed around maximal flux of current simulation. If it is nor NULL nor vector of length 2, there is no zoom on flux.

col_RNV, lty_RNV

Vector of length 2, for color (resp. lty, see plot function) of RNV lines. First element correspond to inferior bounds and second one to superior bounds of RNV.

which.grp

Numeric vector containing integer numbers between 1 and \(p\) (number of regulation groups). Which regulation groups would you represent? If NULL (default), all groups would be represented.

gr.eiq.time, gr.eq.time, gr.ei.time, gr.Eq.time, gr.Ei.time, gr.tauq.time

Logical. Add graph intra-group relative concentrations \(e_i^q\) / inter-group relative concentrations \(e^q\) / total relative concentrations \(e_i\) / group absolute concentrations \(E^q\) / absolute concentrations \(E_i\) / group driving variable \(\tau^q\) in relation to time?

Value

Function graph.simul.by.time.by.sim returns invisible list of 5 elements:

  • $eq_th_e: Numeric matrix of n columns and nsim rows. Every row corresponds to relative concentrations at theoretical equilibrium computed from initial values of current simulation;

  • $eq_th_r: Same structure, for response coefficients at theoretical equilibrium;

  • $eq_eff_e: Same structure, for relative concentrations at effective equilibrium (if exists), else NA;

  • $eq_eff_E: Same structure, for absolute concentrations at effective equilibrium (if exists), else NA;

  • $eq_eff_tau: Numeric matrix of one column and nsim rows, corresponding to driving variable \(\tau\) at effective equilibrium in case of regulation, else NULL.

Function graph.simul.by.time.by.enz returns nothing.

Function graph.simul.others.by.sim returns nothing.

Function graph.simul.by.time.RNV returns invisible list of 2 elements:

  • $RNV_all_sim: List of nsim elements (which is number of simulation). Every element is the output of function RNV.for.simul for corresponding simulation. If simulation i is not contained in which.sim, $RNV_all_sim[[i]] is NULL.

  • $RNV_mean_size: Numeric matrix of n+2 columns. Row number is between nsim and 2*nsim, depending on applied constraint. n first columns correspond to RNV mean size for corresponding enzyme for last half simulation; column n+1 indicates simulation number and column n+2 RNV number (between 1 and 2).

Function graph.simul.group returns an invisible list of nsim elements. Each element contains the output of predict_grp, which computes the equilibria, for the corresponding simulation.

Details

If only one simulation may be represented, use preferably function graph.simul.by.time.by.enz.

Colors for simulations are taken in palette rainbow. Colors for enzymes correspond to their number plus one.

Function graph.simul.by.time.by.sim gives graphs of flux, relative concentrations, absolute concentrations, total concentration, kinetic parameters and activities through time. In addition, if all enzymes are co-regulated, gives also driving variable \(\tau\) in relation to time. Lines are colored according to simulation. There is one graph by enzyme if necessary. Dashed lines correspond to theoretical equilibrium, and dotted lines to effective equilibrium. Every graph follow same scheme:

  1. empty graph with time in x-axis and interesting variable in y-axis

  2. for each simulation i

  3. add connected points for current variable for simulation i

  4. add text for simulation number i at end of x-axis

  5. eventually, add predicted values

Function graph.simul.by.time.by.enz gives graphs of flux, relative concentrations, absolute concentrations, total concentration, kinetic parameters, activities and response coefficients through time. In addition, if all enzymes are co-regulated, gives also driving variable \(\tau\) in relation to time and flux in relation to \(\tau\). Lines are colored according to enzyme. There is one graph by simulation. An heading with parameters of current simulation can be added with gr.sim.heading Dashed lines correspond to theoretical equilibrium, and dotted lines to effective equilibrium.

  1. for each simulation i

  2. line graph with time in x-axis and interesting variable in y-axis

  3. eventually, add predicted values

  4. add legend

Function graph.simul.others.by.sim gives graphs of:

  • final concentrations in relation to initial concentrations

  • final relative concentrations in relation to initial relative concentrations

  • final kinetic parameters in relation to initial kinetic parameters

  • final activities in relation to initial activities

  • final concentrations in relation to final activities

  • final relative concentrations in relation to final activities

  • flux in relation to concentrations and activities (3D-graph)

  • flux in relation to absolute or relative concentrations (one graph by enzyme, colored by simulation)

One color by enzyme. The colored numbers correspond to the simulations.

Function graph.simul.by.time.RNV gives graphs of, for each simulations:

  • concentrations with RNV bounds

  • apparent mutation effects \(\delta\) at RNV bounds, for each enzyme considering at mutant

  • RNV size

  • RNV size divided by total concentration

  • flux with neutral zone bounds, in relation to time and in relation to enzyme concentrations of each enzyme (where data are ordered to facilitate view)

Lines are colored by enzymes. Bounds of RNV is colored depending on col_RNV.

#' Function graph.simul.group gives graphs of:

  • intra-group relative concentrations \(e_i^q\)

  • inter-group relative concentrations \(e^q\)

  • total relative concentrations \(e_i\) (same as gr.e.time in graoh.simul.by.time.by.sim)

  • absolute concentrations for a group \(E^q\)

  • absolute concentrations \(E_i\) (same as gr.E.time in graoh.simul.by.time.by.sim)

  • driving variable of group \(\tau^q\)

Lines are colored by simulations.

Graphical parameters

To modify line width, input both lwd and lwd.eq. Input lwd without input lwd.eq modifies only equilibrium line width, and not all line width.

Envelope curve

The envelope curve is the projection of competition dome in graph of flux J depending on concentrations (gr.J.E=TRUE and gr.J.e=TRUE). This curve is available only if there is competition, if the total concentration and activities are identical between simulations, and activities are not subject yo mutations.

col_RNV and lty_RNV

Vector of length 2, for color (resp. lty, see plot function) of RNV lines. First element correspond to inferior bounds and second one to superior bounds of RNV.

These parameters are only available for plot gr.RNV.E and gr.RNV.J.

See Also

Use function simul.evol.enz.multiple to simulate enzyme evolution.

Function scatterplot3d is used to make the 3D-graph in function graph.simul.others.by.sim.

Examples

Run this code
# NOT RUN {
 
  # With saved simulation
data(data_sim_RegNeg)

graph.simul.by.time.by.sim(data_sim_RegNeg,new.window=TRUE)
graph.simul.by.time.by.enz(data_sim_RegNeg,new.window=TRUE,which.sim=c(1))
graph.simul.others.by.sim(data_sim_RegNeg,new.window=TRUE,env.curve=TRUE,gr.J.E)
graph.simul.by.time.RNV(data_sim_RegNeg,new.window=TRUE,which.sim=c(1))

data(data_sim_CRNeg_1grpNeg1sgl)
graph.simul.group(data_sim_CRNeg_1grpNeg1sgl,gr.Eq.time=TRUE,gr.tauq.time=TRUE)
 
 
 
 
# }
# NOT RUN {
 #New simulation
# case for 3 enzymes
n <- 3
E0 <- c(30,30,30)
kin <- c(1,10,30)
Keq <- c(1,1,1)
nsim <- 2 # 2 simulations
N <- 1000
beta <- diag(1,n)
beta[upper.tri(beta)] <- c(0.32,0.32*(-0.43),-0.43)
#put : beta_12 = 0.32, beta_13 = beta_12 x beta_23, beta_23 = -0.43
t_beta <- t(beta) #because R fills matrix column by column
beta[lower.tri(beta)] <- 1/t_beta[lower.tri(t_beta)] #beta_ji = 1/beta_ij
if (n==3) {beta[lower.tri(beta)] <- 1/beta[upper.tri(beta)]} #only available if n=3
correl <- "RegNeg"

evol_sim <- simul.evol.enz.multiple(E0,kin,Keq,nsim,N,correl,beta,npt=250)
graph.simul.by.time.by.sim(evol_sim,new.window=TRUE)
graph.simul.by.time.by.enz(evol_sim,new.window=TRUE,which.sim=c(1))
graph.simul.others.by.sim(evol_sim,new.window=TRUE)
graph.simul.by.time.RNV(evol_sim,new.window=TRUE,which.sim=c(1))

# }
# NOT RUN {





# }

Run the code above in your browser using DataLab