Learn R Programming

snpStatsWriter (version 1.5-6)

write.mach: Write a snpStats object in mach format

Description

see write.simple for general information

Usage

write.mach(X, a1, a2, pedfile, mfile, pedigree = rownames(X), member = rep(1, nrow(X)), father = rep(0, nrow(X)), mother = rep(0, nrow(X)), sex = rep("M", nrow(X)), snp.names = colnames(X))

Arguments

pedfile
Output pedigree file name.
mfile
Output marker file name.
pedigree
Optional pedigree/member/father/mother/sex indentifier vectors, same order as rows in snpStats object. If missing, pedigree is set to rownames(X) and the others default to unrelated males
member
See pedigree
father
See pedigree
mother
See pedigree
sex
See pedigree
snp.names
optional SNP names to include in the marker map file. Defaults to colnames(X).
X
SnpMatrix object
a1
vector of first allele at each SNP
a2
vector of second allele at each SNP

Value

No return value, but has the side effect of writing specified output files.

Examples

Run this code
data(testdata,package="snpStats")
A.small <- Autosomes[1:6,1:10]
pf <- tempfile()
mf <- tempfile()

## write in suitable format for MACH
nsnps <- ncol(A.small)
write.mach(A.small, a1=rep("1",nsnps), a2=rep("2",nsnps), pedfile=pf, mfile=mf)
unlink(pf)
unlink(mf)

Run the code above in your browser using DataLab