Description Usage Arguments Details Value See Also Examples
View source: R/RNV.for.simul.R
Computes different elements at RNV for evolution simulation
1 2 | RNV.for.simul(res_sim,n_fun,N_fun,correl_fun,beta_fun=NULL,
end.mean=TRUE)
|
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 |
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.
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 δ_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 + δ_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
.
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.