Learn R Programming

qgg (version 1.1.1)

gsim: Genomic simulation

Description

The gsim function is used for simulating genotype and phenotype data based Glist. It is currently under active development.

Usage

gsim(Glist = NULL, chr = 1, nt = 1, W = NULL, n = 1000, m = 1000)

Arguments

Glist

list of information about genotype matrix

chr

is the chromosome(s) being used in the simulation

nt

number of traits

W

matrix of centered and scaled genotypes

n

number of individuals

m

number of markers

Author

Peter Soerensen

Examples

Run this code

 ## Plink bed/bim/fam files
 bedfiles <- system.file("extdata", paste0("sample_chr",1:2,".bed"), package = "qgg")
 bimfiles <- system.file("extdata", paste0("sample_chr",1:2,".bim"), package = "qgg")
 famfiles <- system.file("extdata", paste0("sample_chr",1:2,".fam"), package = "qgg")
 
 # Summarize bed/bim/fam files
 Glist <- gprep(study="Example", bedfiles=bedfiles, bimfiles=bimfiles, famfiles=famfiles)
 
 # Simulate phenotype
 sim <- gsim(Glist=Glist, chr=1, nt=1)
 head(sim$y)
 head(sim$e)
 head(sim$causal)
 

Run the code above in your browser using DataLab