Description Usage Arguments Details Value Author(s) References Examples
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.
1 | read.snpdata.plink(fileroot, tol.af = 0.01, phenotypes = NULL)
|
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 |
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.
Returns a list with snpinfo and data slots, see snpdata
.
Toby Johnson Toby.x.Johnson@gsk.com
Information about PLINK and its input and output data formats can be found at http://pngu.mgh.harvard.edu/~purcell/plink.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.