removedWrongAnceInst: Remove samples with incorrect ancestry

View source: R/genotypeInfoUpdate.R

removedWrongAnceInstR Documentation

Remove samples with incorrect ancestry

Description

Remove samples with the incorrect ancestry or keep samples at your own chioce.

Usage

removedWrongAnceInst(
  plink,
  inputPrefix,
  metaDataFile,
  ancestrySymbol,
  outputPrefix
)

Arguments

plink

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

inputPrefix

the prefix of the input PLINK binary files.

metaDataFile

a pure text file that stores the meta information of the samples. This file must contain at least the following content (column names are in parentheses): family ID in the PLINK files (FID), individual ID in the PLINK files (IID), ID in the description files (descID), self identified ancestry (ance; e.g. AFR: African, AMR: Ad Mixed American, EAS: East Asian, EUR: European, SAS: South Asian), sex (sex; 1 = male, 2 = female, 0 = missing), age (age), group (group; 0 = control/unaffected, 1 = case/affected). All unknown and missing values are represented by the value NA. Lines with a missing value for FID or IID are not contained.

ancestrySymbol

an indicator that shows the symbol of genetic ancestry. If it is null, then all samples are selected.

outputPrefix

the prefix of the output PLINK binary files.

Details

ancestrySymbol, such as 'EUR' stands for the European, 'EAS' for East Asian. See the metaDataFile for more details.

Value

The output PLINK binary files after checking the ancestry information.

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")
metaDataFile <- system.file("extdata", "1_01_metaData.txt", 
                            package="Gimpute")
system(paste0("scp ", bedFile, bimFile, famFile, " ."))
inputPrefix <- "controlData" ## Specify the input PLINK file prefix
ancestrySymbol <- "EAS"
outputPrefix <- "1_05_removedWrongAnceInst" 
## Not run: Requires an executable program PLINK, e.g.
## plink <- "/home/tools/plink"
## removedWrongAnceInst(plink, inputPrefix, metaDataFile,  
##                      ancestrySymbol, outputPrefix)

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