makeSingleCross | R Documentation |
Cross two individuals together
makeSingleCross(ind1, ind2, names, n = 1, verbose = TRUE)
ind1 |
parent 1 |
ind2 |
parent 2 |
names |
names of the descendants |
n |
number of descendants |
verbose |
print informations |
list of new individuals
### 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),
recombRateOneVal = FALSE,
effPopSize = 3,
simInfo = mySimInfo,
verbose = TRUE)
### create lociInfo object
myLoci <- lociInfo$new(genoMap = NULL, specie = mySpec)
### simulate haplotype
rawHaplo1 <- matrix(sample(c(0, 1), (3 + 4 + 5) * 2, replace = TRUE),
nrow = 2)
colnames(rawHaplo1) <- paste0("Locus_", 1:(3 + 4 + 5))
myHaplo1 <- myBreedSimulatR::haplotype$new(lociInfo = myLoci,
haplo = rawHaplo1)
rawHaplo2 <- matrix(sample(c(0, 1), (3 + 4 + 5) * 2, replace = TRUE),
nrow = 2)
colnames(rawHaplo2) <- paste0("Locus_", 1:(3 + 4 + 5))
myHaplo2 <- myBreedSimulatR::haplotype$new(lociInfo = myLoci,
haplo = rawHaplo2)
### create individuals:
myInd1 <- individual$new(name = "Ind 1",
specie = mySpec,
parent1 = "OkaaSan1",
parent2 = "OtouSan1",
haplo = myHaplo1,
verbose = TRUE)
myInd2 <- individual$new(name = "Ind 2",
specie = mySpec,
parent1 = "OkaaSan2",
parent2 = "OtouSan2",
haplo = myHaplo2,
verbose = TRUE)
offspring <- makeSingleCross(myInd1, myInd2, names = "off 1")
offspring
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.