Skip to contents

This function simulates cis gene expression based on genotype data. It generates gene expression matrix E using genotype matrix G and adjacency matrix A.

Usage

simulate_cis_expression(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 E of dimensions n x m representing the simulated gene expression.

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
E <- simulate_cis_expression(G, A, phi_v)