Skip to contents

This function simulates a single trait (e.g., gene expression) based on genotype data. It generates a trait matrix Y using genotype matrix G and adjacency matrix A.

Usage

sim_single_trait_simple(G, A, phi_v)

Arguments

G

A matrix of genotypes with dimensions n x p.

A

A binary adjacency matrix of dimensions p x m indicating direct effects.

phi_v

The per-SNP heritability value.

Value

A matrix Y of dimensions n x m representing the simulated trait.

Examples

n <- 1000
p <- 40
m <- 8
G <- matrix(rbinom(n * p, size = 2, prob = 0.3), ncol = p)
A <- matrix(sample(0:1, p * m, replace = TRUE), nrow = p)
phi_v <- 0.05
Y <- sim_single_trait_simple(G, A, phi_v)