| Title: | Constitution of Core Collections by Principal Component Scoring Strategy |
|---|---|
| Description: | Generate a Core Collection with Principal Component Scoring Strategy (PCSS) using qualitative and/or quantitative trait data according to Hamon and Noirot (1990) <https://www.documentation.ird.fr/hor/fdi:36506>, Noirot et al. (1996) <doi:10.2307/2527837> and Noirot et al. (2003) <https://www.documentation.ird.fr/hor/fdi:010031886>. |
| Authors: | J. Aravind [aut, cre] (ORCID: <https://orcid.org/0000-0002-4791-442X>), Anju Mahendru Singh [aut] (ORCID: <https://orcid.org/0000-0001-6958-1630>), ICAR-NBGPR [cph] (ROR: <https://ror.org/00scbd467>, url: https://nbpgr.org.in/) |
| Maintainer: | J. Aravind <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.1.1.9000 |
| Built: | 2026-05-30 19:28:25 UTC |
| Source: | https://github.com/aravind-j/rpcss |
pcss.core Outputbiplot.pcss.core generates biplots of scores of genotypes with or
without vectors for traits from the output of pcss.core.
## S3 method for class 'pcss.core' biplot( x, ndim = 3, highlight.core = c("size", "variance", "logistic", "none"), show.traits = c("all", "none", "quantitative", "qualitative"), qual.scale = 1, quant.scale = 1, point.alpha = 0.8, segment.alpha = 0.8, ... )## S3 method for class 'pcss.core' biplot( x, ndim = 3, highlight.core = c("size", "variance", "logistic", "none"), show.traits = c("all", "none", "quantitative", "qualitative"), qual.scale = 1, quant.scale = 1, point.alpha = 0.8, segment.alpha = 0.8, ... )
x |
An object of class |
ndim |
The number of dimensions for which biplots have to plotted. |
highlight.core |
The core collection to be highlighted. Either
|
show.traits |
Which kind of the traits to be shown in the biplot. Either
|
qual.scale |
A scale factor to be applied to qualitative trait coordinates plotted in biplot. |
quant.scale |
A scale factor to be applied to quantitative trait coordinates plotted in biplot. |
point.alpha |
Alpha transparency value for biplot points. |
segment.alpha |
Alpha transparency value for biplot segments. |
... |
Unused. |
Use "size" to highlight core collection according to the threshold
size criterion or use "variance" to highlight core collection
according to the variability threshold criterion or use "logistic" to
highlight core collection generated according to inflection point of rate of
progress of cumulative variability retained identified by logistic
regression. Use "none" to not highlight any accessions.
A list of biplots as ggplot objects.
pcss.core, plot.PCA,
plot.MCA, plot.FAMD,
fviz_pca, fviz_mca,
fviz_famd
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Prepare example data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ suppressPackageStartupMessages(library(EvaluateCore)) # Get data from EvaluateCore data("cassava_EC", package = "EvaluateCore") data = cbind(Genotypes = rownames(cassava_EC), cassava_EC) quant <- c("NMSR", "TTRN", "TFWSR", "TTRW", "TFWSS", "TTSW", "TTPW", "AVPW", "ARSR", "SRDM") qual <- c("CUAL", "LNGS", "PTLC", "DSTA", "LFRT", "LBTEF", "CBTR", "NMLB", "ANGB", "CUAL9M", "LVC9M", "TNPR9M", "PL9M", "STRP", "STRC", "PSTR") rownames(data) <- NULL # Convert qualitative data columns to factor data[, qual] <- lapply(data[, qual], as.factor) library(FactoMineR) suppressPackageStartupMessages(library(factoextra)) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # With quantitative data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out1 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = NULL, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) # Plot biplot biplot(out1, ndim = 3, highlight.core = "size", quant.scale = 3, point.alpha = 0.5) # Plot biplot with FactoMineR plot(out1$raw.out, choix=c("ind"), label = "none", axes = c(1, 2)) plot(out1$raw.out, choix=c("ind"), label = "none", axes = c(1, 3)) plot(out1$raw.out, choix=c("ind"), label = "none", axes = c(2, 3)) # Plot biplot with factoextra fviz_pca_biplot(out1$raw.out, geom.ind = "point", axes = c(1, 2)) fviz_pca_biplot(out1$raw.out, geom.ind = "point", axes = c(1, 3)) fviz_pca_biplot(out1$raw.out, geom.ind = "point", axes = c(2, 3)) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out2 <- pcss.core(data = data, names = "Genotypes", quantitative = NULL, qualitative = qual, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) # Plot biplot biplot(out2, ndim = 3, highlight.core = "size", qual.scale = 1, point.alpha = 0.5) # Plot biplot with FactoMineR plot(out2$raw.out, choix=c("ind"), label = "none", axes = c(1, 2)) plot(out2$raw.out, choix=c("ind"), label = "none", axes = c(1, 3)) plot(out2$raw.out, choix=c("ind"), label = "none", axes = c(2, 3)) # Plot biplot with factoextra fviz_mca_biplot(out2$raw.out, geom.ind = "point", axes = c(1, 2)) fviz_mca_biplot(out2$raw.out, geom.ind = "point", axes = c(1, 3)) fviz_mca_biplot(out2$raw.out, geom.ind = "point", axes = c(2, 3)) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (quantitative and qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out3 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = qual, eigen.threshold = NULL) # Plot biplot biplot(out3, ndim = 3, highlight.core = "size", quant.scale = 3, qual.scale = 1, point.alpha = 0.5) # Plot biplot with FactoMineR plot(out3$raw.out, choix=c("ind"), label = "none", axes = c(1, 2)) plot(out3$raw.out, choix=c("ind"), label = "none", axes = c(1, 3)) plot(out3$raw.out, choix=c("ind"), label = "none", axes = c(2, 3)) # Plot biplot with factoextra # Fix rownames row.names(out3$raw.out$quali.var$coord) <- unlist(lapply(seq_along(data[, qual]), function(i) paste(qual[i], levels(data[, qual[i]]), sep = "_"))) fviz_famd_ind(out3$raw.out, geom = "point", axes = c(1, 2)) fviz_famd_ind(out3$raw.out, geom = "point", axes = c(1, 3)) fviz_famd_ind(out3$raw.out, geom = "point", axes = c(2, 3))#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Prepare example data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ suppressPackageStartupMessages(library(EvaluateCore)) # Get data from EvaluateCore data("cassava_EC", package = "EvaluateCore") data = cbind(Genotypes = rownames(cassava_EC), cassava_EC) quant <- c("NMSR", "TTRN", "TFWSR", "TTRW", "TFWSS", "TTSW", "TTPW", "AVPW", "ARSR", "SRDM") qual <- c("CUAL", "LNGS", "PTLC", "DSTA", "LFRT", "LBTEF", "CBTR", "NMLB", "ANGB", "CUAL9M", "LVC9M", "TNPR9M", "PL9M", "STRP", "STRC", "PSTR") rownames(data) <- NULL # Convert qualitative data columns to factor data[, qual] <- lapply(data[, qual], as.factor) library(FactoMineR) suppressPackageStartupMessages(library(factoextra)) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # With quantitative data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out1 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = NULL, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) # Plot biplot biplot(out1, ndim = 3, highlight.core = "size", quant.scale = 3, point.alpha = 0.5) # Plot biplot with FactoMineR plot(out1$raw.out, choix=c("ind"), label = "none", axes = c(1, 2)) plot(out1$raw.out, choix=c("ind"), label = "none", axes = c(1, 3)) plot(out1$raw.out, choix=c("ind"), label = "none", axes = c(2, 3)) # Plot biplot with factoextra fviz_pca_biplot(out1$raw.out, geom.ind = "point", axes = c(1, 2)) fviz_pca_biplot(out1$raw.out, geom.ind = "point", axes = c(1, 3)) fviz_pca_biplot(out1$raw.out, geom.ind = "point", axes = c(2, 3)) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out2 <- pcss.core(data = data, names = "Genotypes", quantitative = NULL, qualitative = qual, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) # Plot biplot biplot(out2, ndim = 3, highlight.core = "size", qual.scale = 1, point.alpha = 0.5) # Plot biplot with FactoMineR plot(out2$raw.out, choix=c("ind"), label = "none", axes = c(1, 2)) plot(out2$raw.out, choix=c("ind"), label = "none", axes = c(1, 3)) plot(out2$raw.out, choix=c("ind"), label = "none", axes = c(2, 3)) # Plot biplot with factoextra fviz_mca_biplot(out2$raw.out, geom.ind = "point", axes = c(1, 2)) fviz_mca_biplot(out2$raw.out, geom.ind = "point", axes = c(1, 3)) fviz_mca_biplot(out2$raw.out, geom.ind = "point", axes = c(2, 3)) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (quantitative and qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out3 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = qual, eigen.threshold = NULL) # Plot biplot biplot(out3, ndim = 3, highlight.core = "size", quant.scale = 3, qual.scale = 1, point.alpha = 0.5) # Plot biplot with FactoMineR plot(out3$raw.out, choix=c("ind"), label = "none", axes = c(1, 2)) plot(out3$raw.out, choix=c("ind"), label = "none", axes = c(1, 3)) plot(out3$raw.out, choix=c("ind"), label = "none", axes = c(2, 3)) # Plot biplot with factoextra # Fix rownames row.names(out3$raw.out$quali.var$coord) <- unlist(lapply(seq_along(data[, qual]), function(i) paste(qual[i], levels(data[, qual[i]]), sep = "_"))) fviz_famd_ind(out3$raw.out, geom = "point", axes = c(1, 2)) fviz_famd_ind(out3$raw.out, geom = "point", axes = c(1, 3)) fviz_famd_ind(out3$raw.out, geom = "point", axes = c(2, 3))
Generate a Core Collection with Principal Component Scoring Strategy (PCSS) (Hamon and Noirot 1990; Noirot et al. 1996; Noirot et al. 2003) using qualitative and/or quantitative trait data.
pcss.core( data, names, quantitative, qualitative, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75, always.selected = NULL )pcss.core( data, names, quantitative, qualitative, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75, always.selected = NULL )
data |
The data as a data frame object. The data frame should possess one row per individual and columns with the individual names and multiple trait/character data. |
names |
Name of column with the individual/genotype names as a character string. |
quantitative |
Name of columns with the quantitative traits as a character vector. |
qualitative |
Name of columns with the qualitative traits as a character vector. |
eigen.threshold |
The lower limit of the eigen value of factors to be included in the estimation. The default value is the average of all the eigen values. |
size |
The desired core set size proportion. |
var.threshold |
The desired proportion of total variability to be sampled. |
always.selected |
Names of genotypes to be always included in the core set as a character vector. |
A core collection is constituted from an entire collection of \(N\) genotypes using quantitative data of \(J\) traits using Principal Component Scoring Strategy (PCSS) (Hamon and Noirot 1990; Noirot et al. 1996; Noirot et al. 2003) as follows:
Principal Component Analysis (PCA) is performed on the standardized genotype \(\times\) trait data. This takes care of multicollinearity between the traits to generate \(J\) standardized and independent variables or factors or principal component.
Considering only a subset of factors \(K\), the Generalized Sum of Squares (GSS) of N individuals in K factorial spaces is computed as \(N \times K\).
\(K\) can be the number of factors for which the eigen value \(\lambda\) is greater than a threshold value such as 1 (Kaiser-Guttman criterion) or the average of all the eigen values.
The contribution of the \(i\)th genotype to GSS (\(P_{i}\)) or total variability is calculated as below.
\[P_{i} = \sum_{j = 1}^{K} x_{ij}^{2}\]Where \(x_{ij}\) is the component score or coordinate of the \(i\)th genotype on the \(j\)th principal component.
For each genotype, its relative contribution to GSS or total variability is computed as below.
\[CR_{i} = \frac{P_{i}}{N \times K}\]The genotypes are sorted in descending order of magnitude of their contribution to GSS and then the cumulative contribution of successive genotypes to GSS is computed.
The core collection can then be selected by three different methods.
Selection of fixed proportion or percentage or number of the top accessions.
Selection of the top accessions that contribute up to a fixed percentage of the GSS.
Fitting a logistic regression model of the following form to the cumulative contribution of successive genotypes to GSS (Balakrishnan et al. 2000).
\[\frac{y}{A-y} = e^{a + bn}\]The above equation can be reparameterized as below.
\[\log_{e} \left ( {\frac{y}{A-y}} \right ) = a + bn\]Where, \(a\) and \(b\) are the intercept and regression coefficient, respectively; \(y\) is the cumulative contribution of successive genotypes to GSS; \(n\) is the rank of the genotype when sorted according to the contribution to GSS and \(A\) is the asymptote of the curve (\(A = 100\)).
The rate of increase in the successive contribution of genotypes to GSS can be computed by the following equation to find the point of inflection where the rate of increase starts declining.
\(\frac{\mathrm{d} y}{\mathrm{d} x} = by(A-y)\)
The number of accessions included till the peak or infection point are selected to constitute the core collection.
Similarly for qualitative traits, standardized and independent variables or
factors can be obtained by Correspondence Analysis (CA) on complete
disjunctive table of genotype \(\times\) trait data or to be specific
Multiple Correspondence Analysis (MCA). In rpcss, this has also been
extended for data sets having both quantitative and qualitative traits by
implementing Factor Analysis for Mixed Data (FAMD) for obtaining standardized
and independent variables or factors.
In rpcss, PCA, MCA and FAMD are implemented via the
FactoMineR package.
(Le et al. 2008; Husson et al. 2017).
A list of class pcss.core with the following components.
details |
The details of the core set generation process. |
raw.out |
The original output of |
eigen |
A data frame with eigen values and their partial and cumulative contribution to percentage of variance. |
eigen.threshold |
The threshold eigen value used. |
rotation |
A matrix of rotation values or loadings. |
scores |
A matrix of scores from PCA, CA or FAMD. |
variability.ret |
A data frame of individuals/genotypes ordered by variability retained. |
cores.info |
A data frame of core set size and percentage variability retained according to the method used. |
Balakrishnan R, Nair NV, Sreenivasan TV (2000).
“A method for establishing a core collection of Saccharum officinarum L. germplasm based on quantitative-morphological data.”
Genetic Resources and Crop Evolution, 47, 1–9.
ISBN: 0925-9864 Publisher: Springer.
Hamon S, Noirot M (1990).
“Some proposed procedures for obtaining a core collection using quantitative plant characterization data.”
In Report of An International Workshop on Okra Genetic Resources held at National Bureau of Plant Genetic Resources (NBPGR), New Delhi, India, 8-12 October,1990, number 5 in International Crop Network Series.
International Board for Plant Genetic Resources, Rome.
Husson F, Le S, Pages J (2017).
Exploratory Multivariate Analysis by Example Using R, Second edition edition.
CRC Press, Boca Raton.
ISBN 978-1-138-19634-6.
Le S, Josse J, Husson F (2008).
“FactoMineR : An R package for multivariate analysis.”
Journal of Statistical Software, 25(1).
Noirot M, Anthony F, Dussert S, Hamon S (2003).
“A method for building core collections.”
In Genetic Diversity of Cultivated Tropical Plants, 81–92.
CRC Press.
Noirot M, Hamon S, Anthony F (1996).
“The principal component scoring: A new method of constituting a core collection using quantitative data.”
Genetic Resources and Crop Evolution, 43(1), 1–6.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Prepare example data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get data from EvaluateCore data("cassava_EC", package = "EvaluateCore") data = cbind(Genotypes = rownames(cassava_EC), cassava_EC) quant <- c("NMSR", "TTRN", "TFWSR", "TTRW", "TFWSS", "TTSW", "TTPW", "AVPW", "ARSR", "SRDM") qual <- c("CUAL", "LNGS", "PTLC", "DSTA", "LFRT", "LBTEF", "CBTR", "NMLB", "ANGB", "CUAL9M", "LVC9M", "TNPR9M", "PL9M", "STRP", "STRC", "PSTR") rownames(data) <- NULL # Convert qualitative data columns to factor data[, qual] <- lapply(data[, qual], as.factor) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (quantitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out1 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = NULL, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) out1 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out2 <- pcss.core(data = data, names = "Genotypes", quantitative = NULL, qualitative = qual, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) out2 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (quantitative and qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out3 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = qual, eigen.threshold = NULL) out3#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Prepare example data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get data from EvaluateCore data("cassava_EC", package = "EvaluateCore") data = cbind(Genotypes = rownames(cassava_EC), cassava_EC) quant <- c("NMSR", "TTRN", "TFWSR", "TTRW", "TFWSS", "TTSW", "TTPW", "AVPW", "ARSR", "SRDM") qual <- c("CUAL", "LNGS", "PTLC", "DSTA", "LFRT", "LBTEF", "CBTR", "NMLB", "ANGB", "CUAL9M", "LVC9M", "TNPR9M", "PL9M", "STRP", "STRC", "PSTR") rownames(data) <- NULL # Convert qualitative data columns to factor data[, qual] <- lapply(data[, qual], as.factor) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (quantitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out1 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = NULL, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) out1 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out2 <- pcss.core(data = data, names = "Genotypes", quantitative = NULL, qualitative = qual, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) out2 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (quantitative and qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out3 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = qual, eigen.threshold = NULL) out3
pcss.core objectpcss.core prints to console the summary of an object of class
pcss.core including the dimensionality reduction method used, the
basic details including parameters and the information on the core sets that
can be constituted.
## S3 method for class 'pcss.core' print(x, ...)## S3 method for class 'pcss.core' print(x, ...)
x |
An object of class |
... |
Unused. |
The argument x, invisibly as for all print
methods.
pcss.core Outputscreeplot.pcss.core generates a scree plot of eigen values from the
output of pcss.core.
## S3 method for class 'pcss.core' screeplot(x, ndim = NULL, show.values = TRUE, ...)## S3 method for class 'pcss.core' screeplot(x, ndim = NULL, show.values = TRUE, ...)
x |
An object of class |
ndim |
The number of eigen values to be plotted in the scree plot. |
show.values |
If |
... |
Unused. |
The scree plot as a ggplot object.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Prepare example data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get data from EvaluateCore data("cassava_EC", package = "EvaluateCore") data = cbind(Genotypes = rownames(cassava_EC), cassava_EC) quant <- c("NMSR", "TTRN", "TFWSR", "TTRW", "TFWSS", "TTSW", "TTPW", "AVPW", "ARSR", "SRDM") qual <- c("CUAL", "LNGS", "PTLC", "DSTA", "LFRT", "LBTEF", "CBTR", "NMLB", "ANGB", "CUAL9M", "LVC9M", "TNPR9M", "PL9M", "STRP", "STRC", "PSTR") rownames(data) <- NULL # Convert qualitative data columns to factor data[, qual] <- lapply(data[, qual], as.factor) library(FactoMineR) suppressPackageStartupMessages(library(factoextra)) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # With quantitative data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out1 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = NULL, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) # Plot scree plot screeplot(x = out1) # Plot biplot with factoextra fviz_screeplot(out1$raw.out) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out2 <- pcss.core(data = data, names = "Genotypes", quantitative = NULL, qualitative = qual, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) # Plot scree plot screeplot(x = out2) # Plot biplot with factoextra fviz_screeplot(out2$raw.out) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (quantitative and qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out3 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = qual, eigen.threshold = NULL) # Plot scree plot screeplot(x = out3) # Plot biplot with factoextra fviz_screeplot(out3$raw.out)#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Prepare example data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get data from EvaluateCore data("cassava_EC", package = "EvaluateCore") data = cbind(Genotypes = rownames(cassava_EC), cassava_EC) quant <- c("NMSR", "TTRN", "TFWSR", "TTRW", "TFWSS", "TTSW", "TTPW", "AVPW", "ARSR", "SRDM") qual <- c("CUAL", "LNGS", "PTLC", "DSTA", "LFRT", "LBTEF", "CBTR", "NMLB", "ANGB", "CUAL9M", "LVC9M", "TNPR9M", "PL9M", "STRP", "STRC", "PSTR") rownames(data) <- NULL # Convert qualitative data columns to factor data[, qual] <- lapply(data[, qual], as.factor) library(FactoMineR) suppressPackageStartupMessages(library(factoextra)) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # With quantitative data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out1 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = NULL, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) # Plot scree plot screeplot(x = out1) # Plot biplot with factoextra fviz_screeplot(out1$raw.out) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out2 <- pcss.core(data = data, names = "Genotypes", quantitative = NULL, qualitative = qual, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) # Plot scree plot screeplot(x = out2) # Plot biplot with factoextra fviz_screeplot(out2$raw.out) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (quantitative and qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out3 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = qual, eigen.threshold = NULL) # Plot scree plot screeplot(x = out3) # Plot biplot with factoextra fviz_screeplot(out3$raw.out)
pcss.core Outputsubset.pcss.core returns names of individuals/genotypes in the core
collection from pcss.core Output.
## S3 method for class 'pcss.core' subset(x, criterion = c("size", "variance", "logistic"), ...)## S3 method for class 'pcss.core' subset(x, criterion = c("size", "variance", "logistic"), ...)
x |
An object of class |
criterion |
The core collection generation criterion. Either
|
... |
Unused. |
Use "size" to return names of individuals/genotypes in the core
collection according to the threshold size criterion or use
"variance" to return names according to the variability threshold
criterion or use "logistic" to return names according to inflection
point of rate of progress of cumulative variability retained identified by
logistic regression.
The names of individuals/genotypes in the core collection as a character vector.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Prepare example data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get data from EvaluateCore data("cassava_EC", package = "EvaluateCore") data = cbind(Genotypes = rownames(cassava_EC), cassava_EC) quant <- c("NMSR", "TTRN", "TFWSR", "TTRW", "TFWSS", "TTSW", "TTPW", "AVPW", "ARSR", "SRDM") qual <- c("CUAL", "LNGS", "PTLC", "DSTA", "LFRT", "LBTEF", "CBTR", "NMLB", "ANGB", "CUAL9M", "LVC9M", "TNPR9M", "PL9M", "STRP", "STRC", "PSTR") rownames(data) <- NULL # Convert qualitative data columns to factor data[, qual] <- lapply(data[, qual], as.factor) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # With quantitative data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out1 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = NULL, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) # Core sets out1$cores.info # Fetch genotype names of core set by size criterion subset(x = out1, criterion = "size") # Fetch genotype names of core set by variance criterion subset(x = out1, criterion = "variance") # Fetch genotype names of core set by logistic regression criterion subset(x = out1, criterion = "logistic") #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out2 <- pcss.core(data = data, names = "Genotypes", quantitative = NULL, qualitative = qual, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) # Core sets out2$cores.info # Fetch genotype names of core set by size criterion subset(x = out2, criterion = "size") # Fetch genotype names of core set by variance criterion subset(x = out2, criterion = "variance") # Fetch genotype names of core set by logistic regression criterion subset(x = out2, criterion = "logistic") #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (quantitative and qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out3 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = qual, eigen.threshold = NULL) # Core sets out3$cores.info # Fetch genotype names of core set by size criterion subset(x = out3, criterion = "size") # Fetch genotype names of core set by variance criterion subset(x = out3, criterion = "variance") # Fetch genotype names of core set by logistic regression criterion subset(x = out3, criterion = "logistic")#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Prepare example data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get data from EvaluateCore data("cassava_EC", package = "EvaluateCore") data = cbind(Genotypes = rownames(cassava_EC), cassava_EC) quant <- c("NMSR", "TTRN", "TFWSR", "TTRW", "TFWSS", "TTSW", "TTPW", "AVPW", "ARSR", "SRDM") qual <- c("CUAL", "LNGS", "PTLC", "DSTA", "LFRT", "LBTEF", "CBTR", "NMLB", "ANGB", "CUAL9M", "LVC9M", "TNPR9M", "PL9M", "STRP", "STRC", "PSTR") rownames(data) <- NULL # Convert qualitative data columns to factor data[, qual] <- lapply(data[, qual], as.factor) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # With quantitative data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out1 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = NULL, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) # Core sets out1$cores.info # Fetch genotype names of core set by size criterion subset(x = out1, criterion = "size") # Fetch genotype names of core set by variance criterion subset(x = out1, criterion = "variance") # Fetch genotype names of core set by logistic regression criterion subset(x = out1, criterion = "logistic") #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out2 <- pcss.core(data = data, names = "Genotypes", quantitative = NULL, qualitative = qual, eigen.threshold = NULL, size = 0.2, var.threshold = 0.75) # Core sets out2$cores.info # Fetch genotype names of core set by size criterion subset(x = out2, criterion = "size") # Fetch genotype names of core set by variance criterion subset(x = out2, criterion = "variance") # Fetch genotype names of core set by logistic regression criterion subset(x = out2, criterion = "logistic") #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Get core sets with PCSS (quantitative and qualitative data) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ out3 <- pcss.core(data = data, names = "Genotypes", quantitative = quant, qualitative = qual, eigen.threshold = NULL) # Core sets out3$cores.info # Fetch genotype names of core set by size criterion subset(x = out3, criterion = "size") # Fetch genotype names of core set by variance criterion subset(x = out3, criterion = "variance") # Fetch genotype names of core set by logistic regression criterion subset(x = out3, criterion = "logistic")