View source: R/apply-parallelize.R
snp_split | R Documentation |
A Split-Apply-Combine strategy to parallelize the evaluation of a function on each SNP, independently.
snp_split(infos.chr, FUN, combine, ncores = 1, ...)
infos.chr |
Vector of integers specifying each SNP's chromosome. |
FUN |
The function to be applied. It must take a
FBM.code256 as first argument and |
combine |
function that is used by foreach::foreach to process the tasks results as they generated. This can be specified as either a function or a non-empty character string naming the function. Specifying 'c' is useful for concatenating the results into a vector, for example. The values 'cbind' and 'rbind' can combine vectors into a matrix. The values '+' and '*' can be used to process numeric data. By default, the results are returned in a list. |
ncores |
Number of cores used. Default doesn't use parallelism.
You may use |
... |
Extra arguments to be passed to |
This function splits indices for each chromosome, then apply a given function to each part (chromosome) and finally combine the results.
The result of foreach::foreach.
# parallelize over chromosomes made easy
# examples of functions from this package
snp_pruning
snp_clumping
snp_fastImpute
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.