-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquantify_tiles.sbatch
More file actions
89 lines (74 loc) · 2.44 KB
/
Copy pathquantify_tiles.sbatch
File metadata and controls
89 lines (74 loc) · 2.44 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
#
# bash script to call quantifyTilesDownstream.py using SLURM scheduler on Sherlock
#
# Usage: quantify_tiles.sh image_dir seq_dir roff_dir fluor_dir gv_path
#
#all commands that start with SBATCH contain commands that are just used by SLURM for scheduling
#################
#set a job name
#SBATCH --job-name=quantify_tiles
#################
#a file for job output, you can check job progress
#SBATCH --output=quantify_tiles.out
#################
# a file for errors from the job
#SBATCH --error=quantify_tiles.err
#################
#time you think you need; default is one hour
#in minutes in this case, hh:mm:ss
#SBATCH --time=30:00:00
#################
#quality of service; think of it as job priority
#SBATCH --partition=owners
#SBATCH --qos=normal
#################
#number of nodes you are requesting
#SBATCH --nodes=1
#################
#tasks to run per node; a "task" is usually mapped to a MPI processes.
# for local parallelism (OpenMP or threads), use "--ntasks-per-node=1 --cpus-per-task=16" instead
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=18
#################
# Load matlab
module load matlab/R2012b
# Define paths
image_dir=$1
seq_dir=$2
roff_dir=$3
fluor_dir=$4
gv_path=$5
# Define other script parameters
num_cores="18"
data_scaling="MiSeq_to_TIRFStation1"
# Define filter subsets to use for registration
reg_subset1="MSI_4BM"
reg_subset2="MSI_0SP"
reg_subset3="MSI_1SP"
reg_subset4="MSI_2SP"
reg_subset5="MSI_3SP"
reg_subset6="MSI_4SP"
# Set outputs appropriately
script=$(basename $0)
script_name=${script%.*}
log_dir=$image_dir/$script_name"Logs"
log_file_suffix=".log"
err_file_suffix=".err"
mkdir -p $log_dir
# Quantification using SLURM scheduler
echo "Submitting jobs via SLURM..."
for d in $image_dir/*/
do
d_base=$(basename $d)
log_file=$log_dir/$d_base$log_file_suffix
err_file=$log_dir/$d_base$err_file_suffix
start_time=$SECONDS
echo "Starting quantification for $image_dir at timepoint $d_base..."
srun python2.7 /share/PI/wjg/lab/array_tools/CPscripts/quantifyTilesDownstream.py \
-id $image_dir -ftd $seq_dir -rod $roff_dir -fd $fluor_dir -n $num_cores \
-rs $reg_subset1 -rs $reg_subset2 -rs $reg_subset3 -rs $reg_subset4 -rs $reg_subset5 -rs $reg_subset6 \
-sf $data_scaling -gv $gv_path 1> $log_file 2> $err_file
duration=$(( SECONDS - start_time))
echo "Done with quantification for $image_dir at timepoint $d_base. Duration: $duration" | tee -a $log_file
done