Learn R Programming

SimEvolEnzCons (version 2.0.0)

RNV.for.simul: Compute RNV for simulation

Description

Computes different elements at RNV for evolution simulation

Usage

RNV.for.simul(res_sim,n_fun,N_fun,correl_fun,beta_fun=NULL,
end.mean=TRUE)

Arguments

res_sim

Dataframe corresponding to result of one simulation. See details.

n_fun

Integer number indicating the number of enzymes.

N_fun

Numeric. Population size

correl_fun

Character string indicating the abbreviation of the constraint applied on the system

beta_fun

Matrix of co-regulation coefficients

end.mean

Logical. If FALSE, compute RNV size mean for all rows of res_sim. If TRUE, compute RNV size mean for last half of res_sim rows.

Value

Invisible list of 7 elements:

  • $RNV_delta: list of n elements, one by enzyme. Each element contains a numeric matrix of nb_resid rows and two or four columns. For each enzyme i (a list element), each row corresponds to one resident and columns are actual mutation size \(\delta_i\) corresponding respectively to inferior bound (col 1) and superior bound (col 2) of RNV (x2 if there is a second RNV). Each row is in fact a result of RNV.delta.all.enz.

  • $RNV_enz: same structure as $RNV_delta, but for mutant enzyme concentrations at RNV limits, i.e. \(E_i + \delta_i\) for each target enzyme i.

  • $RNV_size: list of one or two elements (depending RNV on RNV number). Each element contains a matrix of n columns (one by enzyme) and nb_resid rows. Each cell is the RNV size (see details).

  • $RNV_size_divEtot: same structure as $RNV_size, but for RNV size divided by total concentration of corresponding resident.

  • $RNV_proxy: numeric matrix of one or two rows (depending on RNV number) and n columns. Each cell is the mean of RNV size (see details).

  • $RNV_proxy_divEtot: same structure as $RNV_proxy, and contains mean of RNV size divided by total concentration.

  • $RNV_flux: numeric matrix of two columns (inferior and superior limits of neutral zone) and nb_resid rows. Each cell is the flux value at neutral zone limits.

  • $nb_RNV: number of RNV. If constraint is "SC" or "RegPos", there is one RNV, else two.

  • $limits_NZ: numeric vector of the two limits of neutral zone

Note that n is the number of enzymes. nb_resid is the number of resident and is also the rows number of res_sim.

Details

This function is designed to computes RNV of one simulation launched by simul.evol.enz.one. Input res_sim is a result of simul.evol.enz.one. If you used simul.evol.enz.multiple, input tabR for parameter res_sim. If input is several simulations, remember that number of rows for one simulation is npt. See below.

The Range of Neutral Variations (RNV) are mutant concentration values such as coefficient selection is between \(1/(2N)\) and \(-1/(2N)\).

Inferior (resp. superior) bound of RNV corresponds to selection coefficient equal to \(-1/(2N)\) (resp. \(1/(2N)\)).

Function RNV.for.simul computes the actual mutation effect \(\delta_i\) at RNV bounds (where \(i\) is the enzyme targeted by the mutation), but also mutant concentration at RNV bounds and the RNV size.

Depending on applied constraint correl_fun, it exists 1 or 2 RNV. In case of independence ("SC") or positive regulation between all enzymes ("RegPos"), flux has no limit and there is only one RNV. In other cases (competition and/or negative regulation), because flux can reach a maximum, there is two RNV: a "near" one, for small mutations, and a "far" one for big mutations that put mutants on the other side of flux dome.

RNV size

The RNV size is the absolute value of \(\delta_i^sup\) minus \(\delta_i^inf\). If there is no superior bounds but there is two RNVs, RNV size is obtained by the difference of the two \(\delta_i^inf\).

The mean of RNv size is the mean of every resident for each enzyme. If end.mean=TRUE, only last half of resident (the last half of res_sim rows) are used to compute RNV mean.

Use of res_sim

res_sim is a numeric matrix of (3*n+4) columns and at least 2 rows. Respective columns are: concentrations (1:n), kinetic parameters (n+1:2n), total concentration (2n+1), total kinetic (2n+2), flux/fitness (2n+3) and activities (2n+4:3n+3), corresponding to (E1 to En, kin_1 to kin_n, Etot, kin_tot, J, A1 to An). See function simul.evol.enz.one.

res_sim is normally output $res_sim of function simul.evol.enz.one. Output $tabR of function simul.evol.enz.multiple is also possible, by selecting a simulation with x$tabR[x$tabR$sim==i,] where i is simulation number. If input is several simulations, remember that number of rows for one simulation is npt.

Other parameters (n_fun, N_fun, correl_fun, beta_fun) are available in output $param of simulation functions.

See Also

See function RNV.delta.all.enz to see how \(\delta\) is computed.

Use function simul.evol.enz.one to launch a simulation, or simul.evol.enz.multiple for several simulations.

Examples

Run this code
# NOT RUN {
 #### Construction of false simulation
#for 2 resident genotypes and 3 enzymes
n <- 3
Er <- c(30,30,30)
kin <- c(1,10,30)
Keq <- c(1,1,1)
A <- activities(kin,Keq)
beta <- matrix(c(1,10,5,0.1,1,0.5,0.2,2,1),nrow=3)
B <- compute.B.from.beta(beta)
correl <- "RegPos"
N <- 1000

#on one line
first_res <- cbind(t(Er),t(kin),sum(Er),sum(kin),flux(Er,A),t(A))

#second resident = theoretical equilibrium of first resident
Eq_th <- 100*predict_th(A,correl,B)$pred_e
second_res <- cbind(t(Eq_th),t(kin),sum(Eq_th),sum(kin),flux(Eq_th,A),t(A))

false_sim <- rbind(first_res,second_res)

RNV_elements <- RNV.for.simul(false_sim,n,N,correl,beta)

RNV_elements$RNV_delta #apparent mutation size at RNV for enzymes 1, 2 and 3
RNV_elements$RNV_enz #concentrations
RNV_elements$RNV_size #RNV size
RNV_elements$RNV_proxy #RNV size mean
RNV_elements$RNV_flux #flux at neutral zone

# }
# NOT RUN {
#With saved simulation
data(data_sim_RegPos)
RNV_elements <- RNV.for.simul(data_sim_RegPos$tabR,data_sim_RegPos$param$n,
data_sim_RegPos$param$N,data_sim_RegPos$param$correl,data_sim_RegPos$param$beta)
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab