Description Usage Arguments Value Examples
View source: R/outputFunctions.R
savePheno saves simulated phenotypes and their components, model setup parameters and variance components to the specified directories. Requires a simulatedData list which is the output of runSimulation.
1 2 3 4 5 6 7 8 9 |
simulatedData |
Named list of i) dataframe of proportion of variance explained for each component (varComponents), ii) a named list with the final simulated phenotype components (phenoComponentsFinal), iii) a named list with the intermediate simulated phenotype components (phenoComponentsIntermediate), iv) a named list of parameters describing the model setup (setup) and v) a named list of raw components (rawComponents) used for genetic effect simulation (genotypes and/or kinship); obtained from runSimulation |
directory |
Absolute path (no tilde expansion) to parent directory [string] where simulated data should be saved [needs user writing permission] |
format |
Vector of format name(s) [string] specifying the output format; multiple output formats can be requested. Options are: plink, bimbam, snptest, gemma, limmbo, csv or rds. For information on format see details. In orde to save intermediate phenotype components, at least one of csv or rds need to be specified. plink/bimbam/snptest will only save final phenotype/genotype, kinship and covariate data. |
outstring |
Optional name [string] of subdirectory (in relation to directory) to save set-up dependent simulation results; if set to NULL, subdirectory named by NrSamples, NrSNPs, genetic Model and noise Model and genVar is created. |
saveIntermediate |
[bool] If TRUE, intermediate phenotype components such as shared and independent effect components are saved. |
intercept_gemma |
[boolean] When modeling an intercept term in gemma, a column of 1's have to be appended to the covariate files. Set intercept_gemma to TRUE to include a column of 1's in the output; only used when "gemma" %in% format |
verbose |
[boolean]; If TRUE, progress info is printed to standard out |
Path [string] to final output directory. If outstring is NULL, this directory will be a subdirectory of the input directory.
1 2 3 4 5 6 | simulatedPhenotype <- runSimulation(N=100, P=5, cNrSNP=10,
genVar=0.2, h2s=0.2, phi=1)
## Not run:
outputdir <- savePheno(simulatedPhenotype, directory=tempdir(),
outstring="Data_simulation", format=c("csv", "plink"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.