CoreCollection {coreCollection} | R Documentation |
The CoreCollection class
Description
R6 class for creating a core collection based on the provided distanceMatrix
,
required size of the core n
and optionally a set of preselected
accessions to be included
into the core.
Usage
CoreCollection(
distanceMatrix,
n,
preselected = c(),
coreSelectMethod = "A-NE",
adjustedGroupMethod = "split",
algorithm = "randomDescent",
seed = NULL
)
Arguments
distanceMatrix |
|
n |
The number of items in the core |
preselected |
An optional list of preselected accessions to be included in the core collection; the provided accessions should occur in the labels or rownames of the provided distanceMatrix |
coreSelectMethod |
The method for computing core accessions within the groups:
|
adjustedGroupMethod |
The method to handle adjusting groups when multiple preselected accessions occur within a single group:
|
algorithm |
Algorithm applied to compute a solution: currently, only |
seed |
The seed used when generating the core collection. If no seed is provided, a random
seed is chosen and each time the |
Details
Based on a provided distanceMatrix
and required number n
of accessions
within the core, a random set of accessions is created, implicitly dividing the full
population into initial groups based on the nearest randomly chosen random accession. If a
set of preselected
accessions is provided, this initial division is adjusted using the
adjustedGroupMethod
. Then, using the coreSelectMethod
in the algorithm
, the
core accessions within these groups are calculated, resulting in the final core collection.
Fields
adjustedBasedGroups
A list describing the initial random division of all accessions into groups, adjusted for the set of
preselected
accessions by using the definedadjustedGroupMethod
.adjustedGroupMethod
The method to handle adjusting groups when multiple preselected accessions occur within a single group.
adjustedSelected
A data.frame representing the intial random selection of accesions, adjusted for the set of
preselected
accessions by using the definedadjustedGroupMethod
, with the accession names as labels and the following columns:-
contains
: the (positive) number of accessions that have this accessions as the closest random selected accession -
preselects
: the number of these closest accessions that were preselected -
preselected
: a boolean indicating if the random selected accession was preselected -
random
: a boolean indiciating if the selected accesion was initially randomly chosen or introduced later by the appliedadjustedGroupMethod
.
-
algorithm
The applied algorithm to compute the solution.
core
A data.frame representing the core collection with the accession names as labels and in the first and only column a boolean value indicating whether or not the accession was preselected.
coreSelectMethod
The applied method to select the core accessions based on the computed
adjustedBasedGroups
.distanceMatrix
The distance matrix; this will allways be a dist object.
n
The required core size
pop
A data.frame representing the whole collection with the accession names as labels and in the first and only column:
-
result
: a string describing if the accession is marked asother
or as included in thecore
, and if in thecore
because it waspreselected
or because of the appliedcoreSelectMethod
.
-
preselected
The list of preselected accessions.
randomBasedGroups
A list with the initial division into groups based on the initial random selection of accessions described by
randomSelected
. Each item describes all accessions that have the random selected accesion from the label as the nearest neighbour, including the random selected accession.randomSelected
A data.frame representing the intial random selection of accesions with the accession names as labels and the following columns:
-
contains
: the (positive) number of accessions that have this accessions as the closest random selected accession -
preselects
: the number of these closest accessions that were preselected -
preselected
: a boolean indicating if the random selected accession was preselected -
random
: a boolean indiciating if the random selected accesion was randomly chosen. This will always be TRUE for this field, but including this column makes the output comparable withadjustedSelected
.
-
seed
The last applied seed for the randomizer. This will only change when the
recompute()
method is called and no initialseed
is defined.
Methods
alternativeCore(n)
The
n
th alternative core withn
a positive integer. Provides for each accession in the core, if available, then
th nearest accession from within the same group as an alternative.clone(deep = FALSE)
The default R6Class clone method.
initialize(distanceMatrix, n, preselected, coreSelectMethod, adjustedGroupMethod, algorithm, seed)
Initialisation of the object, is called automatically on creation or recomputing.
measure(coreSelectMethod)
The measure for the provided
coreSelectMethod
. If no value is provided, the current selectedcoreSelectMethod
is used. The measure is used by the algorithm to compute the core collection.measures()
A data.frame with the available
coreSelectMethods
as labels and in the first and only column the measures for these methods.recompute()
Recompute the core collection: If on initialisation of the object a seed was provided, this same seed will be applied and therefore the same core collection will be created. Otherwise, a new seed is generated, resulting in a new core.
print()
Create a summary of the core collection object, same as
summary()
.summary()
Create a summary of the core collection object, same as
print()
.
See Also
Other core collection:
coreCollection-package