require(SFSI)
data(wheatHTP)
index = which(Y$trial %in% 1:6) # Use only a subset of data
Y = Y[index,]
X = scale(X_E1[index,]) # Reflectance data
M = scale(M[index,])/sqrt(ncol(M)) # Subset and scale markers
G = tcrossprod(M) # Genomic relationship matrix
y = as.vector(scale(Y[,'E1'])) # Subset response variable
# Sparse phenotypic regression
fm1 = LARS(var(X),cov(X,y))
# Sparse family index
fm2 = SSI(y,K=G,tst=1:10,trn=11:50)
# \donttest{
path.plot(fm1)
path.plot(fm2, prune=TRUE)
path.plot(fm2, K=G, prune=TRUE, cor.max=0.9)
# }
# Path plot for the first individual in testing set for the SSI
path.plot(fm2, K=G, i=1)
Run the code above in your browser using DataLab