Description Usage Arguments Details Value Author(s) References See Also Examples
Given a SnpMatrix
object, together with associated subject and
SNP support dataframes, this function writes .bed
,
.bim
, and .fam
files for processing in the PLINK toolset
1 2 3 4 | write.plink(file.base, snp.major = TRUE, snps,
subject.data, pedigree, id, father, mother, sex, phenotype,
snp.data, chromosome, genetic.distance, position, allele.1, allele.2,
na.code = 0)
|
file.base |
A character string giving the base filename. The
extensions |
snp.major |
Logical variable controlling whether the |
snps |
The |
subject.data |
(Optional) A subject support dataframe. If
supplied, the next six arguments (which define the fields of the
PLINK |
pedigree |
A pedigree (family) identifier. Default is the row
names of |
id |
An identifier of an individual within family. Default is a
vector of |
father |
The within-family identifier of the subject's
father. Default is a vector of |
mother |
The within-family identifier of the subject's
mother. Default is a vector of |
sex |
Sex of the individual. Default is a vector of
|
phenotype |
The primary phenotype value. Default is a vector of
|
snp.data |
(Optional) A SNP support dataframe. If
supplied, the next five arguments (which define the columns of the
PLINK |
chromosome |
The chromosome on which the SNP is located. This
should either be numeric, as specified by SPLINK, or character, with
|
genetic.distance |
The location of the SNP, expressed as a
genetic distance. Default is a vector of |
position |
The physical location of the SNP, expressed in base pairs.
Default is a vector of |
allele.1 |
A character vector giving the first allele. Default is
a vector of |
allele.2 |
A character vector giving the first allele. Default is
a vector of |
na.code |
The code to be written for |
For more details of required codings in .fam
and .bim
files, see the PLINK documentation.
Returns NULL
.
David Clayton dc208@cam.ac.uk
PLINK: Whole genome association analysis toolset. http://pngu.mgh.harvard.edu/~purcell/plink/
read.plink
,
SnpMatrix-class
, XSnpMatrix-class
1 2 3 4 5 6 7 8 | data(testdata)
## the use of as.numeric() below is not necessary since this is done
## automatically. It just illustrates use of expressions for these arguments
## Note that cc and sex are variables within the subject.data frame
## This command writes files test.bed. test.fam and test.bim
write.plink(file.base="test", snps=Autosomes,
subject.data=subject.data, phenotype = as.numeric(cc), sex=as.numeric(sex),
snp.major=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.