add.markers: Add new markers to an object of class gpData

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

View source: R/add.markers.r

Description

This function adds new markers to the element geno of an object of class gpData and updates the marker map.

Usage

1
add.markers(gpData, geno, map = NULL)

Arguments

gpData

object of class gpData to be updated

geno

matrix with new columns

map

data.frame with columns 'chr' and 'pos' for new markers

Details

rownames in argument geno must match rownames in the element geno object of class gpData.

Value

object of class gpData with new markers

Author(s)

Valentin Wimmer

See Also

add.individuals, discard.markers

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
# creating gpData object
# phenotypic data
pheno <- data.frame(Yield = rnorm(10, 100, 5), Height = rnorm(10, 10, 1))
rownames(pheno) <- 1:10
# genotypic data
geno <- matrix(sample(c(1, 0, 2, NA),
  size = 120, replace = TRUE,
  prob = c(0.6, 0.2, 0.1, 0.1)
), nrow = 10)
rownames(geno) <- 1:10
# genetic map
map <- data.frame(chr = rep(1:3, each = 4), pos = rep(1:12))
colnames(geno) <- rownames(map) <- paste("M", 1:12, sep = "")
# as gpData object
gp <- create.gpData(pheno, geno, map)


# new data
geno2 <- matrix(c(0, 0, 1, 1, 1, 2, 2, 1, 1, 2, 1, 2, 0, 2, 1, 1, 1, 2, 2, 2), ncol = 2)
rownames(geno2) <- 1:10
map2 <- data.frame(pos = c(0.3, 5), chr = c(1, 2))
rownames(map2) <- colnames(geno2) <- c("M13", "M14")

# adding new markers
gp2 <- add.markers(gp, geno2, map2)
summary(gp2)
summary(gp)

synbreed documentation built on March 12, 2021, 3:01 a.m.