Learn R Programming

aSPU (version 1.38)

simPathAR1Snp: Simulating a pathway with multiple SNPs.

Description

It gives a simulated SNPs consisting of multiple genes in a pathway. Each SNPs from a latent multivariate Gaussian variable with an AR1 correlation structure.

Usage

simPathAR1Snp(nGenes = 10, nGenes1 = 5, nSNPs = NULL, ncSNPs = NULL,
  nSNPlim = c(1, 20), nSNP0 = 1:3, LOR = 0.3, n = 100,
  MAFlim = c(0.05, 0.4), rholim = c(0, 0), p0 = 0.05, noncausal = FALSE)

Arguments

nGenes
The number of total genes.
nGenes1
The number of causal genes.
nSNPs
A vector, length matched with total number of genes. Each elements of vector indicate the number of SNPs in the gene. Default is nSNPs = NULL, in this case the number of nSNPs randomly selected from nSNPlow to nSNPup.
ncSNPs
A vector, length matched with total number of genes. Each elements of vector indicate the number of causal SNPs in the gene. Default is ncSNPs = NULL, in this case the number of ncSNPs are randomly selected from nSNP0.
nSNPlim
If nSNPs = NULL, the number of SNPs in Gene randomly selected from Unif(nSNPlim[1], nSNPlim[2]).
nSNP0
If ncSNPs = NULL, the number of causal SNPs in Gene randomly selected from nSNP0. Default is 1:3.
LOR
Association in log OR between a causal SNP and outcome.
n
# of cases (= # of controls).
MAFlim
MAF's of the SNPs are drawn from Unif(MAFlim[1], MAFlim[2]).
rholim
the SNPs in eahc gene are from a latent Normal variable with a AR(rho) corr structure, rho's are drawn from Unif(rholim[1], rholim[2]); the SNPs in diff genes are independant.
p0
background disease prevalence;i.e. intercept=log(p0/(1-p0)).
noncausal
exclude causal SNPs if TRUE, it is the simulation set up d in the paper(Pan et al 2015).

Value

  • a list of the binary outcome Y (=0 or 1) and SNPs (=0, 1 or 2); Y is a vector of length 2n; X is a matrix of 2n by nSNP.

See Also

aSPUpathSingle aSPUpath

Examples

Run this code
# Simulation set up A a) in the paper (Pan et al 2015)
simula <- simPathAR1Snp(nGenes=20, nGenes1=1, nSNPlim=c(1, 20), nSNP0=1:3,
                           LOR=.2, rholim=c(0,0),
                           n=100, MAFlim=c(0.05, 0.4), p0=0.05)
simula <- simPathAR1Snp(nGenes=20, nGenes1=1, nSNPlim=c(1, 20), nSNP0=1:3,
                           LOR=.2, rholim=c(0,0),
                           n=10, MAFlim=c(0.05, 0.4), p0=0.05)

# Simulation set up A b) in the paper
#simulb <- simPathAR1Snp(nGenes=20, nGenes1=1, nSNPlim=c(1, 100), nSNP0=1:3,
#                           LOR=.2, rholim=c(0,0),
#                           n=100, MAFlim=c(0.05, 0.4), p0=0.05)

Run the code above in your browser using DataLab