aggregateFile.Rd
The aggregate
method saves genotypes aggregates compressed on disk. The
aggregateFile class manages connecting/interacting with these files and retrieving
units of interest.
aggregate(x, ...)
: Returns an aggregate of genotypes for each individual.
See aggregate()
for details.
aggregateFile(path)
: Connect to an aggregateFile object.
In the following code snippets, x is an aggregateFile object.
getUnit(x, unit)
: Retrieve aggregates for specified unit(s).
Use listUnits(x)
to list the units includes in the aggregateFile
Output will be a matrix.
listUnits(x)
: Return a vector of all units included in the aggregateFile
listSamples(x)
: Return a vector of all sample IDs included in the aggregateFile
An aggregateFile can be directly supplied to the assocTest()
method.
Aggregate files can be merged using the mergeAggregateFiles
method.
library(rvatData)
gdb <- gdb(rvat_example("rvatData.gdb"))
# generate the aggregates based on a varSetFile
varsetfile <- varSetFile(rvat_example("rvatData_varsetfile.txt.gz"))
varset <- getVarSet(varsetfile, unit = c("NEK1", "SOD1", "ABCA4"), varSetName = "High")
aggfile <- tempfile()
aggregate(x = gdb,
varSet = varset,
maxMAF = 0.001,
output = aggfile,
verbose = FALSE)
# connect to aggregateFile, see ?aggregateFile for more details
aggregatefile <- aggregateFile(aggfile)
# list units and samples in aggregatefile
head(listUnits(aggregatefile))
#> [1] "ABCA4" "NEK1" "SOD1"
head(listSamples(aggregatefile))
#> [1] "ALS1" "ALS2" "ALS3" "ALS4" "ALS5" "ALS6"
# retrieve aggregates
aggregates <- getUnit(aggregatefile, unit = "SOD1")
# see ?`assocTest-aggregateFile` for details on running association tests on an aggregateFile