-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.pbs
70 lines (56 loc) · 2.07 KB
/
next.pbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
#
# next.pbs
#
# mads
# 2024-07-02
#
# This is a simple wrapper that that runs the DoBSeq workflow on NGC.
# The pipeline profile uses environment modules and runs all processes as submitted jobs.
#
#
# Usage:
#
# myqsub [-F "optional arguments to Nexflow"] next.pbs
#
#PBS -l nodes=1:ppn=40:thinnode
#PBS -l walltime=24:00:00
#PBS -l mem=160gb
#PBS -j oe
#PBS -N nextflow
## exit if any errors or unset variables are encountered
set -euo pipefail
## Add environment variables for making Nextflow able to run wo. internet access.
name=nf_tools
version=2.0
root=/ngc/tools/ngctools/${name}/${version}
data=/ngc/shared/${name}
export NXF_SINGULARITY_CACHEDIR=${data}/containers
export NXF_ASSETS=${root}/pipelines
export NXF_SCM_FILE=${root}/scm
export NXF_PLUGINS_DIR=${data}/plugins
# Disable interactive logging
#export NXF_ANSI_LOG=false
module load tools ngctools jdk/21.0.1 nextflow/24.08.0-edge
nextflow_essential_params='-profile ngc -resume'
nextflow_command="nextflow run main.nf $nextflow_essential_params $@"
echo "-------- Log generated by nextflow.pbs -------" | tee -a nextflow.log
echo "Command: $0 $@" | tee -a nextflow.log
echo "User:" `whoami` | tee -a nextflow.log
echo "Date:" `date -Is` | tee -a nextflow.log
echo "PBS job ID: ${PBS_JOBID-none}" | tee -a nextflow.log
echo 'DoBSeq version:' `cat VERSION` | tee -a nextflow.log
echo 'git commit:' `(git rev-parse HEAD)` | tee -a nextflow.log
echo 'git status:' | tee -a nextflow.log
(git status -bs) | sed "s/^/ /" | tee -a nextflow.log
echo 'Nextflow version:' `nextflow -version` 2>&1 | tee -a nextflow.log
echo "Nextflow command: ${nextflow_command}" | tee -a nextflow.log
echo `date -Is` "--------------------- Starting Nextflow ---------------------" | tee -a nextflow.log
set +eo pipefail
${nextflow_command} 2>&1 | tee -a nextflow.log
echo `date -Is` "--------------------- Nextflow finished ---------------------" | tee -a nextflow.log
if [ -z ${PBS_JOBID+x} ]; then
echo "This was not run as a PBS job" | tee -a nextflow.log
else
echo "This was run as PBS job ${PBS_JOBID}" | tee -a nextflow.log
fi