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.
CoreCollection(
distanceMatrix,
n,
preselected = c(),
coreSelectMethod = "A-NE",
adjustedGroupMethod = "split",
algorithm = "randomDescent",
seed = NULL
)
The number of items in the core
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
The method for computing core accessions within the groups:
A-NE (accession nearest entry), E-NE (entry nearest entry) or E-E (entry entry)
The method to handle adjusting groups when multiple preselected accessions occur within a single group:
split to just split the initial groups with multiple accessions or recompute to recompute the division of
accessions over the groups.
Algorithm applied to compute a solution: currently, only randomDescent is available
The seed used when generating the core collection. If no seed is provided, a random
seed is chosen and each time the recompute() method is called on the object, a new seed will be used.
adjustedBasedGroupsA list describing the initial random division of all accessions into groups, adjusted for the
set of preselected accessions by using the defined adjustedGroupMethod.
adjustedGroupMethodThe method to handle adjusting groups when multiple preselected accessions occur within a single group.
adjustedSelectedA data.frame representing the intial random selection of accesions, adjusted for the
set of preselected accessions by using the defined adjustedGroupMethod, 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 applied adjustedGroupMethod.
algorithmThe applied algorithm to compute the solution.
coreA 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.
coreSelectMethodThe applied method to select the core accessions based on the computed adjustedBasedGroups.
distanceMatrixThe distance matrix; this will allways be a dist object.
nThe required core size
popA 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 as other or as included in the core, and if in the core because it was preselected or because of the applied coreSelectMethod.
preselectedThe list of preselected accessions.
randomBasedGroupsA 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.
randomSelectedA 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 with adjustedSelected.
seedThe last applied seed for the randomizer. This will only change when the recompute() method
is called and no initial seed is defined.
alternativeCore(n)The nth alternative core with n a positive integer. Provides for each accession in the core, if available, the nth 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 selected coreSelectMethod 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().
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.
Other core collection:
coreCollection-package