Generate optionally weighted variant sets using annotation table(s). See the tutorials for examples.

# S4 method for data.frame
buildVarSet(
  object,
  unitName,
  fields,
  output = NULL,
  memlimit = NULL,
  mask = TRUE
)

Arguments

object

A data.frame containing variant annotations

unitName

Field to utilize for aggregation unit names.

fields

Which fields in the data.frame to use as variant annotations. These fields can be 1) an indicator (0,1 or FALSE/TRUE) that flags variants with the annotation, e.g. a column named 'LOF' that indicates whether the variant is predicted to lead to loss-of-function.; or 2) variant weights, e.g. a column named 'CADD' that contains CADD scores. Multiple fields can be specified, which will result in multiple rows per aggregation unit in the resulting varSetFile.

output

Optional output file name (output will be gz compressed text).

memlimit

Defaults to NULL, currently not implemented.

mask

If the annotation field is a 0,1 or FALSE/TRUE indicator, should variants with 0/FALSE be dropped? Defaults to TRUE. If FALSE, all variants will be included, and will be assigned weights 0 and 1.

Examples


library(rvatData)

gdb <- create_example_gdb()
anno <- getAnno(gdb, "varinfo", where = "gene_name in ('SOD1', 'FUS')")
varsetfile_from_df <- tempfile()
buildVarSet(
  anno,
  unitName = "gene_name",
  fields = c("HighImpact"),
  output = varsetfile_from_df
)

# connect to varsetfile and retrieve variant sets
varsetfile <- varSetFile(varsetfile_from_df)
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.