-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpipeline.sh
More file actions
executable file
·31 lines (25 loc) · 1 KB
/
pipeline.sh
File metadata and controls
executable file
·31 lines (25 loc) · 1 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
#!/bin/bash
#SBATCH --job-name=mapler
#SBATCH --time=3-00:00:00
#SBATCH --mem=5G
config=${1:-"config/config.yaml"}
if [[ "$config" == "config/config_test.yaml" ]]; then
tar -xf "test/test_dataset.tar.gz"
fi
analysis_name=$(grep "analysis_name:" $config | cut -d " " -f 2)
timestamp=$(date +"%Y-%m-%d_%H-%M-%S")
log_directory=logs/$analysis_name/$timestamp/
# Log config file and git info
mkdir -p $log_directory
cp $config $log_directory/config.yaml
echo "Branch: $(git rev-parse --abbrev-ref HEAD)" > $log_directory/git_info.txt
echo "Latest Commit: $(git rev-parse HEAD)" >> $log_directory/git_info.txt
# Launch the pipeline
snakemake all --cores all --executor slurm --jobs 10 \
--printshellcmds --keep-going \
--use-conda --rerun-triggers mtime \
--configfile $log_directory/config.yaml \
--default-resources mem_mb=5000 mem_mb_per_cpu=None runtime=2*60 \
--latency-wait 60
# Get the slurm log
cp $(scontrol show job $SLURM_JOB_ID | grep "StdOut" | awk -F "=" '{print $2}') $log_directory