Description Usage Arguments Details Value Note Author(s) See Also Examples
A generic function to create various kinds of genomic design matrices, for estimation of substitution effects, additive and dominance effects or genome specific effects of SNPs
1 2 3 | hypredCode(object, ...)
## S4 method for signature 'hypredGenome'
hypredCode(object, genotypes, DH, type)
|
object |
an object of a class that holds information on genome
parameters necessary to create design matrices, typically an
|
genotypes |
Integer matrix giving the genotypes of the
individuals (as a series of 1s and 0s). If |
DH |
logical argument indicating if one row in the matrix given to |
type |
character string giving the type of design matrix to
create |
... |
Methods may require further arguments. |
The SNP loci that represent QTL are not included in the design matrices, exept when they are perfect markers.
Description of different design matrices, (N = number of individuals (observations), M = number of markers), (sub)matrices that code additive effects are denoted as X, (sub)matrices that code dominance effects are denoted as W. i indexes the individual, j the marker locus.
type = "012"
Standard design matrix for estimation of substitution effects. X has dimensions [N, M]. x_{ij} = 2 if the locus is 11, x_{ij} = 1 if the locus is 10(01) and x_{ij} = 0 if the locus is 00.
type = "-101"
Design matrix for estimation of substitution effects. X has dimensions [N, M].x_{ij} = 1 if the locus is 11, x_{ij} = 0 if the locus is 10(01) and x_{ij} = -1 if the locus is 00.
type = "Xu2003"
Design matrix for estimation of additive and dominance effects. The matrix is partitioned as [\eqn{X} \eqn{W}]. The dimensions of X and W are [N, M]. x_{ij} = √{2} and w_{ij} = -1 if the locus is 11, x_{ij} = 0 and w_{ij} = 1 if the locus is 10(01), x_{ij} = -√{2} and w_{ij} = -1 if the locus is 00. This is the coding scheme used by Xu (2003).
type = "genome.specific"
Design matrix for estimation of genome specific additive and dominance effects. The matrix is partitioned as [\eqn{X(1)} \eqn{X(2)} \eqn{W(1)} \eqn{W}(2)]. The dimensions of each submatrix are [N, M]. X(1) and W(1) code the additive and dominance effects of genome 1, X(2) and W(2) code the additive and dominance effects of genome 2. An element of X(1) or X(2) is 1 if a 1 allele is contributed by the respective genome, else it is zero. x(1)_{ij} = 1 if a 1 allele at the locus is contributed by genome 1, x(1)_{ij} = 0 if not, same for genome 2. w(1)_{ij} = 1 if the locus is heterozygous and the 1 allele comes from genome 1, else w(1)_{ij} = 0, same for genome 2.
Example:
x(1)_{ij} = 1, x(2)_{ij} = 0, w(1)_{ij} = 1 and w(2)_{ij} = 0
for the genotype 01, x(1)_{ij} = 0, x(2)_{ij} = 1, w(1)_{ij} = 0 and w(2)_{ij} = 1
for the genotype 11, x(1)_{ij} = 1, x(2)_{ij} = 1, w(1)_{ij} = 0 and w(2)_{ij} = 0
for the genotype 00, x(1)_{ij} = 0, x(2)_{ij} = 0, w(1)_{ij} = 0 and w(2)_{ij} = 0
For this to work, all odd rows in the matrix given to
genotypes
must belong to genome 1 and all even rows to
genome 2. If this is not the case, results will be nonsense!
The desired design matrix, whose dimensions depend on
type
. The column names of the matrix correspond to the loci IDs
The function calls the C routine hypredCode_FUN_dom
to code
the "Xu2003" type matrix.
Frank Technow
The function hypredRecombine
which is used to
create progeny genomes, the function hypredNewQTL
which
allows to assign new QTLs to the "hypredGenome"
object and the function hypredTruePerformance
which
determines the standart, non-genome-specific values.
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | ## one chromosome of length 1 M and 5 SNP
genomeDef <- hypredGenome(1, 1.0, 5)
## assign one QTL with and additive effect of 1 to the first locus
genomeDef <- hypredNewQTL(genomeDef,
new.id.add = 1,
new.eff.add = 1)
summary(genomeDef)
## produce two haploid founder line genomes
founder <- hypredFounder(genomeDef,1)
founder
## produce two progeny from a cross between the two
## (this corresponds to F2 individuals)
set.seed(134)
gamete1 <- hypredRecombine(genomeDef,
genomeA = founder[1,],
genomeB = founder[2,],
mutate = FALSE,
block = FALSE)
gamete2 <- hypredRecombine(genomeDef,
genomeA = founder[1,],
genomeB = founder[2,],
mutate = FALSE,
block = FALSE)
gamete3 <- hypredRecombine(genomeDef,
genomeA = founder[1,],
genomeB = founder[2,],
mutate = FALSE,
block = FALSE)
gamete4 <- hypredRecombine(genomeDef,
genomeA = founder[1,],
genomeB = founder[2,],
mutate = FALSE,
block = FALSE)
F2 <- rbind(gamete1, gamete2, gamete3, gamete4)
print(F2)
## type "012" matrix
mat012 <- hypredCode(genomeDef,
genotypes = F2,
DH = FALSE,
type = "012")
## note that loci 1 is not included
print(mat012)
## type "genome.specific" matrix
matGS <- hypredCode(genomeDef,
genotypes = F2,
DH = FALSE,
type = "genome.specific")
## note that loci 1 is not included
print(matGS)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.