read.snpdata.plink: Read genotype dosages in the format output by PLINK.

Description Usage Arguments Details Value Author(s) References Examples

Description

Reads genotype dosages as output by PLINK using the --recodeA option, and combines these with information about coded and noncoded alleles from information output by PLINK using the --freq option.

Usage

1
read.snpdata.plink(fileroot, tol.af = 0.01, phenotypes = NULL)

Arguments

fileroot

a filename root to which .frq and .raw extensions will be appended

tol.af

a tolerence for checking allele frequencies between the two files read

phenotypes

if not null, a data frame of phenotypes to be merged with the genotypes; must contain columns called FID and IID

Details

Run PLINK twice, once with --freq and once with --recodeA, and with otherwise identical options for e.g. individual and SNP inclusions and exclusions, in order to make suitable files for this function to read.

Value

Returns a list with snpinfo and data slots, see snpdata.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

References

Information about PLINK and its input and output data formats can be found at http://pngu.mgh.harvard.edu/~purcell/plink.

Examples

1
2
3
4
5
6
7
8
## Not run: 
mypheno <- read.table("MYPHENO.dat", header = TRUE,
                      as.is = TRUE, na.strings = c("NA", "-9"))
system("plink --bfile MYBED --freq --out MYEXPORT")
system("plink --bfile MYBED --recodeA --out MYEXPORT")
mydata <- read.snpdata.plink("MYEXPORT", phenotypes = mypheno)

## End(Not run)

gtx documentation built on May 2, 2019, 5:08 a.m.