gweis.mem: Routine to allocate memory needed to perform a GWEIS.

View source: R/GxEScanR.R

gweis.memR Documentation

Routine to allocate memory needed to perform a GWEIS.

Description

Routine to allocate memory needed to perform a GWEIS.

Usage

gweis.mem(gemdl, subids, tests, gomdl = NULL)

Arguments

gemdl

The results from glm for the gene-environment model. This model contains the outcome and all covariates of interest with the last covariate listed in the model being the covaraiate that the gene interaction is being tested for.

subids

A character vector of subject IDs that line up with the data that was used in the models that are passed to this routine

tests

The list of tests to perform. These can be any combination of the following values "bg_go", "bg_ge", "bg_gxe", "bgxe", "joint", "bg_eg", "bg_case", "bg_ctrl"

gomdl

The results from glm for the gene-only model. This model contains the outcome and all the covariates except the covariate that the gene interaction is being tested for. Required (non-NULL) when "bg_go" is included in tests; ignored otherwise.

Value

List containing allocated memory to perform the specified GWEIS. This value is passed to the rungweis routine. Returns 1 if any value in tests is not a recognised test name.

Examples

## Not run: 
bdinfo <- BinaryDosage::getbdinfo(system.file("extdata", "gendata.bdose",
                                              package = "GxEScanR"))
subdata <- readRDS(system.file("extdata", "subdata.rds", package = "GxEScanR"))
subdata <- subdata[complete.cases(subdata), ]
subdata <- subdata[subdata$subid %in% bdinfo$samples$sid, ]

linearmodel <- glm(y_linear ~ x2 + x1, data = subdata)
linearmem <- gweis.mem(gemdl = linearmodel,
                       subids = subdata$subid,
                       tests = c("bg_ge", "bg_gxe", "bgxe", "joint"))

## End(Not run)

GxEScanR documentation built on May 1, 2026, 5:07 p.m.