Learn R Programming

polyRAD (version 1.1)

StripDown: Remove Unneeded Slots to Conserve Memory

Description

This function is designed to be used after a RADdata object has been processed by one of the pipeline functions. Slots that are no longer needed are removed in order to conserve memory.

Usage

StripDown(object, ...)
# S3 method for RADdata
StripDown(object, 
          remove.slots = c("depthSamplingPermutations",
                           "depthRatio", "antiAlleleDepth",
                           "genotypeLikelihood", "priorProb",
                           "priorProbLD"),
          …)

Arguments

object

A RADdata object.

remove.slots

A character vector listing slots that will be removed.

Additional arguments (none implemented).

Value

A RADdata object

Details

The default slots that are removed take up a lot of memory but are not used by the export functions. Other slots to consider removing are alleleFreq, alleleFreqByTaxa, PCA, locDepth, alleleDepth, and alleleLinkages. Of course, if you have custom uses for some of the slots that are removed by default, you can change the remove.slots vector to not include them.

The function will throw an error if the user attempts to remove key slots that are needed for export and downstream analysis, including:

  • alleles2loc

  • alleleNucleotides

  • locTable

  • priorProbPloidies

  • possiblePloidies

  • ploidyChiSq

  • posteriorProb

See Also

SubsetByTaxon, SubsetByLocus

Examples

Run this code
# NOT RUN {
# load a dataset for this example
data(exampleRAD)

# run a pipeline
exampleRAD <- IterateHWE(exampleRAD)

# check the size of the resulting object
object.size(exampleRAD)

# remove unneeded slots
exampleRAD <- StripDown(exampleRAD)

# check object size again
object.size(exampleRAD)
# }

Run the code above in your browser using DataLab