knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Test for association between a set of SNPS/genes and continuous or binary outcomes by including variant characteristic information and using (weighted) score statistics.

Note:

Installation

#| eval: false
# Install MiSTr from CRAN:
install.packages("MiSTr")

# Or the the development version from GitHub:
# install.packages("remotes")
remotes::install_github("mcanouil/MiSTr")

MiSTr in Action

library(MiSTr)
data(mist_data)
attach(mist_data)

Continuous Outcome

With Heterogeneity (τ)

mist(
  y = phenotypes[, "y_tau"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes,
  Z = variants_info[, 1, drop = FALSE],
  method = "liu",
  model = "continuous"
)

With Heterogeneity (τ) "Removed"

variants_info[, "effect"] # simulated effect
get_same_effect <- names(which(variants_info[, "effect"] > 0))
mist(
  y = phenotypes[, "y_tau"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes[, get_same_effect],
  Z = variants_info[get_same_effect, 1, drop = FALSE],
  method = "liu",
  model = "continuous"
)

With "Average" Effect (π)

mist(
  y = phenotypes[, "y_pi"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes,
  Z = variants_info[, 1, drop = FALSE],
  method = "liu",
  model = "continuous"
)

With "Average" Effect (π) and Heterogeneity (τ)

mist(
  y = phenotypes[, "y_taupi"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes,
  Z = variants_info[, 1, drop = FALSE],
  method = "liu",
  model = "continuous"
)

With "Average" Effect (π) and With Heterogeneity (τ) "Removed"

variants_info[, "effect"] # simulated effect
get_same_effect <- names(which(variants_info[, "effect"] > 0))
mist(
  y = phenotypes[, "y_taupi"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes[, get_same_effect],
  Z = variants_info[get_same_effect, 1, drop = FALSE],
  method = "liu",
  model = "continuous"
)

Continuous Outcome with Weights

With Heterogeneity (τ)

mist(
  y = phenotypes[, "y_tau"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes,
  Z = variants_info[, 1, drop = FALSE],
  method = "liu",
  model = "continuous",
  weight.beta = c(1, 25),
  maf = variants_info[, "maf"]
)

With Heterogeneity (τ) "Removed"

variants_info[, "effect"] # simulated effect
get_same_effect <- names(which(variants_info[, "effect"] > 0))
mist(
  y = phenotypes[, "y_tau"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes[, get_same_effect],
  Z = variants_info[get_same_effect, 1, drop = FALSE],
  method = "liu",
  model = "continuous",
  weight.beta = c(1, 25),
  maf = variants_info[get_same_effect, "maf"]
)

With "Average" Effect (π)

mist(
  y = phenotypes[, "y_pi"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes,
  Z = variants_info[, 1, drop = FALSE],
  method = "liu",
  model = "continuous",
  weight.beta = c(1, 25),
  maf = variants_info[, "maf"]
)

With "Average" Effect (π) and Heterogeneity (τ)

mist(
  y = phenotypes[, "y_taupi"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes,
  Z = variants_info[, 1, drop = FALSE],
  method = "liu",
  model = "continuous",
  weight.beta = c(1, 25),
  maf = variants_info[, "maf"]
)

With "Average" Effect (π) and With Heterogeneity (τ) "Removed"

variants_info[, "effect"] # simulated effect
get_same_effect <- names(which(variants_info[, "effect"] > 0))
mist(
  y = phenotypes[, "y_taupi"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes[, get_same_effect],
  Z = variants_info[get_same_effect, 1, drop = FALSE],
  method = "liu",
  model = "continuous",
  weight.beta = c(1, 25),
  maf = variants_info[get_same_effect, "maf"]
)

Binary Outcome

With Heterogeneity (τ)

mist(
  y = phenotypes[, "y_binary"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes,
  Z = variants_info[, 1, drop = FALSE],
  method = "liu",
  model = "binary"
)

With Heterogeneity (τ) "Removed"

variants_info[, "effect"] # simulated effect
get_same_effect <- names(which(variants_info[, "effect"] > 0))
mist(
  y = phenotypes[, "y_binary"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes[, get_same_effect],
  Z = variants_info[get_same_effect, 1, drop = FALSE],
  method = "liu",
  model = "binary"
)

Binary Outcome with Weights

With Heterogeneity (τ)

mist(
  y = phenotypes[, "y_binary"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes,
  Z = variants_info[, 1, drop = FALSE],
  method = "liu",
  model = "binary",
  weight.beta = c(1, 25),
  maf = variants_info[, "maf"]
)

With Heterogeneity (τ) "Removed"

variants_info[, "effect"] # simulated effect
get_same_effect <- names(which(variants_info[, "effect"] > 0))
mist(
  y = phenotypes[, "y_binary"],
  X = phenotypes[, paste0("x_cov", 0:2)],
  G = genotypes[, get_same_effect],
  Z = variants_info[get_same_effect, 1, drop = FALSE],
  method = "liu",
  model = "binary",
  weight.beta = c(1, 25),
  maf = variants_info[get_same_effect, "maf"]
)


mcanouil/MiSTr documentation built on April 7, 2023, 10:48 a.m.