Computations with Markers
Paulino Pérez 1 José Crossa 1
1ColPos-México 2CIMMyT-México
June, 2015.
CIMMYT, México-SAGPDB Computations with Markers 1/20
Computations with Markers Paulino Prez 1 Jos Crossa 1 1 ColPos-Mxico - - PowerPoint PPT Presentation
Computations with Markers Paulino Prez 1 Jos Crossa 1 1 ColPos-Mxico 2 CIMMyT-Mxico June, 2015. CIMMYT, Mxico-SAGPDB Computations with Markers 1/20 Contents Genomic relationship matrix 1 Examples 2 Big Data! 3 CIMMYT,
1ColPos-México 2CIMMyT-México
CIMMYT, México-SAGPDB Computations with Markers 1/20
1
2
3
CIMMYT, México-SAGPDB Computations with Markers 2/20
Genomic relationship matrix
CIMMYT, México-SAGPDB Computations with Markers 3/20
Genomic relationship matrix 1
2
j=1 pj(1 − pj),
3
CIMMYT, México-SAGPDB Computations with Markers 4/20
Genomic relationship matrix
eI) and β ∼ N(0, σ2 βI).
CIMMYT, México-SAGPDB Computations with Markers 5/20
Examples
CIMMYT, México-SAGPDB Computations with Markers 6/20
Examples
1
2
CIMMYT, México-SAGPDB Computations with Markers 7/20
Examples
#Clear workspace rm(list=ls()) #Set working directory setwd("C:/Users/P.P.RODRIGUEZ/Desktop/Slides Paulino/2. Gmatrix/examples/") source("Recode.R") source("Impute.R") Genotype_info=read.csv(file="TC-10-Genotypes-ACGT.csv", header=TRUE,na.strings="?_?",stringsAsFactors=FALSE) entry_Genotype_info=Genotype_info$Entry Genotype_info=Genotype_info[,-c(1,2)] X=recode(Genotype_info)$X #Impute missing genotypes set.seed(123)
CIMMYT, México-SAGPDB Computations with Markers 8/20
Examples
#Note that marker 167 and 179 are #monomorphic and should be excluded from analysis
#Remove monomorphic markers, #At this point no more missing values are present X=out$X[,-out$monomorphic] #compute p phat=colMeans(X)/2 MAF=ifelse(phat<0.5,phat,1-phat) phat=MAF hist(MAF,main="")
CIMMYT, México-SAGPDB Computations with Markers 9/20
Examples
MAF Frequency 0.0 0.1 0.2 0.3 0.4 0.5 20 40 60 80 100 120 140
CIMMYT, México-SAGPDB Computations with Markers 10/20
Examples
#Computing the genomic relationship matrix G1=tcrossprod(X) X2=scale(X,center=TRUE,scale=FALSE) k=2*sum(phat*(1-phat)) G2=tcrossprod(X2)/k X3=scale(X,center=TRUE,scale=TRUE) G3=tcrossprod(X3)/ncol(X3) heatmap(G3) hist(diag(G3),main="")
CIMMYT, México-SAGPDB Computations with Markers 11/20
Examples
1
2
CIMMYT, México-SAGPDB Computations with Markers 12/20
Examples
5 137 33 24 72 70 136 6 2 34 53 29 142 28 43 103 58 3 61 107 131 91 32 77 75 47 119 69 102 89 79 26 12 145 110 41 96 105 39 86 35 94 81 99 109 60 27 42 139 87 74 37 50 10 132 88 98 101 68 92 19 57 143 133 83 130 84 80 67 121 82 30 126 23 9 106 100 1 125 124 113 112 14 46 63 71 138 48 135 117 52 15 147 111 18 146 44 64 141 40 49 59 108 95 17 56 51 4 11 134 118 66 22 115 8 104 25 144 76 85 45 120 90 54 16 36 78 55 62 20 73 93 148 65 38 129 13 21 31 97 7 140 123 114 127 128 116 122 5 137 33 24 72 70 136 6 2 34 53 29 142 28 43 103 58 3 61 107 131 91 32 77 75 47 119 69 102 89 79 26 12 145 110 41 96 105 39 86 35 94 81 99 109 60 27 42 139 87 74 37 50 10 132 88 98 101 68 92 19 57 143 133 83 130 84 80 67 121 82 30 126 23 9 106 100 1 125 124 113 112 14 46 63 71 138 48 135 117 52 15 147 111 18 146 44 64 141 40 49 59 108 95 17 56 51 4 11 134 118 66 22 115 8 104 25 144 76 85 45 120 90 54 16 36 78 55 62 20 73 93 148 65 38 129 13 21 31 97 7 140 123 114 127 128 116 122
CIMMYT, México-SAGPDB Computations with Markers 13/20
Examples
diag(G3) Frequency 0.5 1.0 1.5 2.0 2.5 3.0 10 20 30 40 50 60
CIMMYT, México-SAGPDB Computations with Markers 14/20
Examples
D=as.matrix(dist(X))
CIMMYT, México-SAGPDB Computations with Markers 15/20
Big Data!
CIMMYT, México-SAGPDB Computations with Markers 16/20
Big Data!
CIMMYT, México-SAGPDB Computations with Markers 17/20
Big Data!
CIMMYT, México-SAGPDB Computations with Markers 18/20
Big Data!
CIMMYT, México-SAGPDB Computations with Markers 19/20
Big Data!
CIMMYT, México-SAGPDB Computations with Markers 20/20