This class is designed to generate and manage permutations. For some purposes it is useful to store permutations, for example for empirically establishing the correlation among genes using permutations. In this case identical permutations should be used across genes, which can be achieved by storing the permutations in a resamplingFile.

Construct a resamplingFile

buildResamplingFile: Construct a resamplingfile, see buildResamplingFile for details.

Connect

  • resamplingFile(x): Connect to a resamplingFile object (created using buildResamplingFile()), where x is the filepath.

Association testing

A resamplingFile can be directly provided to assocTest(), to run resampled association tests.

Examples

library(rvatData)
# build and connect to a resamplingFile
file <- tempfile(fileext = ".gz")
buildResamplingFile(nSamples = 25000, 
                    nResampling = 100,
                    output = file)
resamplingfile <- resamplingFile(file)

# perform resampled association tests 
gdb <- gdb(rvat_example("rvatData.gdb"))
assoc <- assocTest(
  gdb,
  VAR_id = 1:10,
  cohort = "pheno",
  pheno = "pheno",
  covar = paste0("PC", 1:4),
  test = c("skat"),
  resamplingFile = resamplingfile,
  verbose = FALSE
)