haplotype | R Documentation |
haplotype object store specific information of individuals haplotype
lociInfo
[lociInfo class] information about the haplotype of the SNPs (see:lociInfo)
values
[list] list haplotype values
allelDose
[numeric] vector of haplotypes encoded in allele dose
new()
Create a new Haplotype object.
haplotype$new(lociInfo, haplo)
lociInfo
[lociInfo class] information about the haplotype's SNPs (see:lociInfo)
haplo
[matrix] named matrix of the genotype for all markers
A new 'lociInfo' 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, recombRateOneVal = FALSE, 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) ### simulate haplotype rawHaplo <- matrix(sample(c(0, 1), (3 + 4 + 5) * 3, replace = TRUE), nrow = 2) colnames(rawHaplo) <- paste0("Locus_", 1:(3 + 4 + 5)) myHaplo <- myBreedSimulatR::haplotype$new(lociInfo = myLoci, haplo = rawHaplo) myHaplo$values
clone()
The objects of this class are cloneable with this method.
haplotype$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------
## Method `haplotype$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,
recombRateOneVal = FALSE,
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)
### simulate haplotype
rawHaplo <- matrix(sample(c(0, 1), (3 + 4 + 5) * 3, replace = TRUE),
nrow = 2)
colnames(rawHaplo) <- paste0("Locus_", 1:(3 + 4 + 5))
myHaplo <- myBreedSimulatR::haplotype$new(lociInfo = myLoci,
haplo = rawHaplo)
myHaplo$values
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.