removeSampID: Remove samples in PLINK files

View source: R/genotypeInfoUpdate.R

removeSampIDR Documentation

Remove samples in PLINK files

Description

Remove sample IDs that are useless such as duplicated or related IDs from PLINK binary files. These IDs are defined in a plain text file.

Usage

removeSampID(plink, removedSampIDFile, inputPrefix, outputPrefix)

Arguments

plink

an executable program in either the current working directory or somewhere in the command path.

removedSampIDFile

a pure text file that stores the useless sample IDs, each ID per line. If it is null, then duplicate the input PLINK files as the output files.

inputPrefix

the prefix of the input PLINK binary files.

outputPrefix

the prefix of the output PLINK binary files.

Value

The output PLINK binary files after removing certain sample IDs.

Author(s)

Junfang Chen

Examples

## In the current working directory
bedFile <- system.file("extdata", "controlData.bed", package="Gimpute")
bimFile <- system.file("extdata", "controlData.bim", package="Gimpute") 
famFile <- system.file("extdata", "controlData.fam", package="Gimpute")
system(paste0("scp ", bedFile, bimFile, famFile, " ."))  
inputPrefix <- "controlData" ## Specify the input PLINK file prefix
removedSampIDFile <- system.file("extdata", "excludedSampIDsV1.txt", 
                                 package="Gimpute")
outputPrefix <- "1_02_removedExclInst" 
## Not run: Requires an executable program PLINK, e.g.
## plink <- "/home/tools/plink"
## removeSampID(plink, removedSampIDFile, inputPrefix, outputPrefix)

transbioZI/Gimpute documentation built on April 10, 2022, 4:20 a.m.