{"id":22569115,"url":"https://github.com/futureverse/BiocParallel.FutureParam","last_synced_at":"2025-08-04T18:32:56.171Z","repository":{"id":8753016,"uuid":"58335008","full_name":"HenrikBengtsson/BiocParallel.FutureParam","owner":"HenrikBengtsson","description":":rocket: R package: BiocParallel.FutureParam - Use Futures with BiocParallel","archived":false,"fork":false,"pushed_at":"2022-12-01T17:57:27.000Z","size":356,"stargazers_count":7,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-05-09T10:35:49.995Z","etag":null,"topics":["bioconductor","package","parallel-programming","r"],"latest_commit_sha":null,"homepage":"https://BiocParallel.FutureParam.futureverse.org","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HenrikBengtsson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-08T22:51:16.000Z","updated_at":"2021-12-17T00:48:25.000Z","dependencies_parsed_at":"2023-01-11T17:28:01.018Z","dependency_job_id":null,"html_url":"https://github.com/HenrikBengtsson/BiocParallel.FutureParam","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenrikBengtsson%2FBiocParallel.FutureParam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenrikBengtsson%2FBiocParallel.FutureParam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenrikBengtsson%2FBiocParallel.FutureParam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HenrikBengtsson%2FBiocParallel.FutureParam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HenrikBengtsson","download_url":"https://codeload.github.com/HenrikBengtsson/BiocParallel.FutureParam/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228672349,"owners_count":17954966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioconductor","package","parallel-programming","r"],"created_at":"2024-12-08T00:18:04.941Z","updated_at":"2025-08-04T18:32:50.651Z","avatar_url":"https://github.com/HenrikBengtsson.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\u003cdiv id=\"badges\"\u003e\u003c!-- pkgdown markup --\u003e\n \u003ca href=\"https://github.com/HenrikBengtsson/BiocParallel.FutureParam/actions?query=workflow%3AR-CMD-check\"\u003e\u003cimg border=\"0\" src=\"https://github.com/HenrikBengtsson/BiocParallel.FutureParam/actions/workflows/R-CMD-check.yaml/badge.svg?branch=develop\" alt=\"R CMD check status\"/\u003e\u003c/a\u003e    \u003ca href=\"https://ci.appveyor.com/project/HenrikBengtsson/biocparallel-futureparam\"\u003e\u003cimg border=\"0\" src=\"https://ci.appveyor.com/api/projects/status/github/HenrikBengtsson/BiocParallel.FutureParam?svg=true\" alt=\"Build status\"/\u003e\u003c/a\u003e \u003ca href=\"https://app.codecov.io/gh/HenrikBengtsson/BiocParallel.FutureParam\"\u003e\u003cimg border=\"0\" src=\"https://codecov.io/gh/HenrikBengtsson/BiocParallel.FutureParam/branch/develop/graph/badge.svg\" alt=\"Coverage Status\"/\u003e\u003c/a\u003e \u003ca href=\"https://lifecycle.r-lib.org/articles/stages.html\"\u003e\u003cimg border=\"0\" src=\"man/figures/lifecycle-experimental-orange.svg\" alt=\"Life cycle: experimental\"/\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n# BiocParallel.FutureParam: Use Futures with BiocParallel \n\n_WARNING: This package is experimental and a proof of concept what could be done with **BiocParallel** and the future framework._\n\n## Introduction\n\nThe [future] package provides a generic API for using futures in R.\nA future is a simple yet powerful mechanism to evaluate an R expression\nand retrieve its value at some point in time.  Futures can be resolved\nin many different ways depending on which strategy is used.\nThere are various types of synchronous and asynchronous futures to\nchoose from in the [future] package.\nAdditional futures are implemented in other packages.\nFor instance, the [future.batchtools] package provides futures for\n_any_ type of backend that the [batchtools] package supports.\nFor an introduction to futures in R, please consult the\nvignettes of the [future] package.\n\nThe [BiocParallel.FutureParam] package provides FutureParam, a BiocParallelParam class, for the [BiocParallel] package that works with _any_ type of future.\nThe BiocParallel.FutureParam package is cross platform just as the future package.\n\nBelow is an example showing how to use FutureParam with\n_multicore_ futures.  A multicore future will be evaluated in\nparallel using forked workers, which is not supported on MS Windows\nwhen it will fall back to sequential processing.\n\n```r\nlibrary(\"BiocParallel.FutureParam\")\nregister(FutureParam())\nplan(multicore)\n\nmu \u003c- 1.0\nsigma \u003c- 2.0\nx \u003c- bplapply(1:3, mu = mu, sigma = sigma, function(i, mu, sigma) {\n  rnorm(i, mean = mu, sd = sigma)\n})\n```\n\n\n## FutureParam replaces existing BiocParallelParam classes\n\nDue to the generic nature of futures, the FutureParam class\nprovides the same functionality as many of the existing\nBiocParallelParam classes, e.g. SerialParam, SnowParam,\nMulticoreParam, BatchtoolsParam and DoparParam.  In addition,\nit provides supports for additional backends that are not yet\nimplemented in [BiocParallel], e.g. [callr] and [batchtools].\n\n\u003ctable style=\"width: 100%;\"\u003e\n\u003ctr\u003e\n\u003cth\u003eBiocParallel usage\u003c/th\u003e\u003cth\u003eBiocParallel.FutureParam alternative\u003c/th\u003e\n\u003c/tr\u003e\n\n\u003ctr style=\"vertical-align: center;\"\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel\")\nregister(SerialParam())\n\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel.FutureParam\")\nregister(FutureParam())\nplan(sequential)\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr style=\"vertical-align: center;\"\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel\")\nregister(MulticoreParam())\n\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel.FutureParam\")\nregister(FutureParam())\nplan(multicore)\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr style=\"vertical-align: center;\"\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel\")\nregister(SnowParam(2, type = \"SOCK\"))\n\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel.FutureParam\")\nregister(FutureParam())\nplan(multisession, workers = 2)\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr style=\"vertical-align: center;\"\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel\")\ncl \u0026lt;- parallel::makeCluster(2, type = \"SOCK\")\nregister(as(cl, \"SnowParam\"))\n\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel.FutureParam\")\nregister(FutureParam())\ncl \u0026lt;- parallel::makeCluster(2, type = \"SOCK\")\nplan(cluster, workers = cl)\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr style=\"vertical-align: center;\"\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel\")\nregister(SnowParam(4, type = \"MPI\"))\n\n\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel.FutureParam\")\nregister(FutureParam())\ncl \u0026lt;- parallel::makeCluster(4, type = \"MPI\")\nplan(cluster, workers = cl)\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr style=\"vertical-align: center;\"\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel\")\nregister(BatchtoolsParam(cluster=\"sge\",\n                         template=\"~/sge.tmpl\"))\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel.FutureParam\")\nregister(FutureParam())\nplan(future.batchtools::batchtools_sge,\n     template = \"~/sge.tmpl\")\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr style=\"vertical-align: center;\"\u003e\n\u003ctd\u003e\nN/A\n\u003c/td\u003e\n\u003ctd\u003e\n\u003cpre\u003e\u003ccode class=\"r\"\u003elibrary(\"BiocParallel.FutureParam\")\nregister(FutureParam())\nplan(future.callr::callr)\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\n## Something not working?\n\nPlease note that this package, **BiocParallel.FutureParam**, is in an experimental stage and does not get as much real-world use as other **BiocParallel** backends.  Thus, if you run into a problem when using this package, it could very well be a bug.  However, before you report the problem, please try with the **[doFuture]**, `registerDoFuture()`, and the `DoparParam()` backend of **BiocParallel**, e.g.\n\n```r\nlibrary(\"BiocParallel\")\nlibrary(\"doFuture\")\nregister(DoparParam()) ## Tell BiocParallel to use a foreach backend\nregisterDoFuture()     ## Tell foreach to use a future backend\nplan(multicore)        ## Tell future to use the multicore backend\n\nmu \u003c- 1.0\nsigma \u003c- 2.0\nx \u003c- bplapply(1:3, mu = mu, sigma = sigma, function(i, mu, sigma) {\n  rnorm(i, mean = mu, sd = sigma)\n})\n```\n\nIf that works, but not with `register(FutureParam())`, then it's a bug in the **BiocParallel.FutureParam** package.  Please report this at \u003chttps://github.com/HenrikBengtsson/BiocParallel.FutureParam/issues\u003e.\n\n\n[batchtools]: https://cran.r-project.org/package=batchtools\n[callr]: https://cran.r-project.org/package=callr\n[BiocParallel]: https://bioconductor.org/packages/release/bioc/html/BiocParallel.html\n[BiocParallel.FutureParam]: https://github.com/HenrikBengtsson/BiocParallel.FutureParam\n[future]: https://cran.r-project.org/package=future\n[doFuture]: https://cran.r-project.org/package=doFuture\n[future.batchtools]: https://cran.r-project.org/package=future.batchtools\n[future.callr]: https://cran.r-project.org/package=future.callr\n\n## Installation\nR package BiocParallel.FutureParam is only available via [GitHub](https://github.com/HenrikBengtsson/BiocParallel.FutureParam) and can be installed in R as:\n```r\nremotes::install_github(\"HenrikBengtsson/BiocParallel.FutureParam\", ref=\"master\")\n```\n\n\n### Pre-release version\n\nTo install the pre-release version that is available in Git branch `develop` on GitHub, use:\n```r\nremotes::install_github(\"HenrikBengtsson/BiocParallel.FutureParam\", ref=\"develop\")\n```\nThis will install the package from source.  \n\n\u003c!-- pkgdown-drop-below --\u003e\n\n\n## Contributing\n\nTo contribute to this package, please see [CONTRIBUTING.md](CONTRIBUTING.md).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffutureverse%2FBiocParallel.FutureParam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffutureverse%2FBiocParallel.FutureParam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffutureverse%2FBiocParallel.FutureParam/lists"}