| Title: | Training Set Determination for Genomic Selection |
|---|---|
| Description: | Finds a training set for genomic selection and the size it needs. The r-score of Ou and Liao (2019) <doi:10.1007/s00122-019-03387-0> is derived from Pearson's correlation between the genomic estimated breeding values and the phenotypic values of the test set. optTrain() searches for a good training set, and SSDFGS() searches for its size. Eighteen criteria are available to score or optimize a training set, among them A-, D-, E- and G-optimality, PEVmax, MSPE, CDmean, CDmax, and genomic relationship criteria (Chen et al. (2024) <doi:10.1007/s00122-024-04766-y>; Fernandez-Gonzalez et al. (2023) <doi:10.1007/s00122-023-04265-6>). The computation uses 'Rcpp' and 'RcppEigen', and independent searches can run on several threads with 'OpenMP'. |
| Authors: | Jen-Hsiang Ou [aut, cre] (ORCID: <https://orcid.org/0000-0001-9305-2931>, affiliation: Department of Medical Genetics, National Taiwan University Hospital), Po-Ya Wu [aut] (ORCID: <https://orcid.org/0000-0002-7342-2867>), Chen-Tuo Liao [aut, ths] (ORCID: <https://orcid.org/0000-0001-9777-3701>) |
| Maintainer: | Jen-Hsiang Ou <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 3.0.0 |
| Built: | 2026-11-12 21:58:30 UTC |
| Source: | https://github.com/cran/TSDFGS |
Finds a training set for genomic selection and the size it needs. The r-score of Ou and Liao (2019) <doi:10.1007/s00122-019-03387-0> is derived from Pearson's correlation between the genomic estimated breeding values and the phenotypic values of the test set. optTrain() searches for a good training set, and SSDFGS() searches for its size. Eighteen criteria are available to score or optimize a training set; see criteria().
Maintainer: Jen-Hsiang Ou [email protected] (ORCID) (affiliation: Department of Medical Genetics, National Taiwan University Hospital)
Authors:
Jen-Hsiang Ou [email protected] (ORCID) (affiliation: Department of Medical Genetics, National Taiwan University Hospital)
Po-Ya Wu [email protected] (ORCID)
Chen-Tuo Liao [email protected] (ORCID) [thesis advisor]
Useful links:
Report bugs at https://github.com/oumarkme/TSDFGS/issues
: the trace of the inverse ridge information matrix of the training set. Smaller is better. It uses the training set only.
aopt_score(X, lambda = NULL)aopt_score(X, lambda = NULL)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
lambda |
A positive number, the ridge penalty, or NULL (default) for the default of the criterion. |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Akdemir, D., & Isidro-Sanchez, J. (2019). Design of training populations for selective phenotyping in genomic prediction. Scientific Reports, 9, 1446. <doi:10.1038/s41598-018-38081-6>
data(geno) aopt_score(geno[1:50, ])data(geno) aopt_score(geno[1:50, ])
Mean relationship between the training set and the target rows minus the mean relationship within the training set (a = 1, b = 1). Larger is better.
avg_grm_minmax_score(X, X0)avg_grm_minmax_score(X, X0)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
X0 |
A numeric matrix of the target rows (the test set), with the same columns as X. |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Fernandez-Gonzalez, J., Akdemir, D., & Isidro y Sanchez, J. (2023). A comparison of methods for training population optimization in genomic selection. Theoretical and Applied Genetics, 136, 30. <doi:10.1007/s00122-023-04265-6>
data(geno) avg_grm_minmax_score(geno[1:50, ], geno[51:100, ])data(geno) avg_grm_minmax_score(geno[1:50, ], geno[51:100, ])
Mean of the relationship matrix between the training set and the target rows (a = 1, b = 0 of the generalized Avg_GRM). Larger is better.
avg_grm_score(X, X0)avg_grm_score(X, X0)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
X0 |
A numeric matrix of the target rows (the test set), with the same columns as X. |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Fernandez-Gonzalez, J., Akdemir, D., & Isidro y Sanchez, J. (2023). A comparison of methods for training population optimization in genomic selection. Theoretical and Applied Genetics, 136, 30. <doi:10.1007/s00122-023-04265-6>
data(geno) avg_grm_score(geno[1:50, ], geno[51:100, ])data(geno) avg_grm_score(geno[1:50, ], geno[51:100, ])
Mean of within the training set. Smaller is better. It uses the training set only.
avg_grm_self_score(X)avg_grm_self_score(X)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Fernandez-Gonzalez, J., Akdemir, D., & Isidro y Sanchez, J. (2023). A comparison of methods for training population optimization in genomic selection. Theoretical and Applied Genetics, 136, 30. <doi:10.1007/s00122-023-04265-6>
data(geno) avg_grm_self_score(geno[1:50, ])data(geno) avg_grm_self_score(geno[1:50, ])
This function calculate CD-score <doi:10.1186/1297-9686-28-4-359> by given training set and test set.
cd_score(X, X0, lambda = NULL)cd_score(X, X0, lambda = NULL)
X |
A numeric matrix. The training set genotypic information matrix can be given as genotype matrix (coded as -1, 0, 1) or principal component matrix (row: sample; column: marker or PC). |
X0 |
A numeric matrix. The test set genotypic information matrix, with the same columns as X. |
lambda |
A positive number, the ridge penalty, or NULL (default) for the default of the criterion (r-score and PEV: 1 / number of columns; CD: 1). |
A number, the CD score (larger is better).
Jen-Hsiang Ou
data(geno) ## Not run: cd_score(geno[1:50, ], geno[51:100, ])data(geno) ## Not run: cd_score(geno[1:50, ], geno[51:100, ])
Largest, over the target rows, of the coefficient of determination of the ridge model on the columns of X (the per-individual value averaged by cd_score; default ). It protects the best-determined individual, as the CDMAX of STPGA does. Larger is better.
cdmax_score(X, X0, lambda = NULL)cdmax_score(X, X0, lambda = NULL)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
X0 |
A numeric matrix of the target rows (the test set), with the same columns as X. |
lambda |
A positive number, the ridge penalty, or NULL (default) for the default of the criterion. |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Akdemir, D., Sanchez, J. I., & Jannink, J.-L. (2015). Optimization of genomic selection training populations with a genetic algorithm. Genetics Selection Evolution, 47, 38. <doi:10.1186/s12711-015-0116-6>
data(geno) cdmax_score(geno[1:50, ], geno[51:100, ])data(geno) cdmax_score(geno[1:50, ], geno[51:100, ])
Mean coefficient of determination of the contrasts between each target row and the target mean, for a GBLUP model with , a general mean as the only fixed effect, and penalty (default 1). Larger is better.
cdmean_score(X, X0, lambda = NULL)cdmean_score(X, X0, lambda = NULL)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
X0 |
A numeric matrix of the target rows (the test set), with the same columns as X. |
lambda |
A positive number, the ridge penalty, or NULL (default) for the default of the criterion. |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Rincent, R., et al. (2012). Maximizing the reliability of genomic selection by optimizing the calibration set of reference individuals. Genetics, 192, 715-728. <doi:10.1534/genetics.112.141473> Chen, S.-P., Sung, W.-H., & Liao, C.-T. (2024). Constructing training sets for genomic selection to identify superior genotypes in candidate populations. Theoretical and Applied Genetics, 137, 270. <doi:10.1007/s00122-024-04766-y>
data(geno) cdmean_score(geno[1:50, ], geno[51:100, ])data(geno) cdmean_score(geno[1:50, ], geno[51:100, ])
Mean of , the heuristic form of CDmean (GBLUP, , default ). Larger is better.
cdmean2_score(X, X0, lambda = NULL)cdmean2_score(X, X0, lambda = NULL)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
X0 |
A numeric matrix of the target rows (the test set), with the same columns as X. |
lambda |
A positive number, the ridge penalty, or NULL (default) for the default of the criterion. |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Chen, S.-P., Sung, W.-H., & Liao, C.-T. (2024). Constructing training sets for genomic selection to identify superior genotypes in candidate populations. Theoretical and Applied Genetics, 137, 270. <doi:10.1007/s00122-024-04766-y>
data(geno) cdmean2_score(geno[1:50, ], geno[51:100, ])data(geno) cdmean2_score(geno[1:50, ], geno[51:100, ])
Returns the criteria that optTrain can optimize, with the name to give to its
method argument, the function that scores a given training set, the direction of
optimization, and whether the criterion uses a test set.
criteria()criteria()
Criteria marked uses_test = FALSE depend on the training set only. When a
test set is given to optTrain, such a criterion ignores it (with a warning).
One page per criterion on the package website gives the definition, the original
reference, and the license review.
A data frame with the columns method, name, type,
score_fun, maximize, and uses_test.
Jen-Hsiang Ou
criteria()criteria()
of the training set. Larger is better (a larger determinant of the information matrix). It uses the training set only.
dopt_score(X, lambda = NULL)dopt_score(X, lambda = NULL)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
lambda |
A positive number, the ridge penalty, or NULL (default) for the default of the criterion. |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Akdemir, D., & Isidro-Sanchez, J. (2019). Design of training populations for selective phenotyping in genomic prediction. Scientific Reports, 9, 1446. <doi:10.1038/s41598-018-38081-6>
data(geno) dopt_score(geno[1:50, ])data(geno) dopt_score(geno[1:50, ])
Largest eigenvalue of , that is . Smaller is better. It uses the training set only. When X has more columns than rows, is singular and the score is for every training set.
eopt_score(X, lambda = NULL)eopt_score(X, lambda = NULL)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
lambda |
A positive number, the ridge penalty, or NULL (default) for the default of the criterion. |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Akdemir, D., & Isidro-Sanchez, J. (2019). Design of training populations for selective phenotyping in genomic prediction. Scientific Reports, 9, 1446. <doi:10.1038/s41598-018-38081-6>
data(geno) eopt_score(geno[1:50, ])data(geno) eopt_score(geno[1:50, ])
A function for fitting logisti growth model
FGCM(geno, nt = NULL, n_iter = NULL, multi.threads = FALSE, threads = NULL)FGCM(geno, nt = NULL, n_iter = NULL, multi.threads = FALSE, threads = NULL)
geno |
Genotype information saved as a dataframe. Columns represent variants (SNPs or PCs). |
nt |
A numerical vector of training set sample size for estimating logistic growth curve parameters |
n_iter |
Number of simulation of each training set size. Automatically gave a suitable number by default. |
multi.threads |
Default: FALSE. If TRUE, the simulations run in parallel (OpenMP) on 75% of the available processors (limited by |
threads |
Default: NULL. The number of threads; it overrides |
Estimation of parameters.
data(geno) ## Not run: FGCM(geno)data(geno) ## Not run: FGCM(geno)
A PCA matrix of rice genotype information. This data was published by Zhao et al. (2011) <doi:10.1038/ncomms1467>
genogeno
A numeric matrix (PCA) with 404 rows (sample) and 404 columns (PCs).
http://www.ricediversity.org/data/
data(geno)data(geno)
Largest eigenvalue of the prediction error variance matrix of the target rows, , with an intercept column added. Smaller is better.
gopt_score(X, X0, lambda = NULL)gopt_score(X, X0, lambda = NULL)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
X0 |
A numeric matrix of the target rows (the test set), with the same columns as X. |
lambda |
A positive number, the ridge penalty, or NULL (default) for the default of the criterion. |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Akdemir, D., & Isidro-Sanchez, J. (2019). Design of training populations for selective phenotyping in genomic prediction. Scientific Reports, 9, 1446. <doi:10.1038/s41598-018-38081-6>
data(geno) gopt_score(geno[1:50, ], geno[51:100, ])data(geno) gopt_score(geno[1:50, ], geno[51:100, ])
with (average genomic variation). Larger is better. It uses the training set only.
gv_average_score(X)gv_average_score(X)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Chen, S.-P., Sung, W.-H., & Liao, C.-T. (2024). Constructing training sets for genomic selection to identify superior genotypes in candidate populations. Theoretical and Applied Genetics, 137, 270. <doi:10.1007/s00122-024-04766-y>
data(geno) gv_average_score(geno[1:50, ])data(geno) gv_average_score(geno[1:50, ])
with , the relationship matrix of the training set (overall genomic variation). Larger is better. It needs at least as many columns as rows, otherwise is singular and the score is minus infinity.
gv_overall_score(X)gv_overall_score(X)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Chen, S.-P., Sung, W.-H., & Liao, C.-T. (2024). Constructing training sets for genomic selection to identify superior genotypes in candidate populations. Theoretical and Applied Genetics, 137, 270. <doi:10.1007/s00122-024-04766-y>
data(geno) gv_overall_score(geno[1:50, ])data(geno) gv_overall_score(geno[1:50, ])
The approximation of the expected mean squared prediction error of ridge regression, with . Smaller is better. The default penalty is .
mspe_score(X, X0, lambda = NULL)mspe_score(X, X0, lambda = NULL)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
X0 |
A numeric matrix of the target rows (the test set), with the same columns as X. |
lambda |
A positive number, the ridge penalty, or NULL (default) for the default of the criterion. |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Chen, S.-P., Sung, W.-H., & Liao, C.-T. (2024). Constructing training sets for genomic selection to identify superior genotypes in candidate populations. Theoretical and Applied Genetics, 137, 270. <doi:10.1007/s00122-024-04766-y>
data(geno) mspe_score(geno[1:50, ], geno[51:100, ])data(geno) mspe_score(geno[1:50, ], geno[51:100, ])
Calculate r-scores (un-target) by in parallel.
nt2r(geno, nt, n_iter = 30, multi.threads = FALSE, threads = NULL)nt2r(geno, nt, n_iter = 30, multi.threads = FALSE, threads = NULL)
geno |
A numeric dataframe of genotype, column represent sites (genotype coding as 1, 0, -1) |
nt |
Numeric. Number of training set size |
n_iter |
Times of iteration. (default = 30) |
multi.threads |
Default: FALSE. If TRUE, the iterations run in parallel (OpenMP, any system with OpenMP support) on 75% of the available processors (limited by |
threads |
Default: NULL. The number of threads; it overrides |
A vector of r-scores of each iteration
data(geno) ## Not run: nt2r(geno, 50)data(geno) ## Not run: nt2r(geno, 50)
This function is designed for determining optimal training set.
optTrain( geno, cand, n.train, subpop = NULL, test = NULL, method = "rScore", min.iter = NULL, console = TRUE, seed = NULL, lambda = NULL, threads = NULL )optTrain( geno, cand, n.train, subpop = NULL, test = NULL, method = "rScore", min.iter = NULL, console = TRUE, seed = NULL, lambda = NULL, threads = NULL )
geno |
A numeric matrix of principal components (rows: individuals; columns: PCs). |
cand |
An integer vector of which rows of individuals are candidates of the training set in the geno matrix. |
n.train |
The size of the target training set. This could be determined with the help of the ssdfgp function provided in this package. |
subpop |
A character vector of sub-population's group name. The algorithm will ignore the population structure if it remains NULL. Without |
test |
An integer vector of which rows of individuals are in the test set in the geno matrix. The algorithm will use an un-target method if it remains NULL. |
method |
A criterion name; see |
min.iter |
Minimum iteration of all methods can be appointed. One should always check if the algorithm is converged or not. A minimum iteration will set by considering the candidate and test set size if it remains NULL. |
console |
Default: TRUE. Set it to FALSE if you don't want the function printing out the number count of each iteration. |
seed |
Default: NULL. An integer passed to |
lambda |
Default: NULL. A positive ridge penalty; NULL uses the default of each criterion (see |
threads |
Default: NULL (one thread). The number of threads that Eigen may use inside the matrix products of one search (OpenMP). For the exchange search it only helps when geno has many columns (several hundred; about 1.3 to 1.5 times faster at 404 columns on 2 threads) and the training set found is the same apart from rounding in the last digits. For the targeted r-score and PEV search without sub-populations (a genetic algorithm), the 30 candidate sets of each generation are scored in parallel, and the result does not depend on |
All twelve search routes of v2.4.2 (with or without sub-populations, targeted or
un-targeted, and the three criteria) are kept. The search moves, their random-number
order, the default numbers of iterations, and the stopping rule are the same as in
v2.4.2, so that a given seed returns the training set of v2.4.2 (apart from the
float-to-double change of the scores, see Details of r_score). The
r-score is the criterion of Ou and Liao (2019) <doi:10.1007/s00122-019-03387-0>.
Only the r-score, PEV, and CD are tested carefully: they reproduce the output recorded from v2.4.2 on all twelve routes. The 15 criteria added in v3 follow their papers and run on all routes, but they are not carefully tested; evaluate them on your own data before relying on them.
This function will return a list with OPTtrain (a vector of chosen optimal training set), TOPscore (highest scores of before iteration), ITERscore (criteria scores of each iteration), n.iter (number of iterations run), and converged (TRUE if the search stopped by the convergence rule, FALSE if it stopped at twice min.iter).
Jen-Hsiang Ou
Ou, J.-H., & Liao, C.-T. (2019). Training set determination for genomic selection. Theoretical and Applied Genetics, 132, 2781-2792. <doi:10.1007/s00122-019-03387-0>
data(geno) ## Not run: optTrain(geno, cand = 1:404, n.train = 100)data(geno) ## Not run: optTrain(geno, cand = 1:404, n.train = 100)
Sum, over the target rows, of the Euclidean distance to the nearest training row: the cost that partitioning around medoids minimizes when the training rows are the medoids. Smaller is better.
pam_score(X, X0)pam_score(X, X0)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
X0 |
A numeric matrix of the target rows (the test set), with the same columns as X. |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Kaufman, L., & Rousseeuw, P. J. (1990). Finding groups in data: an introduction to cluster analysis. Wiley. <doi:10.1002/9780470316801> Guo, T., et al. (2019). Optimal designs for genomic selection in hybrid crops. Molecular Plant, 12, 390-401. <doi:10.1016/j.molp.2018.12.022> Rio, S., et al. (2021). Genomic prediction and training set optimization in a structured Mediterranean oat population. Theoretical and Applied Genetics, 134, 3595-3609. <doi:10.1007/s00122-021-03916-w>
data(geno) pam_score(geno[1:50, ], geno[51:100, ])data(geno) pam_score(geno[1:50, ], geno[51:100, ])
This function calculate prediction error variance (PEV) score <doi:10.1186/s12711-015-0116-6> by given training set and test set.
pev_score(X, X0, lambda = NULL)pev_score(X, X0, lambda = NULL)
X |
A numeric matrix. The training set genotypic information matrix can be given as genotype matrix (coded as -1, 0, 1) or principal component matrix (row: sample; column: marker or PC). |
X0 |
A numeric matrix. The test set genotypic information matrix, with the same columns as X. |
lambda |
A positive number, the ridge penalty, or NULL (default) for the default of the criterion (r-score and PEV: 1 / number of columns; CD: 1). |
A number, the PEV score (smaller is better).
Jen-Hsiang Ou
data(geno) ## Not run: pev_score(geno[1:50, ], geno[51:100, ])data(geno) ## Not run: pev_score(geno[1:50, ], geno[51:100, ])
Largest prediction error variance among the target rows, with an intercept column added: . Smaller is better.
pevmax_score(X, X0, lambda = NULL)pevmax_score(X, X0, lambda = NULL)
X |
A numeric matrix of the training set (row: individual; column: marker or PC). |
X0 |
A numeric matrix of the target rows (the test set), with the same columns as X. |
lambda |
A positive number, the ridge penalty, or NULL (default) for the default of the criterion. |
See criteria for the list of criteria and the package website for one page per criterion.
A number.
Jen-Hsiang Ou
Akdemir, D., & Isidro-Sanchez, J. (2019). Design of training populations for selective phenotyping in genomic prediction. Scientific Reports, 9, 1446. <doi:10.1038/s41598-018-38081-6>
data(geno) pevmax_score(geno[1:50, ], geno[51:100, ])data(geno) pevmax_score(geno[1:50, ], geno[51:100, ])
This function calculate r-score <doi:10.1007/s00122-019-03387-0> by given training set and test set.
r_score(X, X0, lambda = NULL)r_score(X, X0, lambda = NULL)
X |
A numeric matrix. The training set genotypic information matrix can be given as genotype matrix (coded as -1, 0, 1) or principal component matrix (row: sample; column: marker or PC). |
X0 |
A numeric matrix. The test set genotypic information matrix, with the same columns as X. |
lambda |
A positive number, the ridge penalty, or NULL (default) for the default of the criterion (r-score and PEV: 1 / number of columns; CD: 1). |
The value equals the r-score of v2.4.2 (to its single-precision accuracy of about 1e-7).
Since v3 the computation uses p x p matrices when the number of columns p is at most the
training set size n, and n x n matrices otherwise, and the result is returned in double
precision. The term 1 - 1/n0 (n0: test set size) of v2.4.2 is kept as published
in the software; see NEWS.md.
A number, the r-score.
Jen-Hsiang Ou
Ou, J.-H., & Liao, C.-T. (2019). Training set determination for genomic selection. Theoretical and Applied Genetics, 132, 2781-2792. <doi:10.1007/s00122-019-03387-0>
data(geno) ## Not run: r_score(geno[1:50, ], geno[51:100, ])data(geno) ## Not run: r_score(geno[1:50, ], geno[51:100, ])
This function is designed to generate an operating curve for sample size determination
SSDFGS(geno, nt = NULL, n_iter = NULL, multi.threads = FALSE, threads = NULL)SSDFGS(geno, nt = NULL, n_iter = NULL, multi.threads = FALSE, threads = NULL)
geno |
A numeric data frame carried genotype information (column: PCs, row: sample) |
nt |
A numeric vector carried training set sizes for r-score simulation. |
n_iter |
Number of iterations for estimating parameters. |
multi.threads |
Default: FALSE. If TRUE, the simulations run in parallel (OpenMP) on 75% of the available processors (limited by |
threads |
Default: NULL. The number of threads; it overrides |
A list with the operating curve and growth curve figures (OC.fig and GC.fig; ggplot objects, or NULL when the ggplot2 package is not installed), the logistic growth curve parameters, and the operating curve data (OC.fit).
Jen-Hsiang Ou & Po-Ya Wu
data(geno) ## Not run: SSDFGS(geno)data(geno) ## Not run: SSDFGS(geno)
Sub-population information of samples. This data was published by Zhao et al. (2011) <doi:10.1038/ncomms1467>
subpopsubpop
A character vector.
http://www.ricediversity.org/data/
data(subpop)data(subpop)