Skip to contents

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 or FALSE, specifying the conversion of VCF files to PLINK binary files or not. The default is TRUE.

PtoV

Boolean value, TRUE or FALSE, specifying the conversion of PLINK binary files to VCF files or not. The default is TRUE.

Famfile

Character string, specifying the name of the original .fam file if VtoP was set to be TRUE. This file needs to be in DataDir. The default is NULL.

PVbyCHR

Boolean value, TRUE or FALSE specifying to do the PLINK to vcf conversion chromosome-wise or not. The default is TRUE.

Value

NULL

The output files will be saved in ResultDir.

Author

Banabithi Bose

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