View source: R/classes_methods.R
SubsetByPloidy | R Documentation |
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.
SubsetByPloidy(object, ...)
## S3 method for class 'RADdata'
SubsetByPloidy(object, ploidies, ...)
object |
A |
ploidies |
A list, formatted like |
... |
Other arguments (none implemented). |
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
.
A RADdata
object identical to object
, but only containing data
relevant to the inheritance modes listed in ploidies
.
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.
Lindsay V. Clark
SubsetByTaxon
, SubsetByLocus
# Example dataset assuming diploidy or autotetraploidy
data(exampleRAD)
exampleRAD <- IterateHWE(exampleRAD)
# Subset to only keep tetraploid results
exampleRAD <- SubsetByPloidy(exampleRAD, ploidies = list(4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.