Title: | Simulating Explicit Population Genetics Models |
---|---|
Description: | Implementation in a simple and efficient way of fully customisable population genetics simulations, considering multiple loci that have epistatic interactions. Specifically suited to the modelling of multilocus nucleocytoplasmic systems (with both diploid and haploid loci), it is nevertheless possible to simulate purely diploid (or purely haploid) genetic models. Examples of models that can be simulated with Ease are numerous, for example models of genetic incompatibilities as presented by Marie-Orleach et al. (2022) <doi:10.1101/2022.07.25.501356>. Many others are conceivable, although few are actually explored, Ease having been developed in particular to provide a solution so that these kinds of models can be simulated simply. |
Authors: | Ehouarn Le Faou <[email protected]> [aut, cre] |
Maintainer: | Ehouarn Le Faou <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.2 |
Built: | 2024-11-02 06:26:03 UTC |
Source: | CRAN |
Generates a matrix that allows to go from genotypic frequencies to allelic frequencies.
alleleFreqMatGeneration(genomeObj)
alleleFreqMatGeneration(genomeObj)
genomeObj |
a |
An allele frequency matrix is a matrix with rows equal to the number of genotypes and columns equal to the number of alleles. By multiplying a row matrix of genotype frequencies we obtain a row matrix of associated allele frequencies.
A matrix for calculating allelic frequencies from genotypes frequencies.
Ehouarn Le Faou
Test if there are homozygotes in the specified allelic combinations of a selection formula
areThereHomoz(formula)
areThereHomoz(formula)
formula |
a selection formula |
logical indicating if there are homozygotes
Ehouarn Le Faou
Object output in the same way as the function cat but adding a line break at the end.
catn(..., file = "", sep = " ", fill = FALSE, labels = NULL, append = FALSE)
catn(..., file = "", sep = " ", fill = FALSE, labels = NULL, append = FALSE)
... |
see cat. |
file |
see cat. |
sep |
see cat. |
fill |
see cat. |
labels |
see cat. |
append |
see cat. |
See cat.
None (invisible NULL
).
Ehouarn Le Faou
Genome
classThe validity check for the Genome
class
check.genome(object)
check.genome(object)
object |
a |
A logical corresponding to whether the object is a correct
Genome
object.
Ehouarn Le Faou
Metapopulation
classThe validity check for the Metapopulation
class
check.metapopulation(object)
check.metapopulation(object)
object |
a |
a boolean corresponding to whether the object is a correct
Metapopulation
object.
Ehouarn Le Faou
MutationMatrix
classThe validity check associated with the MutationMatrix
class
check.mutationMatrix(object)
check.mutationMatrix(object)
object |
an object of class |
A logical corresponding to whether x
is a correct
MutationMatrix
object.
Ehouarn Le Faou
Population
classThe validity check for the Population
class
check.population(object)
check.population(object)
object |
a |
a boolean corresponding to whether the object is a correct
Population
object.
Ehouarn Le Faou
Selection
classThe validity check for the Selection
class
check.selection(object)
check.selection(object)
object |
|
A logical corresponding to whether the object is a correct
Selection
object.
Ehouarn Le Faou
Conversion of an allelic combination defined in a selection formula into the vector listing the alleles present (alleles that must be in the homozygous state appear 2 times, 1 time for heterozygous).
extractAlleleComb(xVect)
extractAlleleComb(xVect)
xVect |
allelic combination extracted from a selection formula. |
the list of alleles that must be present in the genotype to match the input allelic combination
Ehouarn Le Faou
Genome
classThe Genome
class allows to define all the characteristics of the
genome which will be used as a basis for the construction of transition
matrices from one generation to another in simulations of the model.
A genome includes the list of all possible haplotypes and genotypes
resulting from the combination of the alleles defined in input.
As the Ease
package was originally built for population genetics
simulations including both diploid and haploid loci, it is necessary
that both types of loci are defined. Despite this, the user can define
only diploid or only haploid loci if they wish. If no diploid locus is
defined, one is automatically generated with only one allele, thus not
influencing the simulation. The same applies if no haploid locus is defined.
Each locus is described by a vector of factors which are the names of
the possible alleles at that locus. All diploid (resp. haploid) loci
thus defined are grouped in a list, called listDipLoci
(resp.
listHapLoci
). Therefore, a Genome
class object has two lists
of loci defined in this way, one for diploid loci, one for haploid loci.
The alleles and loci (diploid and haploid) must all have different
names so that no ambiguity can persist.
If several are defined, the order of the diploid loci in the list is not
trivial. The rates of two-to-one combinations between them must indeed be
defined by the vector recRate
. For example, if three diploid loci
are defined, recRate
must be of length 2, the first of its values
defining the recombination rate between the first and second loci, the
second of its values the recombination rate between the second and third
loci. For example, if we want to define two groups of two loci that are
linked to each other but are on two different chromosomes, we can define
a recRate = c(0.1, 0.5, 0.1)
. The first two loci are thus relatively
linked (recombination rate of 0.1), as are the last two loci. On the other
hand, the recombination rate of 0.5 between the second and third loci
ensures that the two groups are independent.
listHapLoci
a list of haploid loci
listDipLoci
a list of diploid loci
recRate
a two-by-two recombination rate vector
nbHL
the number of haploid loci
nbDL
the number of diploid loci
listLoci
the list of all loci
haplotypesHL
haplotypes of haploid loci only
haplotypesDL
haplotypes of diploid loci only
haplotypes
haplotypes of all loci
alleles
the vector of all the alleles
nbAlleles
the number of alleles
nbHaplo
the number of haplotypes
IDhaplotypes
IDs of haplotypes
genotypes
the list of genotypes
nbGeno
the number of genotypes
IDgenotypes
IDs of genotypes
IDgenome
ID of the genome
Ehouarn Le Faou
Generation of genotypes associated with a Genome
object.
genotyping(genomeObj)
genotyping(genomeObj)
genomeObj |
a |
The output genotypes are described as a list of three matrices. A genotype consists of two diploid haplotypes (first two matrices) and one haploid haplotype (third matrix), which are read at the same row number on all three matrices.
A list of matrices describing genotypes in rows.
Ehouarn Le Faou
Getting the custom output
getCustomOutput(metapop)
getCustomOutput(metapop)
metapop |
a |
The list generated through the custom result function, if at least
it was specified during the simulation of the Metapopulation
.
Ehouarn Le Faou
Getting the simulation results
getRecords(metapop)
getRecords(metapop)
metapop |
a |
A list where each item is associated with a simulation. Each of these elements consists of a list of data.frames, one per population. These data.frames consist of the same columns as the results (see getResults documentation), except that they do not include the stop conditions.
Ehouarn Le Faou
Getting the simulation results
getResults(metapop)
getResults(metapop)
metapop |
a |
A data.frame where each line corresponds to a simulation. The
results include :
- the last generation reached (the threshold or the generation that first
verified at least one of the stopping conditions)
- the final population size
- the genotype frequencies
- allelic frequencies
- the reason(s) for the stop (either the threshold was reached, i.e.
unstopped
or the stop condition(s) that was (were) reached, in the
form of boolean values
- Average fitness (individual, gamete production and gametic)
Ehouarn Le Faou
Generation of the haplotype crossing matrix associated to a Genome
object.
haploCrossMatrix(genomeObj)
haploCrossMatrix(genomeObj)
genomeObj |
a |
A crossover matrix is a square matrix of size equal to the number of haplotypes. It describes for each combination of two gametic haplotypes the genotype index resulting from their syngamy. In the general case it is not a symmetrical matrix (it is if a single haploid locus with a single allele is defined), because the transmission of haploid loci is only maternal, therefore non-symmetrical as is the transmission of diploid loci. It is therefore necessary to enter the haplotype frequencies of male gametes in the columns and the haplotype frequencies of female gametes in the rows during the calculations (this is done in the simulations).
An haplotype crossing matrix.
Ehouarn Le Faou
Generation of haplotypes associated with a Genome
object.
haplotyping(genomeObj)
haplotyping(genomeObj)
genomeObj |
a |
The generated haplotypes are output as a list of three enumeration in the form of matrices of alleles (each row corresponding to an haplotype, each column to a locus). The first enumeration corresponds to haplotypes considering only haploid loci, the second only diploid loci and the third all loci (with two matrices, 1 for haploid loci, 1 for diploid loci).
A list of matrices describing haplotypes in rows.
Ehouarn Le Faou
Generation of the input genome ID, i.e. the concatenation in string form of the names of the loci and alleles constituting this genome.
IDgenomeGeneration(listLoci, alleles)
IDgenomeGeneration(listLoci, alleles)
listLoci |
the list of all loci |
alleles |
the vector of all the alleles |
The genome ID as a character string.
Ehouarn Le Faou
Generation of the input genotype ID, i.e. the concatenation in string form of the names of the alleles constituting these haplotypes (the two from the diploid genome and the one from the haploid genome).
IDgenotypeGeneration(dl1, dl2, hl = NULL)
IDgenotypeGeneration(dl1, dl2, hl = NULL)
dl1 |
the first diploid haplotype as a character (or factors) vector. |
dl2 |
the second diploid haplotype as a character (or factors) vector. |
hl |
the haploid haplotype as a character (or factors) vector. |
The genotype ID as a character string.
Ehouarn Le Faou
Generation of the input haplotype ID, i.e. the concatenation in string form of the names of the alleles constituting this haplotype.
IDhaplotypeGeneration(dl, hl)
IDhaplotypeGeneration(dl, hl)
dl |
the diploid haplotype as a character (or factors) vector. |
hl |
the haploid haplotype as a character (or factors) vector. |
The haplotype ID as a character string.
Ehouarn Le Faou
Genome
classInitialize method for the Genome
class
## S4 method for signature 'Genome' initialize(.Object, listHapLoci, listDipLoci, recRate)
## S4 method for signature 'Genome' initialize(.Object, listHapLoci, listDipLoci, recRate)
.Object |
a |
listHapLoci |
a list of haploid loci |
listDipLoci |
a list of diploid loci |
recRate |
a two-by-two recombination rate vector |
A Genome
object
Ehouarn Le Faou
Metapopulation
classInitialize method for the Metapopulation
class
## S4 method for signature 'Metapopulation' initialize(.Object, populations, migMat)
## S4 method for signature 'Metapopulation' initialize(.Object, populations, migMat)
.Object |
a |
populations |
list of |
migMat |
migration matrix |
a Metapopulation
object
Ehouarn Le Faou
MutationMatrix
classInitialize method for the MutationMatrix
class
## S4 method for signature 'MutationMatrix' initialize(.Object, genomeObj, mutHapLoci, mutDipLoci)
## S4 method for signature 'MutationMatrix' initialize(.Object, genomeObj, mutHapLoci, mutDipLoci)
.Object |
a |
genomeObj |
a |
mutHapLoci |
a list of haploid locus by locus allelic mulation matrices. |
mutDipLoci |
a list of diploid locus by locus allelic mulation matrices. |
A MutationMatrix
object
Ehouarn Le Faou
Population
classInitialize method for the Population
class
## S4 method for signature 'Population' initialize( .Object, name, size, dioecy, selfRate, demography, growthRate, initGenoFreq, genomeObj, initPopSize, selectionObj, mutMatrixObj )
## S4 method for signature 'Population' initialize( .Object, name, size, dioecy, selfRate, demography, growthRate, initGenoFreq, genomeObj, initPopSize, selectionObj, mutMatrixObj )
.Object |
a |
name |
the name of the population. |
size |
the size of the population. |
dioecy |
logical indicating whether the population is dioecious or not (hermaphrodite). |
selfRate |
the selfing rate of the population |
demography |
logical indicating whether the population has stochastic demography (this does not include migration), i.e. non-constant size and potentially population growth or decay, depending on the situation it is in. |
growthRate |
growth rate of the population. |
initGenoFreq |
A row matrix of the size of the genotype number describing the initial allele frequencies common to all simulations |
genomeObj |
a |
initPopSize |
initial population size, knowing that if the demography is extinct, the initial population size will automatically be set equal to the population size. |
selectionObj |
a |
mutMatrixObj |
a |
a Population
object
Ehouarn Le Faou
Selection
classInitialize method for the Selection
class
## S4 method for signature 'Selection' initialize(.Object, genomeObj)
## S4 method for signature 'Selection' initialize(.Object, genomeObj)
.Object |
a |
genomeObj |
a |
A Selection
object
Ehouarn Le Faou
Test if a matrix is a correct transition matrix
is.correct.transition.matrix(x, type, name)
is.correct.transition.matrix(x, type, name)
x |
a matrix. |
type |
type of the matrice (mutation matrix ? recombination matrix ?) |
name |
the name of the matrix. |
A logical corresponding to whether x
is a correct transition
matrix, i.e. a square matrix with dimensions greater than 0 and whose rows
sum to 1.
Ehouarn Le Faou
Test if a matrix is a default matrix
is.default.matrix(x)
is.default.matrix(x)
x |
a matrix. |
A logical corresponding to whether x
is a default matrix
(matrix of dimension 0x0).
Ehouarn Le Faou
Test if a matrix is of probability
is.probability.matrix(x)
is.probability.matrix(x)
x |
a matrix. |
A logical corresponding to whether x
is a probability
matrix (sum of rows equal to 1).
Ehouarn Le Faou
Determination for a given genotype or haplotype whether it contains the allelic combination under selection
isAffected(refDNAtype, selDNAtype)
isAffected(refDNAtype, selDNAtype)
refDNAtype |
the reference allelic combination (that of a genotype or a haplotype |
selDNAtype |
the selected allelic combination |
a logic indicating whether the reference genotype or haplotype is affected by the allelic combination under selection
Ehouarn Le Faou
Test if there are homozygotes in the specified allelic combinations of a list of selection formulas
isHaploSelectFormula(selectFormula)
isHaploSelectFormula(selectFormula)
selectFormula |
a list of selection formula |
logical indicating if there are homozygotes
Listing from the elements of a vector by producing a string, with comma separation between each element and the word "and" between the last two elements.
listing(vect)
listing(vect)
vect |
a vector of any class. |
A listing of the elements of the input vector as a string.
Ehouarn Le Faou
Generation of the meiosis matrix associated to a Genome
object.
meiosisMatrix(genomeObj)
meiosisMatrix(genomeObj)
genomeObj |
a |
A meiosis matrix is a matrix where the number of rows is equal to the number of genotypes and the number of columns to the number of haplotypes. It is a matrix that allows to pass from parental genotypes to gametic haplotypes by meiosis. It is a probability matrix in that the sum of the values in each row is equal to 1. For a given genotype, the row associated with it describes the probabilistic proportions that lead by meiosis to the production of the other genotypes (and of itself if there are no mutations).
A meiosis matrix (probability matrix that associates to each genotype in a row the probability of producing each of the possible haplotypes).
Ehouarn Le Faou
Simulation of a metapopulation
METAPOP_SIMULATION( nbPop, ids, migMat, nsim, verbose, recording, recordGenGap, drift, nbHaplo, nbGeno, idGeno, nbAlleles, idAlleles, nbLoci, initGenoFreq, meiosisMat, gametogenesisMat, popSize, threshold, dioecy, selfRate, stopCondition, IDstopCondition, haploCrossMat, alleleFreqMat, gamFit, indFit, gamProdFit, demography, growthRate, initPopSize, nameOutFunct )
METAPOP_SIMULATION( nbPop, ids, migMat, nsim, verbose, recording, recordGenGap, drift, nbHaplo, nbGeno, idGeno, nbAlleles, idAlleles, nbLoci, initGenoFreq, meiosisMat, gametogenesisMat, popSize, threshold, dioecy, selfRate, stopCondition, IDstopCondition, haploCrossMat, alleleFreqMat, gamFit, indFit, gamProdFit, demography, growthRate, initPopSize, nameOutFunct )
nbPop |
number of populations in the metapopulation |
ids |
population IDs |
migMat |
migration matrix |
nsim |
number of simulations |
verbose |
boolean determining if the progress of the simulations should be displayed or not (useful in case of many simulations) |
recording |
a boolean indicating whether to record all mutations, i.e. to record allelic and genotypic frequencies along the simulations |
recordGenGap |
the number of generations between two records during simulation, if the record parameter is TRUE. Whatever the value of this parameter, both the first and the last generation will be included in the record |
drift |
a boolean indicating whether genetic drift should be considered (i.e. whether deterministic simulations are performed or not) |
nbHaplo |
number of haplotypes |
nbGeno |
number of genotypes |
idGeno |
genotypes ID |
nbAlleles |
number of alleles for each loci |
idAlleles |
alleles ID |
nbLoci |
number of loci |
initGenoFreq |
list of initial genotype frequencies in the populations |
meiosisMat |
meiosis matrix |
gametogenesisMat |
gametogenesis matrix |
popSize |
list population sizes |
threshold |
threshold for simulations |
dioecy |
whether the population(s) is dioecious or not (hermaphrodism) |
selfRate |
list of the selfing rate in populations (only for hermaphroditic population) |
stopCondition |
list of stop conditions |
IDstopCondition |
vector of stop condition ID |
haploCrossMat |
haplotypes crossing matrix |
alleleFreqMat |
matrix for calculating allelic frequencies |
gamFit |
fitness of gametes |
indFit |
fitness of individuals |
gamProdFit |
fitness for gamete production |
demography |
list of population demographies |
growthRate |
list of population growth rates |
initPopSize |
list of initial population |
nameOutFunct |
name of the custom output function |
Ehouarn Le Faou
The class Metapopulation
is used to centralise the information
relating to the populations that we want to simulate, as well as to define
the migration conditions between them if there are several. This class
is thus defined by a list of objects Population
and a migration
matrix.
populations
list of objects Population
nbPop
number of populations
names
names of the populations
migMat
migration matrix between population (if there is more than one)
sizes
sizes of the populations
dioecies
sexual systems of the populations (they must all be the same)
selfRates
selfing rates of the populations
demographies
demography parameter of the populations
growthRates
growth rates of the populations
initPopSizes
initial population sizes of the populations
initGenoFreqs
initial genotypic frequencies of the populations
genome
a Genome
object
genomeIDs
ID of the Genome
object
mutMat
a MutationMatrix
object
selection
a Selection
object
recMat
recombination matrix
meiosisMat
a meiosis matrix
haploCrossMat
an haplotype crossing matrix
haploCrossMatNamed
an haplotype crossing matrix with names of genotypes instead of their indices
gametogenesisMat
a gametogenesis matrix
alleleFreqMat
a matrix for calculating allelic frequencies
rawOutputSimul
raw output of the simulation function, its refinement
is done directly afterwards in the simulate
method
stopCondition
list of stop conditions for the simulation (if required)
IDstopCondition
names of stop conditions. They are given an arbitrary name if none is given by the user.
results
data.frame.
records
list.
customOutput
list.
Ehouarn Le Faou
Utility function to easily generate a mutation matrix (see setMutationMatrix).
mutation(from, to, rate)
mutation(from, to, rate)
from |
name of the original allele |
to |
name of the mutant allele |
rate |
rate at which the mutation occurs |
Mutation occurs from one allele to another at a specific rate. Please take care to define alleles as traits, that these alleles are present in the genome you are using and that the alleles are associated with the same locus.
A standardised list of input parameters that will be used by the function setMutationMatrix to generate the mutation matrix.
### Example with two loci, each with two alleles ### # Definition of the genome DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) # The mutation function allows each transition from one allele to # another to be defined individually, to produce the mutation matrix # as follows: mutMatrixObj <- setMutationMatrix(genomeObj, mutations = list( mutation(from = "A", to = "a", rate = 0.1), mutation(from = "B", to = "b", rate = 0.1) ) )
### Example with two loci, each with two alleles ### # Definition of the genome DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) # The mutation function allows each transition from one allele to # another to be defined individually, to produce the mutation matrix # as follows: mutMatrixObj <- setMutationMatrix(genomeObj, mutations = list( mutation(from = "A", to = "a", rate = 0.1), mutation(from = "B", to = "b", rate = 0.1) ) )
A mutation matrix is used to simulate mutations that affect loci. An object
of the class MutationMatrix
does not only contain a (haplotypic)
mutation matrix. It also contains the attributes necessary for the
construction and easy-to-read display of this matrix.
The mutation matrix itself is a square matrix of size equal to the number of haplotypes. It is a probability matrix in that the sum of the values in each row is equal to 1. For a given haplotype, the row associated with it describes the probabilistic proportions that lead by mutation of this haplotype to the production of the other haplotypes (and of itself if there are no mutations).
mutHapLoci
a list of haploid locus by locus allelic mulation matrices.
mutDipLoci
a list of diploid locus by locus allelic mulation matrices.
mutLoci
a list concatenating mutHapLoci
and mutDipLoci
nbAlDL
a vector of the number(s) of alleles at each haploid locus
nbAlHL
a vector of the number(s) of alleles at each diploid locus
mutationMatrix
the haplotypic mutation matrix
nbHaplo
the number of haplotypes
nbDL
the number of diploid loci
nbHL
the number of haploid loci
haplotypes
the enumeration of haplotypes
IDgenome
ID of the associated genome
Ehouarn Le Faou
Translation of the list of individually defined mutations into allelic mutation matrices which are then used to generate the genotypic mutation matrix.
mutMatFriendly(genomeObj, mutations)
mutMatFriendly(genomeObj, mutations)
genomeObj |
a |
mutations |
list of mutations defined individually with the function mutation |
A list of the two list of allelic mutation matrices, for haploid and diploid loci respectively.
Ehouarn Le Faou
Generation of a mutation matrix from the allele enumeration vector of a loci and the forward and backward mutation rates.
mutMatRates(alleles, forwardMut, backwardMut)
mutMatRates(alleles, forwardMut, backwardMut)
alleles |
allele enumeration vector of a locus |
forwardMut |
forward mutation rate |
backwardMut |
backward mutation rate |
See MutationMatrix
for more details on mutation matrices.
An allelic mutation matrix (probability matrix which associates to each allele in a row the probability of mutating or not to the other alleles of the locus in question).
Ehouarn Le Faou
Allow to produce a custom output for a simulation.
outFunct(pop)
outFunct(pop)
pop |
list of some characteristics of the population : - customOutput : list of all previous savings - gen : generation - freqGeno : list of genotypic frequency matrices (matrix 1 x # genotypes). The list is constructed as follows: if the population is hermaphroditic it has only one element "ind", if the population is dioecious it has three elements, "female", "male" and "ind" which correspond respectively to the genotypic frequencies of the females, the males and the average of the two (assuming a sex ratio of 50:50). - freqHaplo : list of genotypic frequency matrices (matrix 1 x # haplotypes). The list is constructed in the same way as for genotypic frequencies (see above). - freqAlleles : list of allelic frequency matrices (matrix 1 x # alleles). The list is constructed in the same way as for genotypic frequencies (see above). |
This function is called each generation in each population of a simulation and systematically returns a list with the first element being a logic that indicates whether something should be saved. If so, the second element of this list will be saved.
By default the save nothing function, but it can be changed by the user as
an argument in the simulate
method of the Metapopulation
class.
Ehouarn Le Faou
The Population
class allows for the collection of the parameters necessary
to characterise a biological population. It is an essentially useful class
in that no method associated with the population class can simulate its
dynamics. To do this, it is necessary to use the Metapopulation class,
which takes as input a list of populations (from one). The Population
class is also used to check that each of these parameters is compatible
with each other.
Thus to build an object of class Ease
, it is necessary to have
defined an object Genome
, as well as an object MutationMatrix
and an object Selection
(even if it is neutral, see
setSelectNeutral).
name
the name of the population.
size
the size of the population.
dioecy
logical indicating whether the population is dioecious or not (hermaphrodite).
selfRate
the selfing rate of the population
demography
logical indicating whether the population has stochastic demography (this does not include migration), i.e. non-constant size and potentially population growth or decay, depending on the situation it is in.
growthRate
growth rate of the population.
initGenoFreq
A row matrix of the size of the genotype number describing the initial allele frequencies common to all simulations
genome
a Genome
object
initPopSize
initial population size, knowing that if the demography is extinct, the initial population size will automatically be set equal to the population size.
selection
a Selection
object
mutMat
a MutationMatrix
object
Ehouarn Le Faou
Genome
classPrint method for the Genome
class
## S4 method for signature 'Genome' print(x, ...)
## S4 method for signature 'Genome' print(x, ...)
x |
a |
... |
Ignored. |
No return value, only a display.
Ehouarn Le Faou
Metapopulation
classPrint method for the Metapopulation
class
## S4 method for signature 'Metapopulation' print(x, ...)
## S4 method for signature 'Metapopulation' print(x, ...)
x |
a |
... |
Ignored. |
Ehouarn Le Faou
MutationMatrix
classPrint method for the MutationMatrix
class
## S4 method for signature 'MutationMatrix' print(x, ...)
## S4 method for signature 'MutationMatrix' print(x, ...)
x |
a |
... |
there are no more parameters. |
No return value, only a display.
Ehouarn Le Faou
Population
classPrint method for the Population
class
## S4 method for signature 'Population' print(x, ...)
## S4 method for signature 'Population' print(x, ...)
x |
a |
... |
the other parameter is |
Ehouarn Le Faou
Selection
classPrint method for the Selection
class
## S4 method for signature 'Selection' print(x, ...)
## S4 method for signature 'Selection' print(x, ...)
x |
a |
... |
there are no more parameters. |
No return value, only a display.
Ehouarn Le Faou
Generation of the recombination matrix associated to a Genome
object.
recombinationMatrix(genomeObj)
recombinationMatrix(genomeObj)
genomeObj |
a |
A recombination matrix is a square matrix of size equal to the number of genotypes. It is a probability matrix in that the sum of the values in each row is equal to 1. For a given genotype, the row associated with it describes the probabilistic proportions that lead by recombination between diploid loci to the production of the other genotypes (and of itself if there are no mutations).
A recombination matrix (probability matrix which associates to each genotype in a row the probability of recombining or not and of becoming another genotype or remaining the same).
Ehouarn Le Faou
Processing a result (or record) list
rowResultGen(x)
rowResultGen(x)
x |
list of result or record |
Merges the column names of the matrices making up the list with the names of the matrices, then merges the matrices together.
Ehouarn Le Faou
Conversion of a list of selection formulas into a genotypic (or haplotypic)
fitness vector associated with a Genome
object.
selectFormIntoVect(selectFormula, genomeObj, haplo = FALSE)
selectFormIntoVect(selectFormula, genomeObj, haplo = FALSE)
selectFormula |
a list of selection formulas |
genomeObj |
a |
haplo |
logical indicating whether the selection should apply to haplotypes (in the case of gametic selection for example) |
a vector of fitness values
Ehouarn Le Faou
Determines whether an entry for the selection is a list of selection formulas or just a vector. If it is a list of formulas, turns them into a vector. If it is a vector, does nothing.
selectInputTreatment(selectInput, genomeObj, haplo = FALSE)
selectInputTreatment(selectInput, genomeObj, haplo = FALSE)
selectInput |
a selection input |
genomeObj |
a |
haplo |
logical indicating whether the selection should apply to haplotypes (in the case of gametic selection for example) |
a vector of fitness values
Ehouarn Le Faou
Selection
classClass used to generate objects that manage the selection in the simulations.
An object of type Selection
is an object which describes the set of
fitnesses which will be taken into account in the simulations. The
selection according to these fitnesses can be applied at three levels:
at the level of the individual, at the level of the production of
gametes and at the level of the gametes themselves.
Selection is therefore genotypic in the first two cases (each genotype
is associated with a fitness value) and haplotypic in the third (each
haplotype is associated with a fitness value).
genome
a Genome
object
IDhaplotypes
IDs of haplotypes
IDgenotypes
IDs of genotypes
IDgenome
ID of the associated genome
nbHaplo
the number of haplotypes
nbGeno
the number of genotypes
gamFit
the list of gametes' fitness
indFit
the list of individuals' fitness
gamProdFit
the list of gamete production fitness
sOnInds
a logical indicating whether a selection on individuals has been configured by the user
sOnGams
a logical indicating whether a selection on gametes has been configured by the user
sOnGamsProd
a logical indicating whether a selection on gamete production has been configured by the user
Ehouarn Le Faou
Conversion of the factors of a selection formula into the list of corresponding allelic combinations
selection.form.treatment(factors, genomeObj = NULL, checking = FALSE)
selection.form.treatment(factors, genomeObj = NULL, checking = FALSE)
factors |
formula factors (right-hand members) |
genomeObj |
a |
checking |
logical indicating whether a test verifying the compatibility of input factors with the genome |
A list of vectors enumerating the allelic combinations that correspond to the factors
Ehouarn Le Faou
Generation of a genome class object from the list of haploid loci and diploid loci. Each loci is defined by a factor vector that enumerates its alleles.
setGenome(listHapLoci = list(), listDipLoci = list(), recRate = numeric())
setGenome(listHapLoci = list(), listDipLoci = list(), recRate = numeric())
listHapLoci |
a list of haploid loci |
listDipLoci |
a list of diploid loci |
recRate |
a two-by-two recombination rate vector |
A genome includes the list of all possible haplotypes and genotypes
resulting from the combination of the alleles defined in input.
As the Ease
package was originally built for population genetics
simulations including both diploid and haploid loci, it is necessary
that both types of loci are defined. Despite this, the user can define
only diploid or only haploid loci if they wish. If no diploid locus is
defined, one is automatically generated with only one allele, thus not
influencing the simulation. The same applies if no haploid locus is defined.
Each locus is described by a vector of factors which are the names of
the possible alleles at that locus. All diploid (resp. haploid) loci
thus defined are grouped in a list, called listDipLoci
(resp.
listHapLoci
). Therefore, a Genome
class object has two lists
of loci defined in this way, one for diploid loci, one for haploid loci.
The alleles and loci (diploid and haploid) must all have different
names so that no ambiguity can persist.
If several are defined, the order of the diploid loci in the list is not
trivial. The rates of two-to-one combinations between them must indeed be
defined by the vector recRate
. For example, if three diploid loci
are defined, recRate
must be of length 2, the first of its values
defining the recombination rate between the first and second loci, the
second of its values the recombination rate between the second and third
loci. For example, if we want to define two groups of two loci that are
linked to each other but are on two different chromosomes, we can define
a recRate = c(0.1, 0.5, 0.1)
. The first two loci are thus relatively
linked (recombination rate of 0.1), as are the last two loci. On the other
hand, the recombination rate of 0.5 between the second and third loci
ensures that the two groups are independent.
a Genome
object
Ehouarn Le Faou
DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL)
DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL)
A metapopulation is a set of population(s) (from 1) that are simulated with potential migration between them. Only genotypes can migrate, i.e. adult individuals.
setMetapopulation(populations, migMat = matrix(1))
setMetapopulation(populations, migMat = matrix(1))
populations |
a list of |
migMat |
a migration matrix |
The construction of a Metapopulation
object requires only two
arguments (one optional). The first is a population(s) list, defined
from the population class. The second is a migration matrix, which
connects the populations together. This matrix is a probability matrix
(square with the sum of the rows equal to 1, whose size is equal to the
number of populations) where each value corresponds to the proportion
of individuals (genotypes) that disperse from their source population
(row) to their target population (column).
a Metapopulation
object
Ehouarn Le Faou
# Definition of a population in its simplest form: DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) mutations <- list( mutation(from = "A", to = "a", rate = 1e-3), mutation(from = "B", to = "b", rate = 1e-3) ) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) pop <- setPopulation( name = "A", size = 1000, dioecy = TRUE, genomeObj = genomeObj, selectionObj = setSelectNeutral(genomeObj), mutMatrixObj = setMutationMatrix(genomeObj, mutations = mutations) ) metapop <- setMetapopulation(populations = list(pop)) metapop <- simulate(metapop, nsim = 10, seed = 123) # Other examples available in the documentation of the package
# Definition of a population in its simplest form: DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) mutations <- list( mutation(from = "A", to = "a", rate = 1e-3), mutation(from = "B", to = "b", rate = 1e-3) ) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) pop <- setPopulation( name = "A", size = 1000, dioecy = TRUE, genomeObj = genomeObj, selectionObj = setSelectNeutral(genomeObj), mutMatrixObj = setMutationMatrix(genomeObj, mutations = mutations) ) metapop <- setMetapopulation(populations = list(pop)) metapop <- simulate(metapop, nsim = 10, seed = 123) # Other examples available in the documentation of the package
Generation of the mutation matrix associated with the genome given as input.
A mutation matrix is used to simulate mutations that affect loci. An object
of the class MutationMatrix
does not only contain a (genotypic)
mutation matrix. It also contains the attributes necessary for the
construction and easy-to-read display of this matrix.
The mutation matrix itself is a square matrix of size equal to the number of
genotypes. It is a probability matrix in that the sum of the values in
each row is equal to 1. For a given genotype, the row associated with it
describes the probabilistic proportions that lead by mutation of this
genotype to the production of the other genotypes (and of itself if there
are no mutations).
setMutationMatrix(genomeObj, ...)
setMutationMatrix(genomeObj, ...)
genomeObj |
a |
... |
see details. |
There are three ways to define the mutation matrix associated with a
Genome
class object.
1) By giving two lists of allelic mutation matrices mutHapLoci
and
mutDipLoci
, for haploid and diploid loci respectively. Each of
these lists contains as many matrices as there are loci. These matrices
are transition matrices (squares, with the sum of the rows equal to 1)
of size equal to the number of alleles at the locus concerned.
2) By giving a forward and a backward allelic mutation rate
(forwardMut
and backwardMut
respectively). The generated
mutation matrices will thus be defined with the same rates for all loci. A
forward mutation rate means that the transition from one allele to another
is done in the order in which they were defined when the Genome class object
was created, and in the other direction for the backward rate.
3) By giving a list of mutations
generated through the
mutation function.
a MutationMatrix
object
Ehouarn Le Faou
### Example with two loci, each with two alleles ### # Definition of the genome DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) # Three ways to define the same mutation matrix associated with the # genome defined above: # 1) Mutation matrix from matrices mutHapLoci <- list(matrix(c(0.99, 0.01, 0.01, 0.99), 2)) mutDipLoci <- list(matrix(c(0.99, 0.01, 0.01, 0.99), 2)) # One can then define the MutationMatrix class object: setMutationMatrix(genomeObj, mutHapLoci = mutHapLoci, mutDipLoci = mutDipLoci ) # 2) Mutation matrix from mutation rates mutMatrixObj <- setMutationMatrix(genomeObj, forwardMut = 0.1) # or by adding a backward mutation rate: mutMatrixObj <- setMutationMatrix(genomeObj, forwardMut = 1e-3, backwardMut = 1e-4 ) # 3) Mutation matrix from single mutation definition mutMatrixObj <- setMutationMatrix(genomeObj, mutations = list( mutation(from = "A", to = "a", rate = 0.1), mutation(from = "B", to = "b", rate = 0.1) ) )
### Example with two loci, each with two alleles ### # Definition of the genome DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) # Three ways to define the same mutation matrix associated with the # genome defined above: # 1) Mutation matrix from matrices mutHapLoci <- list(matrix(c(0.99, 0.01, 0.01, 0.99), 2)) mutDipLoci <- list(matrix(c(0.99, 0.01, 0.01, 0.99), 2)) # One can then define the MutationMatrix class object: setMutationMatrix(genomeObj, mutHapLoci = mutHapLoci, mutDipLoci = mutDipLoci ) # 2) Mutation matrix from mutation rates mutMatrixObj <- setMutationMatrix(genomeObj, forwardMut = 0.1) # or by adding a backward mutation rate: mutMatrixObj <- setMutationMatrix(genomeObj, forwardMut = 1e-3, backwardMut = 1e-4 ) # 3) Mutation matrix from single mutation definition mutMatrixObj <- setMutationMatrix(genomeObj, mutations = list( mutation(from = "A", to = "a", rate = 0.1), mutation(from = "B", to = "b", rate = 0.1) ) )
Generation of a population by providing all the necessary ingredients for its definition, including a genome, a mutation matrix and a selection regime.
setPopulation( name, size, dioecy, genomeObj, mutMatrixObj, selectionObj, selfRate = 0, demography = F, growthRate = 0, initPopSize = NULL, initGenoFreq = NULL )
setPopulation( name, size, dioecy, genomeObj, mutMatrixObj, selectionObj, selfRate = 0, demography = F, growthRate = 0, initPopSize = NULL, initGenoFreq = NULL )
name |
the name of the population |
size |
the population size |
dioecy |
logical indicating whether the simulated population is dioecious or hermaphroditic |
genomeObj |
a |
mutMatrixObj |
a |
selectionObj |
a |
selfRate |
the selfing rate |
demography |
a logic indicating whether the population should have
a demography (stochasticity in the number of individuals present in the
population + logistic growth with carrying capacity equal to the |
growthRate |
a |
initPopSize |
the initial size of the population. It is necessarily
equal to |
initGenoFreq |
a vector of the size of the genotype number describing the initial allele frequencies common to all simulations |
A population is defined strictly by a name, a size, a sexual system (dioecy or hermaphodite), and the three objects defined previously: genome, mutation matrix and selection. In addition to that, it is possible to define - a selfing rate (by default equal to 0) - a vector of initial genotypic frequencies - a demography
Two demographic regimes are possible: no demography, i.e. a fixed population size, or demography, i.e. a population where the size fluctuates stochastically. The boolean argument 'demography' is used to define whether there should be stochasticity. For a fixed population size, it is therefore sufficient to define that 'demography = FALSE' (default) and to set the desired population size with the 'popSize' parameter.
For a fluctuating demography, 'demography' must be 'TRUE' and three other parameters are then needed: the initial population size ('initPopSize'), the population growth rate ('growthRate') and the carrying capacity of the population (the population size, 'popSize').
It is also possible to avoid defining a population size altogether, by setting off the genetic drift ('drift' parameter). This will allow the model to be simulated deterministically.
a Population
object
Ehouarn Le Faou
# Definition of a population in its simplest form: DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) mutations <- list( mutation(from = "A", to = "a", rate = 1e-3), mutation(from = "B", to = "b", rate = 1e-3) ) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) pop <- setPopulation( name = "A", size = 1000, dioecy = TRUE, genomeObj = genomeObj, selectionObj = setSelectNeutral(genomeObj), mutMatrixObj = setMutationMatrix(genomeObj, mutations = mutations) )
# Definition of a population in its simplest form: DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) mutations <- list( mutation(from = "A", to = "a", rate = 1e-3), mutation(from = "B", to = "b", rate = 1e-3) ) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) pop <- setPopulation( name = "A", size = 1000, dioecy = TRUE, genomeObj = genomeObj, selectionObj = setSelectNeutral(genomeObj), mutMatrixObj = setMutationMatrix(genomeObj, mutations = mutations) )
Generation of a neutral class Selection
object. It can be used as a
basis for adding selection layers with the setSelectOnInds
,
setSelectOnGametes
or setSelectOnGametesProd
functions, or
if the model is neutral.
setSelectNeutral(genomeObj)
setSelectNeutral(genomeObj)
genomeObj |
a |
An object of type Selection
is an object which describes the set of
fitnesses which will be taken into account in the simulations. The
selection according to these fitnesses can be applied at three levels:
at the level of the individual, at the level of the production of
gametes and at the level of the gametes themselves.
Selection is therefore genotypic in the first two cases (each genotype
is associated with a fitness value) and haplotypic in the third (each
haplotype is associated with a fitness value).
a Selection
object
Ehouarn Le Faou
### Example with two loci, each with two alleles ### # Definition of the diploid locus DL <- list(dl = c("A", "a")) # Definition of the haploid locus HL <- list(hl = c("B", "b")) # Definition of the object of Genome class genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) genomeObj ### Exemple with more diploid loci ### # Definition of the diploid loci DL <- list( dl1 = c("A", "a"), dl2 = c("B", "b"), dl3 = c("C", "c") ) # Definition of the haploid locus HL <- list(hl = c("D", "d")) # Definition of the object of Genome class, with in addition the necessary # definition of recombination rates between loci: genomeObj <- setGenome( listHapLoci = HL, listDipLoci = DL, recRate = c(0.1, 0.5) ) # Here we have a 0.1 recombination rate between dl1 and dl2 and a 0.5 # recombination rate between dl2 and dl3. It is as if dl1 and dl2 were linked, # for example on the same chromosome, and that dl2 (and dl1 by consequence) # and dl3 were independent, for example on different chromosomes. genomeObj
### Example with two loci, each with two alleles ### # Definition of the diploid locus DL <- list(dl = c("A", "a")) # Definition of the haploid locus HL <- list(hl = c("B", "b")) # Definition of the object of Genome class genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) genomeObj ### Exemple with more diploid loci ### # Definition of the diploid loci DL <- list( dl1 = c("A", "a"), dl2 = c("B", "b"), dl3 = c("C", "c") ) # Definition of the haploid locus HL <- list(hl = c("D", "d")) # Definition of the object of Genome class, with in addition the necessary # definition of recombination rates between loci: genomeObj <- setGenome( listHapLoci = HL, listDipLoci = DL, recRate = c(0.1, 0.5) ) # Here we have a 0.1 recombination rate between dl1 and dl2 and a 0.5 # recombination rate between dl2 and dl3. It is as if dl1 and dl2 were linked, # for example on the same chromosome, and that dl2 (and dl1 by consequence) # and dl3 were independent, for example on different chromosomes. genomeObj
Generation of an object of the Selection
class which defines a
selection among the individuals either by adding this type of selection
to an already existing SelectionObj
object (parameter
selectionObj
) or by creating one.
setSelectOnGametes( genomeObj = NULL, gamFit = c(), femaleFit = c(), maleFit = c(), selectionObj = NULL )
setSelectOnGametes( genomeObj = NULL, gamFit = c(), femaleFit = c(), maleFit = c(), selectionObj = NULL )
genomeObj |
a |
gamFit |
an haplotypic fitness vector for all individuals |
femaleFit |
an haplotypic fitness vector for females only |
maleFit |
an haplotypic fitness vector for males only |
selectionObj |
a |
a Selection
object
Ehouarn Le Faou
DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) selectionObj <- setSelectOnGametes( genomeObj = genomeObj, gamFit = c(1, 1, 0.5, 0) )
DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) selectionObj <- setSelectOnGametes( genomeObj = genomeObj, gamFit = c(1, 1, 0.5, 0) )
Generation of an object of the Selection
class which defines a
selection on the gamete production either by adding this type of selection
to an already existing SelectionObj
object (parameter
selectionObj
) or by creating one.
setSelectOnGametesProd( genomeObj = NULL, indProdFit = c(), femProdFit = c(), maleProdFit = c(), selectionObj = NULL )
setSelectOnGametesProd( genomeObj = NULL, indProdFit = c(), femProdFit = c(), maleProdFit = c(), selectionObj = NULL )
genomeObj |
a |
indProdFit |
a genotypic fitness vector for all individuals |
femProdFit |
a genotypic fitness vector for females only |
maleProdFit |
a genotypic fitness vector for males only |
selectionObj |
a |
a Selection
object
Ehouarn Le Faou
DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) selectionObj <- setSelectOnGametesProd( genomeObj = genomeObj, indProdFit = c(1, 1, 1, 1, 0.5, 0) )
DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) selectionObj <- setSelectOnGametesProd( genomeObj = genomeObj, indProdFit = c(1, 1, 1, 1, 0.5, 0) )
Generation of an object of the Selection
class which defines a
selection among the individuals either by adding this type of selection
to an already existing SelectionObj
object (parameter
selectionObj
) or by creating one.
setSelectOnInds( genomeObj = NULL, indFit = c(), femaleFit = c(), maleFit = c(), selectionObj = NULL )
setSelectOnInds( genomeObj = NULL, indFit = c(), femaleFit = c(), maleFit = c(), selectionObj = NULL )
genomeObj |
a |
indFit |
a genotypic fitness vector for all individuals (whether or not they are hermaphordite) |
femaleFit |
a genotypic fitness vector for females only (only if the population is dioecious) |
maleFit |
a genotypic fitness vector for males only (only if the population is dioecious) |
selectionObj |
a |
a Selection
object
Ehouarn Le Faou
DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) selectionObj <- setSelectOnInds( genomeObj = genomeObj, indFit = c(1, 1, 1, 1, 0.5, 0) )
DL <- list(dl = c("A", "a")) HL <- list(hl = c("B", "b")) genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL) selectionObj <- setSelectOnInds( genomeObj = genomeObj, indFit = c(1, 1, 1, 1, 0.5, 0) )
Genome
classShow method for the Genome
class
## S4 method for signature 'Genome' show(object)
## S4 method for signature 'Genome' show(object)
object |
a |
No return value, only a display.
Ehouarn Le Faou
Metapopulation
classShow method for the Metapopulation
class
## S4 method for signature 'Metapopulation' show(object)
## S4 method for signature 'Metapopulation' show(object)
object |
a |
Ehouarn Le Faou
MutationMatrix
classShow method for the MutationMatrix
class
## S4 method for signature 'MutationMatrix' show(object)
## S4 method for signature 'MutationMatrix' show(object)
object |
a |
No return value, only a display.
Ehouarn Le Faou
Population
classShow method for the Population
class
## S4 method for signature 'Population' show(object)
## S4 method for signature 'Population' show(object)
object |
a |
Ehouarn Le Faou
Selection
classShow method for the Selection
class
## S4 method for signature 'Selection' show(object)
## S4 method for signature 'Selection' show(object)
object |
a |
No return value, only a display.
Ehouarn Le Faou
Metapopulation
classPerforming simulations of an Metapopulation object. The returned object is the same Metapopulation object completed with the results and records if they have been activated.
## S4 method for signature 'Metapopulation' simulate( object, nsim = 1, seed = NULL, threshold = 500, includefreqGeno = TRUE, recording = FALSE, recordGenGap = 1, drift = TRUE, includeParams = TRUE, includeFitness = TRUE, verbose = FALSE, stopCondition = list(), nameOutFunct = "outFunct" )
## S4 method for signature 'Metapopulation' simulate( object, nsim = 1, seed = NULL, threshold = 500, includefreqGeno = TRUE, recording = FALSE, recordGenGap = 1, drift = TRUE, includeParams = TRUE, includeFitness = TRUE, verbose = FALSE, stopCondition = list(), nameOutFunct = "outFunct" )
object |
a |
nsim |
the number of simulation to perform |
seed |
the RNG seed to be fixed (allows exact reproduction of results) |
threshold |
maximum duration of a simulation (in generations) |
includefreqGeno |
a logical indicating whether to include genotype frequencies in the results |
recording |
a logical indicating whether to record all mutations, i.e. to record allelic and genotypic frequencies along the simulations |
recordGenGap |
the number of generations between two records during simulation, if the record parameter is TRUE. Whatever the value of this parameter, both the first and the last generation will be included in the record |
drift |
a logical indicating whether genetic drift should be considered (i.e. whether deterministic simulations are performed or not) |
includeParams |
a logical indicating whether the parameters should be included in the result data.frame (can be useful when compiling multiple result tables) |
includeFitness |
a logical indicating whether the mean fitness should be included in the result data.frame (can be useful when compiling multiple result tables) |
verbose |
logical determining if the progress of the simulations should be displayed or not (useful in case of many simulations) |
stopCondition |
list of vectors that each describe the allele(s) that must be fixed to define a stop condition. Each of these vectors will therefore be associated with a stop condition |
nameOutFunct |
name of the custom output function. This function is called each generation in each population of a simulation and systematically returns a list with the first element being a logic that indicates whether something should be saved. If so, the second element of this list will be saved.If the customOutFunct parameter is null (default), there will be no custom output. |
An Metapopulation
object from which we can now extract the results
(or the records if recording = TRUE) with the getResults and getRecords
functions.
Ehouarn Le Faou
Determine which alleles are at least once input as homozygous in the formula.
whichHomoz(formula)
whichHomoz(formula)
formula |
a selection formula |
the enumeration of alleles that appear at least once homozygous
Ehouarn Le Faou