read_plink {hibayes} | R Documentation |
data load
Description
To load plink binary data
Usage
read_plink(
bfile = "",
maxLine = 10000,
impute = TRUE,
mode = c("A", "D"),
out = NULL,
threads = 4
)
Arguments
bfile |
character, prefix of Plink binary format data. |
maxLine |
number, set the number of lines to read at a time. |
impute |
logical, whether to impute missing values in genotype by major alleles. |
mode |
"A" or "D", additive effect or dominant effect. |
out |
character, path and prefix of output file |
threads |
number, the number of used threads for parallel process |
Value
four files will be generated in the directed folder: "xx.desc", "xx.bin", "xx.id, "xx.map", where 'xx' is the prefix of the argument 'out', the memory-mapping files can be fast loaded into memory by 'geno = attach.big.matrix("xx.desc")'. Note that hibayes will code the genotype A1A1 as 2, A1A2 as 1, and A2A2 as 0, where A1 is the first allele of each marker in ".bim" file, therefore the estimated effect size is on A1 allele, users should pay attention to it when a process involves marker effect.
Examples
bfile_path = system.file("extdata", "demo", package = "hibayes")
data = read_plink(bfile_path, out=tempfile(), mode="A")
fam = data$fam
geno = data$geno
map = data$map