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

## -----------------------------------------------------------------------------
#install.packages("CauMedi")

## -----------------------------------------------------------------------------
library(CauMedi)
set.seed(42)
n_subj <- 100
n_gene <- 50

gene_ids <- paste0("gene", seq_len(n_gene))
M_mat <- matrix(rgamma(n_subj * n_gene, shape = 2, rate = 1),
                nrow = n_subj, ncol = n_gene,
                dimnames = list(paste0("subj", seq_len(n_subj)), gene_ids))
F_mat <- matrix(runif(n_subj * n_gene, min = 0, max = 1),
                nrow = n_subj, ncol = n_gene,
                dimnames = list(paste0("subj", seq_len(n_subj)), gene_ids))
Y <- rnorm(n_subj)
X <- rbinom(n_subj, 1, 0.5)

feature_meta <- data.frame(
  feature_id = gene_ids,
  cell_type  = "Vasculature_cells",
  gene       = gene_ids,
  stringsAsFactors = FALSE
)

pd <- prep_CauMedi_data(M_mat = M_mat, F_mat = F_mat, feature_meta = feature_meta, Y = Y, X = X)

## -----------------------------------------------------------------------------
res <- CauMedi(data = pd$data, feature_meta = pd$feature_meta)
print(res)

