FILEST
(Fine-Level Structure Simulator) is a population genetic simulator. The simulator is able to generate synthetic datasets for single-nucleotide polymorphisms (SNP) for multiple populations. The genetic distances among populations can be set according to the Fixation Index (Fst). This tool is able to simulate outlying individuals and missing SNPs can be specified. For Genome-wide association study (GWAS), disease status can be set in desired level according risk ratio.
You can install the released version of FILEST from CRAN with:
install.packages("FILEST")
Alternatively, you can install the dev version of FILEST from Github with
install.packages("remotes")
remotes::install_github("kridsadakorn/filest", dependencies = TRUE)
You can see the reference manual from: https://www.biostatgen.org/filest/
This best way to understand the package is the run the demo function and edit the parameters in the setting file:
library(FILEST)
output_dir <- demo.filest()
#> Creating a setting file ... /var/folders/k6/3_1zxcc90dgd495vv1432wf40000gn/T//RtmpC3nbNo/example1.txt
#> Generating the simulated data to ... /var/folders/k6/3_1zxcc90dgd495vv1432wf40000gn/T//RtmpC3nbNo
#> Start [S0] at 2022-04-27 02:21:47
#> Setting file is : /var/folders/k6/3_1zxcc90dgd495vv1432wf40000gn/T//RtmpC3nbNo/example1.txt
#> The simulated files will be saved in this directory: /var/folders/k6/3_1zxcc90dgd495vv1432wf40000gn/T//RtmpC3nbNo/example1
#> Creating data file setting #1 - rep #1
#> Done - 0.0287609100341796875 secs
#> Writing data files setting #1 - rep #1
#> Done - 0.148444890975952148 secs
#> Creating status file setting #1 - rep #1
#> Done - 0.149194002151489258 secs
#> Estimating Fst setting #1 - rep #1
#> Done - 0.161826848983764648 secs
#> Creating maker information setting #1 - rep #1
#> Done - 0.316367864608764648 secs
#> Generating PC scores #1 - rep #1
#> Generating EigenVector #1 - rep #1
#> Done - 0.674299001693725586 secs
The demo function creates the setting file at a temp directory as example1.txt
, and you can use as a template to edit:
print(file.path(output_dir,"example1.txt"))
#> [1] "/var/folders/k6/3_1zxcc90dgd495vv1432wf40000gn/T//RtmpC3nbNo/example1.txt"
The demo function create the simulated files at a temp directory as `well.example1
.
dir(file.path(output_dir,"example1"))
#> [1] "simSNP_rep1_data_numMark_rowInd_colVar.txt"
#> [2] "simSNP_rep1_data_numMark_rowVar_colInd.txt"
#> [3] "simSNP_rep1_eigenvector10.txt"
#> [4] "simSNP_rep1_estimated_Fst.txt"
#> [5] "simSNP_rep1_individuals_with_header.txt"
#> [6] "simSNP_rep1_individuals.txt"
#> [7] "simSNP_rep1_PC.pdf"
#> [8] "simSNP_rep1_PC10.txt"
#> [9] "simSNP_rep1.bed"
#> [10] "simSNP_rep1.bim"
#> [11] "simSNP_rep1.fam"
#> [12] "simSNP_rep1.RData"