Skip to contents

Select a subset of lines from a larger panel that you have a kinship matrix for. It will find a subset of n unrelated lines that have a minimum kinship between any pair.

Usage

div.sub(K, n.sub = 100, n.gens = 400, n.iters = 20, verbose = T)

Arguments

K

An nxn kinship matrix.

n.sub

number of lines to subset.

n.gens

Number of generations of shuffling.

n.iters

Number of iterations of algorithm to try. It will automatically output the best one.

verbose

Print output - logical.

Value

Returns a list of objects including: "Best_subset" A vector of names of the selected subset of lines from the best iteration. "Best_Max_K" The maximum kinship between lines in the selected subset "Max_kinships" A list of vectors of maximum kinship values at each generation of shuffling for each iteration. Use these to check you are running enough generations.

Examples

library(FunFunctions)
#load the A kinship matrix for 599 wheat lines from the BGLR package
data(Wheat599_Amat)
subset<-div.sub(K = wheat599,n.sub = 100,n.gens = 200,n.iters = 5,verbose = T)
#> [1] "Iteration best max kinship:"
#> [1] "Iteration 1 = 0.448"
#> [1] "Iteration 2 = 0.425"
#> [1] "Iteration 3 = 0.451"
#> [1] "Iteration 4 = 0.425"
#> [1] "Iteration 5 = 0.4416"