File size: 1,662 Bytes
1927f8f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

# -------------------------
# Slurm + Hydra Configuration
# -------------------------

main_task="preprocess"
data_task_type="fimo"
fimo_thresh="1e-2"
fimo_thresh_mode="q"
max_stored="100000"
fimo_outdir="dpacman/data_files/processed/fimo/fimo_out_q"
debug="false"

# Chromosomes to run
#chromosomes=('1' '10' '11' '12' '13' '14' '15' '16' '17' '18' '19' '2' '20' '21' '22' '3' '4' '5' '6' '7' '8' '9' 'X' 'Y')
chromosomes=('3')
# -------------------------
# Slurm Job Submission
# -------------------------

for chrom in "${chromosomes[@]}"; do
    timestamp=$(date "+%Y-%m-%d_%H-%M-%S")
    run_dir="$HOME/DPACMAN/logs/${main_task}/${data_task_type}/runs/${timestamp}_chr${chrom}"
    mkdir -p "$run_dir"

    sbatch <<EOF
#!/bin/bash
#SBATCH --job-name=fimo${chrom}
#SBATCH --partition=genoa-lrg-mem
#SBATCH -N 1 ## Number of nodes
#SBATCH --mem=0
#SBATCH --ntasks-per-node=64
#SBATCH --output=${run_dir}/run.log
#SBATCH --error=${run_dir}/run.log

echo "Running FIMO for chromosome ${chrom} at \$(date)"
cd /vast/projects/pranam/lab/sophie/DPACMAN/dpacman

# Load environment
source /vast/projects/pranam/lab/shared/miniconda3/etc/profile.d/conda.sh
conda activate dpacman

# Run Hydra-based script
python -u -m scripts.preprocess \\
    hydra.run.dir="${run_dir}" \\
    data_task=${data_task_type}/run_fimo \\
    data_task.chroms=["${chrom}"] \\
    data_task.fimo.thresh=${fimo_thresh} \\
    data_task.fimo.thresh_mode=${fimo_thresh_mode} \\
    data_task.paths.fimo_outdir=${fimo_outdir} \\
    data_task.fimo.max_stored=${max_stored}\\
    data_task.debug=${debug}

# Save SLURM job ID
echo \$SLURM_JOB_ID > "${run_dir}/pid.txt"
EOF

done