Skip to contents

FilterSNP: Filter out SNPs.

Usage

FilterSNP(DataDir, ResultDir, finput, foutput, SNPvec, extract = FALSE)

Arguments

DataDir

A character string for the file path of the input PLINK binary 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.

foutput

Character string, specifying the prefix of the output PLINK binary files if the filtering option for the SNPs is chosen. The default is "FALSE".

SNPvec

R dataframe with SNP names to be excluded.

extract

Boolean value, TRUE or FALSE, specifying whether to extract the snps or discard the snps. The default is FALSE.

Value

NULL. The filtered file will be saved in ResultDir.

Examples


DataDir <- GXwasR:::GXwasR_data()
ResultDir <- tempdir()
SNPvec <- c("rs6529954", "rs12858640", "rs5962098")
finput <- "GXwasR_example"
foutput <- "Filter_Test"
FilterSNP(DataDir, ResultDir, finput, foutput, SNPvec = SNPvec, extract = TRUE)
#>  3 SNPs are extracted
#>  Plink files with extracted SNPs are in /var/folders/d6/gtwl3_017sj4pp14fbfcbqjh0000gp/T//RtmpO7c0S8 prefixed as Filter_Test
#> NULL