Comments (3)
Note: PLINK is used to convert from VCF to BED/BIM/FAM for flashpcaR
to use directly.
from rain.
Notes:
- VCFtools (and awk) to be replaced by BCFtools call:
- I think we should embedded PLINK within the package to avoid having to download a binary. This would make the dependency contained.
from rain.
Note: PLINK is used to convert from VCF to BED/BIM/FAM for
flashpcaR
to use directly.
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
)
from rain.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rain.