Last active
June 20, 2018 18:17
-
-
Save rvalieris/e8dc4c40068a6593f1f4bb19e41ad50c to your computer and use it in GitHub Desktop.
parallel genCountMatrixFromVcf
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
library(signeR) | |
library(VariantAnnotation) | |
library(BSgenome.Hsapiens.UCSC.hg19) | |
library(BiocParallel) | |
register(MulticoreParam(workers=5)) # use 5 cores | |
vcf = readVcf("a.vcf") | |
split_vcf = split(vcf,ceiling(seq_along(vcf)/1000)) # split vcf into chunks of 1000 rows | |
split_r = bplapply(split_vcf, function(p){genCountMatrixFromVcf(BSgenome.Hsapiens.UCSC.hg19, p)}) | |
result_matrix = Reduce('+', split_r) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment