set_array_job: 'Set up array job on farm'

Description Usage Arguments Value Examples

View source: R/set_jobs.R

Description

Farm is a computer cluster running slurm system. Note, bigmem mem=8000 per cpu, hi med low mem=25000 per cpu, serial mem=1500 per cpu.

Usage

1
2
3
4
5
6
set_array_job(shid = "largedata/GenSel/CL_test.sh",
  shcode = "sh largedata/myscript.sh", arrayjobs = "1-700",
  wd = NULL, jobid = "myjob", email = NULL, runinfo = c(TRUE,
  "bigmemh", "1", "10G", "8:00:00"))

get_runinfo(runinfo)

Arguments

shid

Relative or absolute path and file name of your shell code, i.e. CL_test.sh.

shcode

The commands inside your sh file.

arrayjobs

A character specify the number of array you try to run, i.e. 1-100.

wd

Working directory, default=NULL. It will use your current directory.

jobid

The job name show up in your sq NAME column.

email

Your email address that farm will email to once the job was done or failed.

runinfo

Parameters specify the array job partition information. A vector of c(TRUE, "bigmemh", "1"): 1) run or not, 2) -p partition name, and 3) –cpus.

Value

return a shell file.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
for(i in 1:10){
    shid <- paste0("slurm-script/run_", i, ".sh")
    command <- paste0("bedtools getfasta -name -tab -fi roast.chrom.", i, ".msa.in")
    cat(command, file=shid, sep="\n", append=FALSE)
}
shcode <- paste("module load bismark/0.14.3", "sh slurm-script/run_$SLURM_ARRAY_TASK_ID.sh", sep="\n")

set_array_job(shid="slurm-script/run.sh", shcode=shcode,
              arrayjobs="1-10", wd=NULL, jobid="myjob", email=NULL,
              run = c(TRUE, "bigmemh", "8196", "1"))

yangjl/huskeR documentation built on Sept. 2, 2021, 5:38 a.m.