FilterPlinkSample: Making PLINK files with desired samples.
Source:R/GXwasR_main_functions.R
FilterPlinkSample.Rd
This function prepares PLINK binary files with the desired samples.
Usage
FilterPlinkSample(
DataDir,
ResultDir,
finput,
foutput = NULL,
filter_sample = "cases",
keep_remove_sample_file = NULL,
keep = TRUE
)
Arguments
- DataDir
Character string for the file path of the all input files.
- ResultDir
character string for the file path where the output PLINK files will be stored.
- finput
Character string, specifying the prefix of the input PLINK binary files.
- foutput
Character string, specifying the prefix of the output PLINK binary files.
- filter_sample
Character string, specifying the sample type to be retained. The choices are, "cases", "controls", "males" and "females". The default is "cases".
- keep_remove_sample_file
Character string, specifying the prefix of a space/tab-delimited text file with no header. For the samples that we want to keep or remove, the family IDs should be in the first column and within-family IDs in the second column. This file needs to be in the
DataDir
. The default isNULL
.- keep
Boolean value,
TRUE
orFALSE
for specifying desired samples to keep or remove. The default isTRUE
.
Examples
DataDir <- GXwasR:::GXwasR_data()
ResultDir <- tempdir()
finput <- "GXwasR_example"
foutput <- "casesPlink"
filter_sample <- "cases"
keep_remove_sample_file <- "samples_example"
keep <- FALSE
FilterPlinkSample(
DataDir = DataDir, ResultDir = ResultDir,
finput = finput, foutput = foutput, keep_remove_sample_file = keep_remove_sample_file,
keep = keep
)
#> ✔ casesPlink PLINK files with desired samples are in /var/folders/d6/gtwl3_017sj4pp14fbfcbqjh0000gp/T//RtmpO7c0S8
#> NULL