-
based on vignette https://jendelman.github.io/GWASpoly/GWASpoly.html
-
hard-coded to use future.batchtools plan with slurm
-
to run on head node
tar_make()
-
to run with HPC workers
tar_make_future(workers = 2L)
Last active
January 10, 2023 02:48
-
-
Save cfljam/588ef551a9e4eed35cd1d29bd076f204 to your computer and use it in GitHub Desktop.
targets workflow for GWASpoly Vignette
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
source("renv/activate.R") |
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
## load packages | |
suppressMessages(source("./packages.R")) | |
## Load your R files | |
lapply(list.files("./R", full.names = TRUE), source) | |
##---configuration for running on slurm -----#### | |
library(RLinuxModules) | |
module('load Slurm') | |
template <- file.path(here::here(), "slurm.tmpl") | |
future::plan( | |
strategy = batchtools_slurm, | |
template = template, | |
registry = list("cluster.functions$fs.latency" = 100) | |
) | |
##----global target options ----# | |
## specify default to running on head node and 4 cores for worker | |
#--can override individual targets by providing a full resources list---# | |
tar_option_set( | |
deployment = 'main', | |
error = "abridge", | |
storage = "main", | |
resources = tar_resources(future = | |
tar_resources_future(resources = | |
list(ncpus = 4, | |
walltime = 100, | |
memory=1000))) | |
) | |
##-----------------------------------------------#### | |
list( | |
tar_target( | |
genofile, | |
system.file("extdata", "new_potato_geno.csv", package = "GWASpoly"), | |
format = 'file' | |
), | |
tar_target( | |
phenofile, | |
system.file("extdata", "new_potato_pheno.csv", package = "GWASpoly"), | |
format = 'file' | |
), | |
tar_target( | |
data, | |
read.GWASpoly( | |
ploidy = 4, | |
pheno.file = phenofile, | |
geno.file = genofile, | |
format = "numeric", | |
n.traits = 1, | |
delim = "," | |
) | |
), | |
tar_target(data.loco , | |
set.K(data, LOCO = TRUE, n.core = 4), | |
deployment = 'worker'), | |
tar_target(data.original, | |
set.K(data, LOCO = FALSE, n.core = 4), | |
deployment = 'worker'), | |
tar_target( | |
params, | |
set.params( | |
geno.freq = 1 - 5 / nrow(data@geno), | |
fixed = "env", | |
fixed.type = "factor" | |
) | |
), | |
tar_target( | |
data.loco.scan, | |
GWASpoly( | |
data = data.loco, | |
models = c("additive", "1-dom"), | |
traits = c("vine.maturity"), | |
params = params, | |
n.core = 16 | |
), | |
deployment = 'worker', | |
resources = tar_resources(# run this with 16 cores | |
future = tar_resources_future( | |
resources = list(ncpus = 16, | |
walltime = 100, | |
memory = 10000))) | |
), | |
tar_target( | |
data.original.scan, | |
GWASpoly( | |
data.original, | |
models = c("additive", "1-dom"), | |
traits = c("vine.maturity"), | |
params = params, | |
n.core = 16 | |
), | |
deployment = 'worker', | |
resources = tar_resources(# run this with 16 cores | |
future = tar_resources_future( | |
resources = list(ncpus = 16, | |
walltime = 100, | |
memory = 10000))) | |
), | |
tar_render( | |
report, | |
'./GWAS_poly_with_Targets_Vignette.Rmd', | |
deployment = 'worker' | |
) | |
) |
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
--- | |
title: "Targets GWAS Poly Demo" | |
author: "John McCallum" | |
date: "`r format(Sys.time(), '%d %B, %Y')`" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
knitr::opts_knit$set(root.dir =here::here()) | |
``` | |
## Load Up Objects | |
```{r} | |
tar_load(c(data, | |
data.original.scan, | |
data.loco.scan)) | |
``` | |
### Inspect the Phenotype | |
```{r plot.vine.maturity} | |
data@pheno %>% | |
ggplot(aes(x=vine.maturity)) + geom_histogram() | |
``` | |
```{r qqplot.original} | |
qq.plot(data.original.scan,trait="vine.maturity") + ggtitle(label="Original") | |
``` | |
```{r qqplot.loco} | |
qq.plot(data.loco.scan,trait="vine.maturity") + ggtitle(label="LOCO") | |
``` | |
```{r} | |
data2 <- set.threshold(data.loco.scan,method="Bonferroni",level=0.05) | |
``` | |
```{r manhattan.plot.all} | |
p <- manhattan.plot(data2,traits="vine.maturity") | |
p + theme(axis.text.x = element_text(angle=90,vjust=0.5)) | |
``` | |
```{r manhattan.plot.chr05} | |
manhattan.plot(data2,traits="vine.maturity",chrom="chr05") | |
``` | |
```{r} | |
p <- LD.plot(data2) | |
p + xlim(0,30) | |
``` | |
```{r} | |
qtl <- get.QTL(data=data2,traits="vine.maturity",models="additive",bp.window=5e6) | |
knitr::kable(qtl) | |
``` | |
```{r} | |
fit.ans <- fit.QTL(data=data2,trait="vine.maturity", | |
qtl=qtl[,c("Marker","Model")], | |
fixed=data.frame(Effect="env",Type="factor")) | |
knitr::kable(fit.ans,digits=3) | |
``` | |
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(targets) | |
library(tarchetypes) | |
library(future) | |
library(future.batchtools) | |
library(here) | |
library(GWASpoly) | |
library(ggplot2) | |
library(dplyr) |
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
{ | |
"R": { | |
"Version": "4.0.0", | |
"Repositories": [ | |
{ | |
"Name": "CRAN", | |
"URL": "https://cran.stat.auckland.ac.nz" | |
}, | |
{ | |
"Name": "CRANextra", | |
"URL": "https://www.stats.ox.ac.uk/pub/RWin" | |
} | |
] | |
}, | |
"Packages": { | |
"GWASpoly": { | |
"Package": "GWASpoly", | |
"Version": "2.10", | |
"Source": "GitHub", | |
"RemoteType": "github", | |
"RemoteHost": "api.github.com", | |
"RemoteUsername": "jendelman", | |
"RemoteRepo": "GWASpoly", | |
"RemoteRef": "master", | |
"RemoteSha": "0beaa165287278f866764d3278fec85c9bbc87d2", | |
"Hash": "17a1136a0fc26e50d13cfda4ad111c99" | |
}, | |
"MASS": { | |
"Package": "MASS", | |
"Version": "7.3-54", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "0e59129db205112e3963904db67fd0dc" | |
}, | |
"Matrix": { | |
"Package": "Matrix", | |
"Version": "1.3-4", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "4ed05e9c9726267e4a5872e09c04587c" | |
}, | |
"R6": { | |
"Package": "R6", | |
"Version": "2.5.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "470851b6d5d0ac559e9d01bb352b4021" | |
}, | |
"RColorBrewer": { | |
"Package": "RColorBrewer", | |
"Version": "1.1-2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "e031418365a7f7a766181ab5a41a5716" | |
}, | |
"RLinuxModules": { | |
"Package": "RLinuxModules", | |
"Version": "0.4", | |
"Source": "GitHub", | |
"RemoteType": "github", | |
"RemoteHost": "api.github.com", | |
"RemoteRepo": "RLinuxModules", | |
"RemoteUsername": "kiwiroy", | |
"RemoteRef": "main", | |
"RemoteSha": "d158522e4af50d171013430fbc892513ed6872fe", | |
"Hash": "3c1d6f5ea5cea2ea84ca75045c8fecf2" | |
}, | |
"Rcpp": { | |
"Package": "Rcpp", | |
"Version": "1.0.7", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "dab19adae4440ae55aa8a9d238b246bb" | |
}, | |
"backports": { | |
"Package": "backports", | |
"Version": "1.2.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "644043219fc24e190c2f620c1a380a69" | |
}, | |
"base64url": { | |
"Package": "base64url", | |
"Version": "1.4", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "0c54cf3a08cc0e550fbd64ad33166143" | |
}, | |
"batchtools": { | |
"Package": "batchtools", | |
"Version": "0.9.16", | |
"Source": "GitHub", | |
"RemoteType": "github", | |
"RemoteHost": "api.github.com", | |
"RemoteUsername": "mllg", | |
"RemoteRepo": "batchtools", | |
"RemoteRef": "master", | |
"RemoteSha": "63a6f812927f6dc78595abbffac0f6bc9651f67a", | |
"Hash": "e51eaa383f84199add5b827f1cc9be7f" | |
}, | |
"brew": { | |
"Package": "brew", | |
"Version": "1.0-6", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "92a5f887f9ae3035ac7afde22ba73ee9" | |
}, | |
"callr": { | |
"Package": "callr", | |
"Version": "3.7.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "461aa75a11ce2400245190ef5d3995df" | |
}, | |
"checkmate": { | |
"Package": "checkmate", | |
"Version": "2.0.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "a667800d5f0350371bedeb8b8b950289" | |
}, | |
"cli": { | |
"Package": "cli", | |
"Version": "3.0.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "e3ae5d68dea0c55a12ea12a9fda02e61" | |
}, | |
"codetools": { | |
"Package": "codetools", | |
"Version": "0.2-18", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "019388fc48e48b3da0d3a76ff94608a8" | |
}, | |
"colorspace": { | |
"Package": "colorspace", | |
"Version": "2.0-3", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "bb4341986bc8b914f0f0acf2e4a3f2f7" | |
}, | |
"cpp11": { | |
"Package": "cpp11", | |
"Version": "0.4.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "fa53ce256cd280f468c080a58ea5ba8c" | |
}, | |
"crayon": { | |
"Package": "crayon", | |
"Version": "1.4.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "e75525c55c70e5f4f78c9960a4b402e9" | |
}, | |
"data.table": { | |
"Package": "data.table", | |
"Version": "1.14.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "d1b8b1a821ee564a3515fa6c6d5c52dc" | |
}, | |
"digest": { | |
"Package": "digest", | |
"Version": "0.6.27", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "a0cbe758a531d054b537d16dff4d58a1" | |
}, | |
"dplyr": { | |
"Package": "dplyr", | |
"Version": "1.0.8", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "ef47665e64228a17609d6df877bf86f2" | |
}, | |
"ellipsis": { | |
"Package": "ellipsis", | |
"Version": "0.3.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "bb0eec2fe32e88d9e2836c2f73ea2077" | |
}, | |
"evaluate": { | |
"Package": "evaluate", | |
"Version": "0.14", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "ec8ca05cffcc70569eaaad8469d2a3a7" | |
}, | |
"fansi": { | |
"Package": "fansi", | |
"Version": "0.5.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "d447b40982c576a72b779f0a3b3da227" | |
}, | |
"farver": { | |
"Package": "farver", | |
"Version": "2.1.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "c98eb5133d9cb9e1622b8691487f11bb" | |
}, | |
"fs": { | |
"Package": "fs", | |
"Version": "1.5.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "44594a07a42e5f91fac9f93fda6d0109" | |
}, | |
"future": { | |
"Package": "future", | |
"Version": "1.17.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "71c119f236429d7b19fd29229b013cba" | |
}, | |
"future.batchtools": { | |
"Package": "future.batchtools", | |
"Version": "0.9.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "f2faf6ddab900e70baae574dfc96d417" | |
}, | |
"generics": { | |
"Package": "generics", | |
"Version": "0.1.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "177475892cf4a55865868527654a7741" | |
}, | |
"ggplot2": { | |
"Package": "ggplot2", | |
"Version": "3.3.5", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "d7566c471c7b17e095dd023b9ef155ad" | |
}, | |
"globals": { | |
"Package": "globals", | |
"Version": "0.12.5", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "e9e529fb7a579ad4b4ff65e052e76ed8" | |
}, | |
"glue": { | |
"Package": "glue", | |
"Version": "1.4.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "6efd734b14c6471cfe443345f3e35e29" | |
}, | |
"gtable": { | |
"Package": "gtable", | |
"Version": "0.3.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "ac5c6baf7822ce8732b343f14c072c4d" | |
}, | |
"here": { | |
"Package": "here", | |
"Version": "1.0.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "24b224366f9c2e7534d2344d10d59211" | |
}, | |
"highr": { | |
"Package": "highr", | |
"Version": "0.8", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "4dc5bb88961e347a0f4d8aad597cbfac" | |
}, | |
"hms": { | |
"Package": "hms", | |
"Version": "0.5.3", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "726671f634529d470545f9fd1a9d1869" | |
}, | |
"htmltools": { | |
"Package": "htmltools", | |
"Version": "0.4.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "2d7691222f82f41e93f6d30f169bd5e1" | |
}, | |
"igraph": { | |
"Package": "igraph", | |
"Version": "1.2.6", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "7b1f856410253d56ea67ad808f7cdff6" | |
}, | |
"isoband": { | |
"Package": "isoband", | |
"Version": "0.2.5", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "7ab57a6de7f48a8dc84910d1eca42883" | |
}, | |
"jsonlite": { | |
"Package": "jsonlite", | |
"Version": "1.7.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "98138e0994d41508c7a6b84a0600cfcb" | |
}, | |
"knitr": { | |
"Package": "knitr", | |
"Version": "1.28", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "915a6f0134cdbdf016d7778bc80b2eda" | |
}, | |
"labeling": { | |
"Package": "labeling", | |
"Version": "0.4.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "3d5108641f47470611a32d0bdf357a72" | |
}, | |
"lattice": { | |
"Package": "lattice", | |
"Version": "0.20-44", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "f36bf1a849d9106dc2af72e501f9de41" | |
}, | |
"lifecycle": { | |
"Package": "lifecycle", | |
"Version": "1.0.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "a6b6d352e3ed897373ab19d8395c98d0" | |
}, | |
"listenv": { | |
"Package": "listenv", | |
"Version": "0.8.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "0bde42ee282efb18c7c4e63822f5b4f7" | |
}, | |
"magrittr": { | |
"Package": "magrittr", | |
"Version": "2.0.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "41287f1ac7d28a92f0a286ed507928d3" | |
}, | |
"markdown": { | |
"Package": "markdown", | |
"Version": "1.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "61e4a10781dd00d7d81dd06ca9b94e95" | |
}, | |
"mgcv": { | |
"Package": "mgcv", | |
"Version": "1.8-31", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "4bb7e0c4f3557583e1e8d3c9ffb8ba5c" | |
}, | |
"mime": { | |
"Package": "mime", | |
"Version": "0.11", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "8974a907200fc9948d636fe7d85ca9fb" | |
}, | |
"munsell": { | |
"Package": "munsell", | |
"Version": "0.5.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "6dfe8bf774944bd5595785e3229d8771" | |
}, | |
"nlme": { | |
"Package": "nlme", | |
"Version": "3.1-147", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "dd4a1423f1472a2a8e05dd2c8945c3af" | |
}, | |
"pillar": { | |
"Package": "pillar", | |
"Version": "1.6.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "43f228eb4b49093d1c8a5c93cae9efe9" | |
}, | |
"pkgconfig": { | |
"Package": "pkgconfig", | |
"Version": "2.0.3", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "01f28d4278f15c76cddbea05899c5d6f" | |
}, | |
"prettyunits": { | |
"Package": "prettyunits", | |
"Version": "1.1.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "95ef9167b75dde9d2ccc3c7528393e7e" | |
}, | |
"processx": { | |
"Package": "processx", | |
"Version": "3.5.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "0cbca2bc4d16525d009c4dbba156b37c" | |
}, | |
"progress": { | |
"Package": "progress", | |
"Version": "1.2.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "14dc9f7a3c91ebb14ec5bb9208a07061" | |
}, | |
"ps": { | |
"Package": "ps", | |
"Version": "1.6.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "32620e2001c1dce1af49c49dccbb9420" | |
}, | |
"purrr": { | |
"Package": "purrr", | |
"Version": "0.3.4", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "97def703420c8ab10d8f0e6c72101e02" | |
}, | |
"rappdirs": { | |
"Package": "rappdirs", | |
"Version": "0.3.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "8c8298583adbbe76f3c2220eef71bebc" | |
}, | |
"renv": { | |
"Package": "renv", | |
"Version": "0.11.0-14", | |
"Source": "GitHub", | |
"RemoteType": "github", | |
"RemoteHost": "api.github.com", | |
"RemoteRepo": "renv", | |
"RemoteUsername": "rstudio", | |
"RemoteRef": "master", | |
"RemoteSha": "268ba8395c4d2af5266ae64e3f42e25074ec9a6c", | |
"Hash": "213287134488ec4e1b3a1066f2ff3d21" | |
}, | |
"rlang": { | |
"Package": "rlang", | |
"Version": "1.0.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "04884d9a75d778aca22c7154b8333ec9" | |
}, | |
"rmarkdown": { | |
"Package": "rmarkdown", | |
"Version": "2.9", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "912c09266d5470516df4df7a303cde92" | |
}, | |
"rprojroot": { | |
"Package": "rprojroot", | |
"Version": "2.0.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "249d8cd1e74a8f6a26194a91b47f21d1" | |
}, | |
"rrBLUP": { | |
"Package": "rrBLUP", | |
"Version": "4.6.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "a3e95926d31b1a79c09bd0e39c782ea2" | |
}, | |
"scales": { | |
"Package": "scales", | |
"Version": "1.1.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "6f76f71042411426ec8df6c54f34e6dd" | |
}, | |
"scam": { | |
"Package": "scam", | |
"Version": "1.2-12", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "40f1581fb02ebfbf2720dd019ba2fc46" | |
}, | |
"stringi": { | |
"Package": "stringi", | |
"Version": "1.7.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "45c84ccfd359febce4c7545fee3d36cb" | |
}, | |
"stringr": { | |
"Package": "stringr", | |
"Version": "1.4.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "0759e6b6c0957edb1311028a49a35e76" | |
}, | |
"tarchetypes": { | |
"Package": "tarchetypes", | |
"Version": "0.3.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "343b4fab1cb5d4f53d4cfb1d74ed8dfe" | |
}, | |
"targets": { | |
"Package": "targets", | |
"Version": "0.7.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "f3bb17418c64dda3c4d4992f31e77afb" | |
}, | |
"tibble": { | |
"Package": "tibble", | |
"Version": "3.1.4", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "5e8ad5621e5c94b24ec07b88eee13df8" | |
}, | |
"tidyr": { | |
"Package": "tidyr", | |
"Version": "1.2.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "d8b95b7fee945d7da6888cf7eb71a49c" | |
}, | |
"tidyselect": { | |
"Package": "tidyselect", | |
"Version": "1.1.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "7243004a708d06d4716717fa1ff5b2fe" | |
}, | |
"tinytex": { | |
"Package": "tinytex", | |
"Version": "0.32", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "db9a6f2cf147751322d22c9f6647c7bd" | |
}, | |
"utf8": { | |
"Package": "utf8", | |
"Version": "1.2.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "c9c462b759a5cc844ae25b5942654d13" | |
}, | |
"vctrs": { | |
"Package": "vctrs", | |
"Version": "0.3.8", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "ecf749a1b39ea72bd9b51b76292261f1" | |
}, | |
"viridisLite": { | |
"Package": "viridisLite", | |
"Version": "0.4.0", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "55e157e2aa88161bdb0754218470d204" | |
}, | |
"withr": { | |
"Package": "withr", | |
"Version": "2.4.2", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "ad03909b44677f930fa156d47d7a3aeb" | |
}, | |
"xfun": { | |
"Package": "xfun", | |
"Version": "0.24", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "88cdb9779a657ad80ad942245fffba31" | |
}, | |
"yaml": { | |
"Package": "yaml", | |
"Version": "2.2.1", | |
"Source": "Repository", | |
"Repository": "CRAN", | |
"Hash": "2826c5d9efb0a88f657c7a679c7106db" | |
} | |
} | |
} |
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
#!/bin/bash | |
## Job Resource Interface Definition | |
## | |
## ntasks [integer(1)]: Number of required tasks, | |
## Set larger than 1 if you want to further parallelize | |
## with MPI within your job. | |
## ncpus [integer(1)]: Number of required cpus per task, | |
## Set larger than 1 if you want to further parallelize | |
## with multicore/parallel within each task. | |
## walltime [integer(1)]: Walltime for this job, in seconds. | |
## Must be at least 60 seconds for Slurm to work properly. | |
## memory [integer(1)]: Memory in megabytes for each cpu. | |
## Must be at least 100 (when I tried lower values my | |
## jobs did not start at all). | |
## | |
## Default resources can be set in your .batchtools.conf.R by defining the variable | |
## 'default.resources' as a named list. | |
<% | |
# relative paths are not handled well by Slurm | |
log.file = fs::path_expand(log.file) | |
-%> | |
#SBATCH --job-name=<%= job.name %> | |
#SBATCH --output=<%= log.file %> | |
#SBATCH --error=<%= log.file %> | |
#SBATCH --time=<%= as.integer(resources$walltime) %> | |
#SBATCH --ntasks=1 | |
#SBATCH --cpus-per-task=<%= resources$ncpus %> | |
#SBATCH --mem=<%= as.numeric(resources$memory) %> | |
<%= if (!is.null(resources$partition)) sprintf(paste0("#SBATCH --partition='", resources$partition, "'")) %> | |
<%= if (array.jobs) sprintf("#SBATCH --array=1-%i", nrow(jobs)) else "" %> | |
## Initialize work environment like | |
## source /etc/profile | |
## module add ... | |
## Export value of DEBUGME environemnt var to slave | |
export DEBUGME=<%= Sys.getenv("DEBUGME") %> | |
<%= sprintf("export OMP_NUM_THREADS=%i", resources$omp.threads) -%> | |
<%= sprintf("export OPENBLAS_NUM_THREADS=%i", resources$blas.threads) -%> | |
<%= sprintf("export MKL_NUM_THREADS=%i", resources$blas.threads) -%> | |
## Run R: | |
module load R/4.0.0 | |
## we merge R output with stdout from SLURM, which gets then logged via --output option | |
Rscript -e 'batchtools::doJobCollection("<%= uri %>")' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment