hypredCode: Create various genomic design matrices

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

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

Usage

1
2
3
hypredCode(object, ...)
## S4 method for signature 'hypredGenome'
hypredCode(object, genotypes, DH, type)

Arguments

object

an object of a class that holds information on genome parameters necessary to create design matrices, typically an "hypredGenome" object.

genotypes

Integer matrix giving the genotypes of the individuals (as a series of 1s and 0s). If DH = FALSE, always two adjacent rows stand for one individual (the two chromosome sets). If DH = TRUE, always one row stands for one individual, since then the chromosome sets are identical copies of each other.

DH

logical argument indicating if one row in the matrix given to genotypes belongs to one DH line, i.e. completely homozygous line (TRUE) or if two adjacent rows belong to one, DH or not, individual (FALSE).

type

character string giving the type of design matrix to create c("012", "-101", "Xu2003", "genome.specific"), see the Details section. "genome.specific" can only be used when all odd rows in the matrix given to genotypes belong to genome 1 and all even rows to genome 2!

...

Methods may require further arguments.

Details

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:

genotype 10

x(1)_{ij} = 1, x(2)_{ij} = 0, w(1)_{ij} = 1 and w(2)_{ij} = 0

genotype 01

for the genotype 01, x(1)_{ij} = 0, x(2)_{ij} = 1, w(1)_{ij} = 0 and w(2)_{ij} = 1

genotype 11

for the genotype 11, x(1)_{ij} = 1, x(2)_{ij} = 1, w(1)_{ij} = 0 and w(2)_{ij} = 0

genotype 00

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!

Value

The desired design matrix, whose dimensions depend on type. The column names of the matrix correspond to the loci IDs

Note

The function calls the C routine hypredCode_FUN_dom to code the "Xu2003" type matrix.

Author(s)

Frank Technow

See Also

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.

Examples

 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)

timflutre/hypred documentation built on May 6, 2019, 10:51 a.m.