-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement and refactoring #6
Comments
Note: PLINK is used to convert from VCF to BED/BIM/FAM for |
Notes:
|
In fact, we might want and be able to remove PLINK completely with something like the following: geno_mat <- unique(data.table::setnames(
x = data.table::fread(
cmd = paste(
bcftools, "query",
"--format", "'%CHROM\t%POS\t%REF\t%ALT[\t%GT]\n'",
"--print-header",
file.path(output_directory, "all-samples-1kg.vcf.gz")
),
sep = "\t"
),
old = function(x) sub("^#", "", sub(":GT", "", sub(" *\\[[[:digit:]]+\\]", "", x)))
))
sample_columns <- setdiff(names(geno_mat), c("CHROM", "POS", "REF", "ALT"))
geno_mat <- geno_mat[
j = (sample_columns) := lapply(
X = .SD,
FUN = function(x) c("00" = 0L, "10" = 1L, "01" = 1L, "11" = 2L)[sub("/|\\|", "", x)]
),
.SDcols = sample_columns
][order(CHROM, POS)]
pca_res <- flashpcaR::flashpca(
X = geno_mat[j = .SD, .SDcols = !c("CHROM", "POS", "REF", "ALT")],
ndim = n_comp
) |
After using the function R/estimate_ethnicity.R (on exom sequencing data)
We have discussed about several enhancement to developed :
(only keep bcftools)
The text was updated successfully, but these errors were encountered: