plinkVCF: Converting VCF files to PLINK binary files and vice-versa.
Source:R/GXwasR_main_functions.R
plinkVCF.Rd
This function performs the conversion between VCF files to PLINK binary formats.
For VCF to PLINK files conversion, if you do not specify any FAM file when you are converting from VCF to PLINK format, then PLINK will just create a 'dummy' FAM file with the same name as your dataset with missing phenotypes and missing sex.
Usage
plinkVCF(
DataDir,
ResultDir = tempdir(),
finput,
foutput,
VtoP = FALSE,
PtoV = TRUE,
Famfile = NULL,
PVbyCHR = TRUE
)
Arguments
- DataDir
A character string for the file path of the input PLINK binary files and all other input files.
- ResultDir
A character string for the file path where all output files will be stored. The default is
tempdir()
.- finput
Character string, specifying the prefix of the input PLINK binary files or vcf files. This file needs to be in
DataDir
.- foutput
Character string, specifying the prefix of the output PLINK binary files if filtering option for the SNPs is chosen. The default is "FALSE".
- VtoP
Boolean value,
TRUE
orFALSE
, specifying the conversion of VCF files to PLINK binary files or not. The default isTRUE
.- PtoV
Boolean value,
TRUE
orFALSE
, specifying the conversion of PLINK binary files to VCF files or not. The default isTRUE
.- Famfile
Character string, specifying the name of the original .fam file if VtoP was set to be
TRUE
. This file needs to be inDataDir
. The default isNULL
.- PVbyCHR
Boolean value,
TRUE
orFALSE
specifying to do the PLINK to vcf conversion chromosome-wise or not. The default isTRUE
.
Examples
finput <- "GXwasR_example" # Plink file
foutput <- "GXwasR_example1"
DataDir <- GXwasR:::GXwasR_data()
ResultDir <- tempdir()
PtoV <- TRUE
VtoP <- FALSE
Famfile <- NULL
PVbyCHR <- FALSE
plinkVCF(DataDir, ResultDir, finput, foutput, VtoP, PtoV, Famfile, PVbyCHR)
#> ✔ Output files created in ResultDir: /var/folders/d6/gtwl3_017sj4pp14fbfcbqjh0000gp/T//RtmpO7c0S8