initScheme | R Documentation |
GBScleanR uses breeding scheme information to set the expected
number of cross overs in a chromosome which is a required parameter
for the genotype error correction with the hidden Markov model
implemented in the estGeno()
function.
This function build the object storing
type crosses performed at each generation of breeding and population sizes.
initScheme(object, mating, ...)
## S4 method for signature 'GbsrGenotypeData'
initScheme(object, mating)
## S4 method for signature 'GbsrScheme'
initScheme(object, mating, parents)
object |
A GbsrGenotypeData object. |
mating |
An integer matrix to indicate mating combinations. The each element should match with IDs of parental samples which are 1 to N. see Details. |
... |
Unused. |
parents |
Indices of parental lines. |
A GbsrScheme object stores information of a population size,
mating combinations and
a type of cross applied to each generation of the breeding process
to generate the population which you are going to subject
to the estGeno()
function.
The first generation should be parents of the population.
It is supposed that
setParents()
has been already executed and parents
are labeled in the
GbsrGenotypeData object. The number of parents
are automatically recognized.
The "crosstype" of the first generation can be
"pairing" or "random" with
pop_size = N
, where N is the number of parents.
You need to specify a matrix indicating combinations
of mating
, in which each column shows
a pair of parental samples. For example, if you have
only two parents, the mating
matrix
is mating = cbind(c(1:2))
. The indices used in the matrix
should match with the IDs labeled to parental samples by setParents()
.
The created GbsrScheme object is set
in the scheme
slot of the GbsrGenotypeData object.
A GbsrGenotypeData object storing a GbsrScheme object in the "scheme" slot.
addScheme()
and showScheme()
# Load data in the GDS file and instantiate a [GbsrGenotypeData] object.
gds_fn <- system.file("extdata", "sample.gds", package = "GBScleanR")
gds <- loadGDS(gds_fn)
# Biparental F2 population.
gds <- setParents(gds, parents = c("Founder1", "Founder2"))
# setParents gave member ID 1 and 2 to Founder1 and Founder2, respectively.
gds <- initScheme(gds, mating = cbind(c(1:2)))
# Now the progenies of the cross above have member ID 3.
# If `crosstype = "selfing"` or `"sibling"`, you can omit a `mating` matrix.
gds <- addScheme(gds, crosstype = "self")
# Now you can execute `estGeno()` which requires a [GbsrScheme] object.
# Close the connection to the GDS file
closeGDS(gds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.