Learn R Programming

snpStatsWriter (version 1.5-6)

write.beagle: Write a snpStats object in beagle format

Description

see write.simple for general information

Usage

write.beagle(X, a1, a2, bp, trait = NULL, gfile, mfile)

Arguments

trait
disease trait (0=missing, 1=control, 2=case)
gfile,mfile
gfile=genotype file, pedfile=pedigree file
X
SnpMatrix object
a1
vector of first allele at each SNP
a2
vector of second allele at each SNP
bp
vector of base pair positions for 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]
gf <- tempfile()
mf <- tempfile()

## write in suitable format for beagle
nsnps <- ncol(A.small)
write.beagle(A.small, a1=rep("1",nsnps), a2=rep("2",nsnps), bp=1:nsnps, gfile=gf, mfile=mf)
unlink(gf)
unlink(mf)

Run the code above in your browser using DataLab