run_rep.sh 1.52 KB
Newer Older
Venkat Malladi's avatar
Venkat Malladi committed
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
#!/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}
Venkat Malladi's avatar
Venkat Malladi committed
54
  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
Venkat Malladi's avatar
Venkat Malladi committed
55
56
57
58

}

main "$@"