buildVarSet-gdb.RdGenerate optionally weighted variant sets using annotation table(s) uploaded to the gdb. See the tutorials for examples.
# S4 method for class 'gdb'
buildVarSet(
object,
varSetName,
unitTable,
unitName,
output = NULL,
intersection = NULL,
where = NULL,
weightName = "1",
memlimit = 1000L,
verbose = TRUE
)A gdb object.
Name to assign varSet grouping. This identifier column is used to allow for subsequent merging of multiple varSet files for coordinated analysis of multiple variant filtering/weighting strategies.
Table containing aggregation unit mappings.
Field to utilize for aggregation unit names.
Output file name (output will be gz compressed text).
If no output file is specified, a varSetList object will be returned directly.
Additional tables to filter through intersection (i.e. variants absent from intersection tables will not appear in output). Can be a character vector or a comma-delimited string.
An SQL compliant where clause to filter output; e.g.: "CHROM=2 AND POS between 5000 AND 50000 AND AF<0.01 AND (cadd.caddPhred>15 OR snpEff.SIFT='D')".
Field name for desired variant weighting.
Must be a column within unitTable or other intersection table.
Default value of 1 is equivalent to no weighting.
Chunk size used for processing rows. Defaults to 1000.
Should the function be verbose? Defaults to TRUE.
library(rvatData)
# Build a varset including variants with a moderate predicted impact
gdb <- create_example_gdb()
varsetfile_moderate <- tempfile()
buildVarSet(
object = gdb,
output = varsetfile_moderate,
varSetName = "Moderate",
unitTable = "varInfo",
unitName = "gene_name",
where = "ModerateImpact = 1"
)
#> Generated varSetFile: /tmp/RtmpvjdKWE/file1539338881edb
#> varSetFile object
#> Path:/tmp/RtmpvjdKWE/file1539338881edb
#> Units:12
# Build a varset that contains CADD scores
varsetfile_cadd <- tempfile()
buildVarSet(
object = gdb,
output = varsetfile_cadd,
varSetName = "CADD",
unitTable = "varInfo",
unitName = "gene_name",
weightName = "CADDphred"
)
#> Generated varSetFile: /tmp/RtmpvjdKWE/file15393fdbe48e
#> varSetFile object
#> Path:/tmp/RtmpvjdKWE/file15393fdbe48e
#> Units:12
# connect to varsetfile and retrieve variant sets
varsetfile <- varSetFile(varsetfile_moderate)
varsets <- getVarSet(varsetfile, unit = c("SOD1", "FUS"))
# see ?getVarSet, ?varSetFile and ?varSetList for more details on connecting and handling varsetfiles.
# see e.g., ?assocTest and ?aggregate for downstream methods that can loop through varsetfiles and varsetlists.