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)

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
# 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)
                                                                                       

Example output

sh: 1: cannot create /dev/null: Permission denied
object of class 'gpData' 
covar 
	 No. of individuals 10 
	         phenotyped 10 
	          genotyped 10 
pheno 
	 No. of traits:		   2 

     Yield            Height      
 Min.   : 93.22   Min.   : 8.020  
 1st Qu.: 98.72   1st Qu.: 9.109  
 Median :101.43   Median :10.670  
 Mean   :101.54   Mean   :10.171  
 3rd Qu.:104.40   3rd Qu.:11.024  
 Max.   :108.91   Max.   :11.692  

geno 
	 No. of markers 14 
	 genotypes 0 1 2 
	 frequencies 0.1785714 0.5642857 0.15 
	 NA's 10.714 %
map 
	 No. of mapped markers  14 
	 No. of chromosomes     3 

	 markers per chromosome 
	
1 2 3 
5 5 4 

pedigree 
NULL
object of class 'gpData' 
covar 
	 No. of individuals 10 
	         phenotyped 10 
	          genotyped 10 
pheno 
	 No. of traits:		   2 

     Yield            Height      
 Min.   : 93.22   Min.   : 8.020  
 1st Qu.: 98.72   1st Qu.: 9.109  
 Median :101.43   Median :10.670  
 Mean   :101.54   Mean   :10.171  
 3rd Qu.:104.40   3rd Qu.:11.024  
 Max.   :108.91   Max.   :11.692  

geno 
	 No. of markers 12 
	 genotypes 0 1 2 
	 frequencies 0.1833333 0.5833333 0.1083333 
	 NA's 12.500 %
map 
	 No. of mapped markers  12 
	 No. of chromosomes     3 

	 markers per chromosome 
	
1 2 3 
4 4 4 

pedigree 
NULL

synbreed documentation built on May 2, 2019, 5:47 p.m.