# NOT RUN {
## Creating a first population with 3 diploid individuals,
## with 2 variants of each gene segregating in the population
mysystem = createInSilicoSystem(G = 6, ploidy = 2)
mypop1 = createInSilicoPopulation(nInd = 3, mysystem, ngenevariants = 2)
## Creating a population with 10 tetraploid individuals
mysystem = createInSilicoSystem(G = 6, ploidy = 4)
mypop2 = createInSilicoPopulation(nInd = 10, mysystem)
## Creating a population with a given list of gene variants
mysystem = createInSilicoSystem(G = 3, PC.p = 1, ploidy = 2)
## We will create only 1 variant of gene 1, 3 variants of gene 2 and
## 2 variants of gene 3
nbvariants = c(1, 3, 2)
qtlnames = c("qtlTCrate", "qtlRDrate",
"qtlTCregbind", "qtlRDregrate",
"qtlactivity", "qtlTLrate",
"qtlPDrate", "qtlTLregbind",
"qtlPDregrate", "qtlPTMregrate")
genvariants = lapply(nbvariants, function(x){
matrix(1, nrow = length(qtlnames), ncol = x,
dimnames = list(qtlnames, 1:x))
})
names(genvariants) = mysystem$genes$id
## the 2nd variant of gene 2 has a mutation reducing its transcription rate by 3
genvariants$`2`["qtlTCrate", 2] = 0.33
## and the 3rd variant has an increased translation rate
genvariants$`2`["qtlTLrate", 2] = 1.5
## The 2nd variant of gene 3 has a mutation decreasing the activity of
## its active product
genvariants$`3`["qtlactivity", 2] = 0.7
## Allelic frequency of each variant
genvariants.freq = list('1' = c(1),
'2' = c(0.6, 0.3, 0.1),
'3' = c(0.9, 0.1))
## The third gene is not expressed at the beginning of the simulation
## (its initial abundance is 0)
InitVar = list("R" = c(1, 1, 0), "P" = c(1, 1, 0))
mypop = createInSilicoPopulation(10, mysystem,
genvariants = genvariants,
genvariants.freq = genvariants.freq,
InitVar = InitVar)
# }
Run the code above in your browser using DataLab