SubsetByPloidy {polyRAD} | R Documentation |
Create a RADdata object with a Subset of Possible Ploidies
Description
This function is used for removing some of the ploidies (i.e. inheritance modes
possible across loci)
stored in a RADdata
object. If genotype calling has already
been performed, all of the relevant slots will be subsetted to only keep the
ploidies that the user indicates.
Usage
SubsetByPloidy(object, ...)
## S3 method for class 'RADdata'
SubsetByPloidy(object, ploidies, ...)
Arguments
object |
A |
ploidies |
A list, formatted like |
... |
Other arguments (none implemented). |
Details
Note that slots of object
are subsetted but not recalculated. For
example, GetWeightedMeanGenotypes
takes a weighted mean across
ploidies, which is in turn used for estimating allele frequencies and
performing PCA. If the values in object$ploidyChiSq
are considerably
higher for the ploidies being removed than for the ploidies being retained,
this difference is likely to be small and not substantially impact genotype
calling. Otherwise, it may be advisable to
re-run genotype calling after running SubsetByPloidy
.
Value
A RADdata
object identical to object
, but only containing data
relevant to the inheritance modes listed in ploidies
.
Note
If you only wish to retain taxa of a certain ploidy, instead do
object <- SubsetByTaxon(object, GetTaxaByPloidy(object, 4))
to, for example, only retain tetraploid taxa.
Author(s)
Lindsay V. Clark
See Also
Examples
# Example dataset assuming diploidy or autotetraploidy
data(exampleRAD)
exampleRAD <- IterateHWE(exampleRAD)
# Subset to only keep tetraploid results
exampleRAD <- SubsetByPloidy(exampleRAD, ploidies = list(4))