make_bed | R Documentation |
From input genotypes, metadata, and phenotypes, creates a bed, ped, map, and bim file for use in PLINK, GCTA, or other programs. Files of each type will be written to the current working directory with the "data" prefix. Note that file named "data.sh" will be written which must be ran via bash command line to produce the .bed binary file.
make_bed(
x,
meta,
phenos,
plink_path = "/usr/bin/plink.exe",
return_objects = F,
missing_genotypes = -9
)
x |
matrix or object coercable to a matrix. Genotypes, in phased format (two columns per individual).
Genotypes should be in single number format (0 or 1), such as produced by |
meta |
data.frame of object coercable to data.frame. Metadata for snp data, where column 1 is the chromsome
and column 2 is the position on the chromosome in bp,such as produced by |
phenos |
character vector. A vector containing the phenotypes for each individual, sorted identically to individuals in x. |
return_objects |
logical, default FALSE, If TRUE, returns a list with ped, bed, map, and bim data. Otherwise just saves files. |
missing_genotypes |
numeric, default -9. Encoding for missing alleles/genotypes. |
Either NULL or a list containing ped, bed, map, and bim formatted data.
William Hemstrom
Source code pulled from the snpR package by the same author for use here.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.