gt_as_plink | R Documentation |
gen_tibble
object to PLINK bed formatThis function exports all the information of a gen_tibble
object into a
PLINK bed, ped or raw file (and associated files, i.e. .bim and .fam for
.bed; .fam for .ped).
gt_as_plink(
x,
file = NULL,
type = c("bed", "ped", "raw"),
overwrite = TRUE,
chromosomes_as_int = FALSE
)
x |
a |
file |
a character string giving the path to output file. If left to NULL, the output file will have the same path and prefix of the backingfile. |
type |
one of "bed", "ped" or "raw" |
overwrite |
boolean whether to overwrite the file. |
chromosomes_as_int |
boolean whether to use the integer representation of the chromosomes |
If the gen_tibble has been read in from vcf format, family.ID in the resulting plink files will be the same as sample.ID. If the gen_tibble has a grouping variable, this will be used as the family.ID in the resulting plink files. NOTE that writing to bed has been optimised for speed, but writing to ped or raw is slower, especially for large datasets.
the path of the saved file
example_gt <- load_example_gt("gen_tbl")
# Write a bed file
example_gt %>% gt_as_plink(type = "bed", file = paste0(tempfile(), "_plink"))
# Write a ped file
example_gt %>% gt_as_plink(type = "ped", file = paste0(tempfile(), "_plink"))
# Write a raw file
example_gt %>% gt_as_plink(type = "raw", file = paste0(tempfile(), "_plink"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.