Description Usage Arguments Details Value Note Author(s) See Also Examples
View source: R/create.gpData.r
This function combines all raw data sources in a single, unified data object
of class gpData. This is a list with elements for phenotypic,
genotypic, marker map, pedigree and further covariate data. All elements are
optional.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
pheno |
|
geno |
|
map |
|
pedigree |
Object of class |
family |
|
covar |
|
reorderMap |
|
map.unit |
|
repeated |
This column is used to identify the replications of the
phenotypic values. The unique values become the names of the third dimension
of the pheno object in the |
modCovar |
|
na.string |
|
cores |
|
The class gpData is designed to provide a unified framework for data
related to genomic prediction analysis. Every data source can be omitted. In
this case, the corresponding argument must be NULL. By default
(argument reorderMap), markers in geno are ordered by their
position in map. Individuals are ordered in alphabetical order.
An object of class gpData can contain different subsets of
individuals or markers in the elements pheno, geno and
pedigree. In this case the id in covar comprises all
individuals that either appear in pheno, geno and
pedigree. Two additional columns in covar named
phenotyped and genotyped are automatically generated to
identify individuals that appear in the corresponding gpData object.
Object of class gpData which is a list with the
following elements
covar |
|
pheno |
|
geno |
|
pedigree |
object of class |
map |
|
phenoCovars |
|
info |
|
In case of missing row names or column names in one item, information is substituted from other elements (assuming the same order of individuals/markers) and a warning specifying the assumptions is returned. Please check them carefully.
Valentin Wimmer and Hans-Juergen Auinger with contributions be Peter VandeHaar
codeGeno, summary.gpData,
gpData2data.frame
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 | set.seed(123)
# 9 plants with 2 traits
n <- 9 # only for n > 6
pheno <- data.frame(Yield = rnorm(n, 200, 5), Height = rnorm(n, 100, 1))
rownames(pheno) <- letters[1:n]
# marker matrix
geno <- matrix(sample(c("AA", "AB", "BB", NA),
size = n * 12, replace = TRUE,
prob = c(0.6, 0.2, 0.1, 0.1)
), nrow = n)
rownames(geno) <- letters[n:1]
colnames(geno) <- paste("M", 1:12, sep = "")
# genetic map
# one SNP is not mapped (M5) and will therefore be removed
map <- data.frame(chr = rep(1:3, each = 4), pos = rep(1:12))
map <- map[-5, ]
rownames(map) <- paste("M", c(1:4, 6:12), sep = "")
# simulate pedigree
ped <- simul.pedigree(3, c(3, 3, n - 6))
# combine in one object
gp <- create.gpData(pheno, geno, map, ped)
summary(gp)
# 9 plants with 2 traits , 3 replications
n <- 9 #
pheno <- data.frame(
ID = rep(letters[1:n], 3), rep = rep(1:3, each = n),
Yield = rnorm(3 * n, 200, 5), Height = rnorm(3 * n, 100, 1)
)
# combine in one object
gp2 <- create.gpData(pheno, geno, map, repeated = "rep")
summary(gp2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.