#!/bin/bash script_name="run_rep.sh" #Help function usage() { echo "-h --Help documentation for $script_name" echo "-s --Study_RID." echo "-r --Rep_RID." echo "-t --Tag of pipelne" echo "-e --Email on failure" echo "-o --Path to output directory" echo "Example: $script_name -s 16-1ZP0 -r W-RB88 -t 0.1.0 -e 'first.last@utsouthwestern.edu' -o '/path/to/output/dir/'" exit 1 } main(){ # Load required modules module load python/3.6.4-anaconda module load nextflow/20.01.0 module load singularity/3.5.3 # Parsing options OPTIND=1 # Reset OPTIND while getopts :s:r:t:e:o:h opt do case $opt in s) study=$OPTARG;; r) rid=$OPTARG;; t) tag=$OPTARG;; e) email=$OPTARG;; o) out=$OPTARG;; h) usage;; esac done shift $(($OPTIND -1)) # Check for mandatory options if [[ -z $study ]] || [[ -z $rid ]] || [[ -z $tag ]] || [[ -z $email ]] || [[ -z $out ]]; then usage fi # change dir to study cd $out/$study cd rna-seq # run pipeline on replicate RIDs in parallel echo ${rid} nextflow -q run rna-seq.nf --repRID ${rid} --source dev --deriva /project/BICF/BICF_Core/shared/gudmap/test_data/auth/credential.json --bdbag /project/BICF/BICF_Core/shared/gudmap/test_data/auth/cookies.txt --dev false --upload true --track true --email ${email} -with-report ./output/${rid}_report.html -with-timeline ./output/${rid}_timeline.html } main "$@"