multiassoc {comorbidPGS}R Documentation

Multiple PGS Associations from a Data Frame

Description

multiassoc() take a data frame with distribution(s) of PGS and Phenotype(s), and a table of associations to make from this data frame

return a data frame showing the association results

Usage

multiassoc(
  df = NULL,
  assoc_table = NULL,
  scale = TRUE,
  covar_col = NA,
  verbose = TRUE,
  log = "",
  parallel = FALSE,
  num_cores = NA
)

Arguments

df

a dataframe with individuals on each row, and at least the following columns:

  • one ID column,

  • one PGS column, with numerical continuous values following a normal distribution,

  • one Phenotype column, can be numeric (Continuous Phenotype), character, boolean or factors (Discrete Phenotype)

assoc_table

a dataframe or matrix specifying the associations to make from df, with 2 columns: PGS and Phenotype (in this order)

scale

a boolean specifying if scaling of PGS should be done before testing

covar_col

a character vector specifying the covariate column names (facultative)

verbose

a boolean (TRUE by default) to write in the console/log messages.

log

a connection, or a character string naming the file to print to. If "" (by default), it prints to the standard output connection, the console unless redirected by sink. If parallel = TRUE, the log will be incomplete

parallel

a boolean, if TRUE, multiassoc() parallelise the association analysis to run it faster (no log available with this option, does not work with Windows machine) If FALSE (default), the association analysis will not be parallelised (useful for debugging process)

num_cores

an integer, if parallel = TRUE (default), multiassoc() parallelise the association analysis to run it faster using num_cores as the number of cores. If nothing is provided, it detects the number of cores of the machine and use num_cores-1

Value

return a data frame showing the association of the PGS(s) on the Phenotype(s) with the following columns:

Examples

assoc_table <- expand.grid(
  c("t2d_PGS", "ldl_PGS"),
  c("ethnicity","brc","t2d","log_ldl","sbp_cat")
)
results <- multiassoc(
  df = comorbidData,
  assoc_table = assoc_table,
  covar_col = c("age", "sex", "gen_array"),
  parallel = FALSE,
  verbose = FALSE
)
print(results)


[Package comorbidPGS version 0.3.4 Index]