Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

write.bed.matrix

Save a bed.matrix


Description

Save a bed.matrix in several files

Usage

write.bed.matrix(x, basename, bed = paste(basename, ".bed", sep=""),   
                              fam = paste(basename, ".fam", sep=""),
                              bim = paste(basename, ".bim", sep=""), 
                              rds = paste(basename, ".rds", sep=""))

Arguments

x

A bed.matrix

basename

Basename of all files

bed

Name of the .bed file

fam

Name of the .fam file

bim

Name of the .bim file

rds

Name of the .rds file

Details

If any of bed, fam, bim and rds is NULL, the corresponding file will not be written.

The .fam and .bim files are useful for reading files with other softwares. The .rds file can be read by read.bed.matrix.

The .bed, .fam and .bim files follow the PLINK specifications (http://zzz.bwh.harvard.edu/plink/binary.shtml).

Author(s)

Hervé Perdry and Claire Dandine-Roulland

See Also

Examples

# Load data
data(LCT)
x <- as.bed.matrix(LCT.gen, LCT.fam, LCT.bim)

# Write object in LCT.bed and LCT.RData
## Not run: 
write.bed.matrix(x, "LCT")

## End(Not run)

gaston

Genetic Data Handling (QC, GRM, LD, PCA) & Linear Mixed Models

v1.5.7
GPL-3
Authors
Hervé Perdry [cre, aut, cph], Claire Dandine-Roulland [aut, cph], Deepak Bandyopadhyay [cph] (C++ gzstream class), Lutz Kettner [cph] (C++ gzstream class)
Initial release
2020-09-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.