Description Usage Arguments Details Value Examples
View source: R/in_silico_population.R
Creates a in silico individual to be simulated (object of class insilicoindividual
).
1 2 3 4 5 6 7 8 | createIndividual(
insilicosystem,
variantsList,
variantsFreq,
indargs,
InitVar = NULL,
initialNoise = TRUE
)
|
insilicosystem |
An |
variantsList |
A named list giving the variants segregating in the population for each gene (e.g. created by |
variantsFreq |
A named list giving for each gene the allelic frequency of each segregating variant. Each element corresponds to one gene in the system (name of the element = gene ID). Each element is a vector, of length equal to the number of variants of the gene segregating in the population, giving the allele frequency of each of the variants. |
indargs |
An object of class |
InitVar |
A list of the multiplicative coefficients to be applied to the initial abundance of the different molecules: elements "R" and "P" of the list giving the coefficients for the RNA
and protein form of the genes, respectively (coefficient for gene |
initialNoise |
Logical. Is stochastic noise applied to the initial abundance of the different molecules? Default value is |
initialNoise: by default, the initial abundance of a molecule is equal to its steady state abundance in the absence of any regulation
(e.g. for the RNA abundance of a gene, it is transcription rate / decay rate). If initialNoise = TRUE
, instead the initial abundance of the
molecule will be sampled from a truncated Normal distribution of mean SSabund
and SD sqrt(SSabund)
, where SSabund
is its
steady state abundance in the absence of any regulation, as specified above. The Normal distribution is truncated to only return positive values.
An object of class insilicoindividual
, that is a list composed of:
QTLeffects
: a list of the variants carried by the individual. 1st level of the list: the different "GCN" (Gene Copy Number),
that is the different alleles of the genes (as defined by the ploidy of the individual: a diploid will have GCN1 and GCN2); 2nd level: the different QTL effect coefficients. The elements
in this 2nd-level list are vectors of QTL effect coefficients for the different genes (coefficient for gene i
at the i
-th position
in the vector).
haplotype
: data-frame (rows = genes, columns = Gene copy number) giving the ID of the gene variant carried by the individual for each gene copy number (allele).
InitAbundance
: A list of the initial abundance of the different molecules. 1st level of the list: the different "GCN" (Gene Copy Number),
that is the different alleles of the genes (as defined by the ploidy of the individual: a diploid will have GCN1 and GCN2); 2nd level of the list:
initial abundance of the protein ("P") and RNA ("R") form of the genes (coefficient for gene i
at the i
-th position in the vectors).
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 35 36 37 | mysystem = createInSilicoSystem(G = 3, ploidy = 4)
indargs = insilicoindividualargs()
## 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) = 1:length(nbvariants)
## 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))
myind = createIndividual(mysystem, genvariants, genvariants.freq, indargs, InitVar = InitVar)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.