#' @export
#' @author CainĂ£ Max Couto-Silva
subset_vcf <- function(vcf, ids, out) {
# Create temporary file to store list of individuals
tmp <- paste0(gsub(" ", "_", Sys.time()), "_tmp.txt")
writeLines(ids, tmp)
# Run Plink to remove them
plink2 (
`--vcf` = vcf,
`--keep` = tmp,
`--export` = "vcf bgz",
`--out` = out
)
# Remove temporary file
unlink(tmp)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.