RNV.for.simul: Compute RNV for simulation

Description Usage Arguments Details Value See Also Examples

View source: R/RNV.for.simul.R

Description

Computes different elements at RNV for evolution simulation

Usage

1
2
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.

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 δ_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 δ_i^sup minus δ_i^inf. If there is no superior bounds but there is two RNVs, RNV size is obtained by the difference of the two δ_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.

Value

Invisible list of 7 elements:

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

See Also

See function RNV.delta.all.enz to see how δ is computed.

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 #### 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


#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)

SimEvolEnzCons documentation built on Oct. 29, 2021, 1:07 a.m.