Last active
May 12, 2020 16:28
-
-
Save danielecook/dd109c5a4df17a3a65e30eb9f0f23f76 to your computer and use it in GitHub Desktop.
Parse format column in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_format_column <- | |
df[, .(rbindlist( | |
purrr::map2( | |
strsplit(vcf_format, ":", fixed=TRUE), | |
strsplit(vcf_gt, ":", fixed=TRUE), | |
function(x, y) { names(y) <- x; data.table(t(y)) } | |
) | |
) | |
), | |
] | |
parse_format_column <- hablar::retype(parse_format_column) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment