individual | R Documentation |
individual object store specific information about one individual
name
[string] Name of the individual
specie
[specie class] Specie of the SNPs (see:specie)
traitInfo
[traitInfo class] Specific information of traits (see:traitInfo)
parent1
[string] Name of the individual's parent
parent2
[string] Name of the individual's parent
haplo
[haplotype class] Haplotype of the individual (see: haplotype)
trueAGVs
[numeric] true additive genotypic values
trueAGVETs
[numeric] true additive genotypic values specific to each trait
trueAGVCTs
[numeric] true additive genotypic values common across traits
trueDGVs
[numeric] true dominant genotypic values
trueDGVETs
[numeric] true dominance genotypic values specific to each trait
trueDGVCTs
[numeric] true dominant genotypic values common across traits
trueEGVs
[numeric] true epistatic genotypic values
trueEGVETs
[numeric] true epistatic genotypic values between effects specific to each trait
trueEGVCTs
[numeric] true epistatic genotypic values between effects common across each trait
trueGVs
[numeric] true genotypic values
trueGVETs
[numeric] true genotypic values specific to each trait
trueGVCTs
[numeric] true genotypic values common across trait
new()
Create a new individual object.
individual$new( name = "Unnamed", specie = specie$new(), traitInfo = NULL, parent1 = NA, parent2 = NA, haplo = NULL, verbose = TRUE )
name
[string] name of the individual
specie
[specie class] Specie of the SNPs (see:specie)
traitInfo
[traitInfo class] Specific information of traits (see:traitInfo)
parent1
[string] Name of the individual's parent
parent2
[string] Name of the individual's parent
haplo
[haplotype class] Haplotype of the individual (see: haplotype)
verbose
[boolean] display information
A new 'individual' object.
### create simulation information mySimInfo <- simInfo$new(simName = "Simulation Example", simGeno = TRUE, simPheno = TRUE, nSimGeno = 1, nSimPheno = 3, nCoreMax = 4, nCorePerGeno = 1, nCorePerPheno = 3, saveDataFileName = NULL) ### create specie information mySpec <- specie$new(nChr = 3, lChr = c(100, 150, 200), specName = "Example 1", ploidy = 2, mutRate = 10^-8, recombRate = 10^-6, chrNames = c("C1", "C2", "C3"), nLoci = c(3, 4, 5), effPopSize = 3, simInfo = mySimInfo, verbose = TRUE) ### create lociInfo object myLoci <- lociInfo$new(genoMap = NULL, specie = mySpec) ### create traitInfo object myTrait <- traitInfo$new(lociInfo = myLoci, nMarkers = c(2, 4, 3), nTraits = 2, nQTLs = matrix(c(1, 0, 2, 1, 0, 1), nrow = 2, byrow = TRUE), actionTypeEpiSimple = TRUE, qtlOverlap = TRUE, nOverlap = c(1, 0, 1), effCor = 0.6, propDomi = 0.2, interactionMean = c(1, 0)) plot(myTrait, alphaMarker = 0.4) ### simulate haplotype rawHaplo <- matrix(sample(c(0, 1), (3 + 4 + 5) * 2, replace = TRUE), nrow = 2) colnames(rawHaplo) <- paste0("Locus_", 1:(3 + 4 + 5)) haplo <- myBreedSimulatR::haplotype$new(lociInfo = myLoci, haplo = rawHaplo) ### create individuals: myInd <- individual$new(name = "Ind 1", specie = myTrait$lociInfo$specie, traitInfo = myTrait, parent1 = "OkaaSan", parent2 = "OtouSan", haplo = myHaplo, verbose = TRUE)
generateGametes()
Generate Gametes
individual$generateGametes(n = 1)
n
[float] number of gametes to create (default: 1)
list of gametes. A gamete is a named vectors with value 0 or 1.
myInd$generateGametes() myInd$generateGametes(2)
clone()
The objects of this class are cloneable with this method.
individual$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------
## Method `individual$new`
## ------------------------------------------------
### create simulation information
mySimInfo <- simInfo$new(simName = "Simulation Example",
simGeno = TRUE,
simPheno = TRUE,
nSimGeno = 1,
nSimPheno = 3,
nCoreMax = 4,
nCorePerGeno = 1,
nCorePerPheno = 3,
saveDataFileName = NULL)
### create specie information
mySpec <- specie$new(nChr = 3,
lChr = c(100, 150, 200),
specName = "Example 1",
ploidy = 2,
mutRate = 10^-8,
recombRate = 10^-6,
chrNames = c("C1", "C2", "C3"),
nLoci = c(3, 4, 5),
effPopSize = 3,
simInfo = mySimInfo,
verbose = TRUE)
### create lociInfo object
myLoci <- lociInfo$new(genoMap = NULL, specie = mySpec)
### create traitInfo object
myTrait <- traitInfo$new(lociInfo = myLoci,
nMarkers = c(2, 4, 3),
nTraits = 2,
nQTLs = matrix(c(1, 0, 2,
1, 0, 1),
nrow = 2,
byrow = TRUE),
actionTypeEpiSimple = TRUE,
qtlOverlap = TRUE,
nOverlap = c(1, 0, 1),
effCor = 0.6,
propDomi = 0.2,
interactionMean = c(1, 0))
plot(myTrait, alphaMarker = 0.4)
### simulate haplotype
rawHaplo <- matrix(sample(c(0, 1), (3 + 4 + 5) * 2, replace = TRUE),
nrow = 2)
colnames(rawHaplo) <- paste0("Locus_", 1:(3 + 4 + 5))
haplo <- myBreedSimulatR::haplotype$new(lociInfo = myLoci,
haplo = rawHaplo)
### create individuals:
myInd <- individual$new(name = "Ind 1",
specie = myTrait$lociInfo$specie,
traitInfo = myTrait,
parent1 = "OkaaSan", parent2 = "OtouSan",
haplo = myHaplo, verbose = TRUE)
## ------------------------------------------------
## Method `individual$generateGametes`
## ------------------------------------------------
myInd$generateGametes()
myInd$generateGametes(2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.