Description Usage Arguments Details Value Author(s) Examples
Main process of simulation for phenotypes
| 1 2 3 4 5 | 
| sim.pars | a prepared list containing the parameters settings for simulation or a file of parameters settings.
Please set your own parameters
following the same structure as the object  List format: please follow the example of the object  File format: please follow the example of the  
 Similar meanings for "[P2mean]", "[P2main]", "[P2epistasis]", and so on. | 
| fgeno | file to read genotype information from or pre-read data.frame
with that information (matching the output format of
 | 
| ftype | genotype file format, it accepts three options: 
 For "plink",  | 
| fwrite | logical. Write out file (simulated data) or not. If TRUE (default), simulated phenotypes will be written, respectively. | 
| fphename | filename of the phnotype(s). Default is "simu.pheno". | 
| fusepar | filename of the setting for simulation (for recording). Default is "usedpars.txt". | 
| seed | an integer used for set.seed(). Default is NA. | 
| Dskim | the coefficient of linkage disequilibrium. Default is 0 (no LD). | 
| noise.var | variance for random noise. Default is 1. Note that this
is overridden by the heritability setting in the
simulation parameter file. If heritability is
given in parameter file then  | 
| pattern | ignore pattern for detecting the phenotype index from the parameter names. Default is "[[:alpha:]]+" which means letters. | 
| plink.path | path of plink executable. Only needed when the  | 
| genetic.model | a string show the genetic model to use for simulation. Default is "epistasis". | 
| ... | not used. | 
further discussion on pattern
a data.frame with the simulated phenotype(s) where the column(s) refer to different phenotype(s) and rows to individuals.
Beibei Jiang beibei_jiang@psych.mpg.de and Benno Pütz puetz@psych.mpg.de
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #### file path of example
# simulation parameters:
fpar.path <- system.file("extdata", "simupars.txt", package="SimPhe")
# genotype file: rows are individuals and columns are SNPs
fgeno.path <- system.file("extdata", "10SNP.txt", package="SimPhe")
#### instead of a parameter file, prepared list like genepars also works
genepars
#### simulate phenotype(s)
phe <- sim.phe(sim.pars = fpar.path, fgeno = fgeno.path, ftype = "snp.head", fwrite = FALSE)
# or
phe <- sim.phe(sim.pars = genepars, fgeno = fgeno.path, ftype = "snp.head", fwrite = FALSE)
# the simulated phenotype(s)
str(phe)
head(phe)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.