removedSnpHetX: Remove heterozygous SNPs in male chromosome X

View source: R/genotypeQC.R

removedSnpHetXR Documentation

Remove heterozygous SNPs in male chromosome X

Description

Remove heterozygous SNPs in haploid male chromosome X only if chromosome X data exists.

Usage

removedSnpHetX(
  plink,
  inputPrefix,
  hhCutOff,
  outputPrefix,
  outputHetSNPfile,
  outputRetainSNPfile
)

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.

hhCutOff

the cutoff for removing male haploid heterozygous SNPs on the chromosome X. The default is 0.005.

outputPrefix

the prefix of the output PLINK binary files.

outputHetSNPfile

the output pure text file that stores all heterozygous SNPs with their frequency (the number of males for the corresponding SNP), if any. Lines are sorted by descending number.

outputRetainSNPfile

the output pure text file that stores retained heterozygous SNPs with their frequency (the number of males for the corresponding SNP), if any. Lines are sorted by descending number.

Details

A haploid heterozygous is a male genotype that is heterozygous, which could be an error given the haploid nature of the male X chromosome. In principle, one has to remove all heterozygous SNPs of chromosome X in males. However, too many SNPs might be removed in some data sets. Therefore a small percentage of such SNPs in the data set is allowed.

Value

1.) The output PLINK binary files. 2.) A pure text files (if any) with two columns: SNPs and their corresponding frequency. 3.) After SNP removal, a pure text files (if any) with two columns: SNPs and their corresponding frequency.

Author(s)

Junfang Chen

Examples

## In the current working directory
bedFile <- system.file("extdata", "genoUpdatedData.bed", package="Gimpute")
bimFile <- system.file("extdata", "genoUpdatedData.bim", package="Gimpute") 
famFile <- system.file("extdata", "genoUpdatedData.fam", package="Gimpute")
system(paste0("scp ", bedFile, bimFile, famFile, " ."))  
inputPrefix <- "genoUpdatedData" 
hhCutOff <- 0.005 ##  can be tuned
outputPrefix <- "2_01_removedSnpHetX" 
outputHetSNPfile <- "2_01_snpHHfreqAll.txt"
outputRetainSNPfile <- "2_01_snpHHfreqRetained.txt"
## Not run: Requires an executable program PLINK, e.g.
## plink <- "/home/tools/plink"
## removedSnpHetX(plink, inputPrefix, hhCutOff, outputPrefix, 
##                outputHetSNPfile, outputRetainSNPfile)

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