-
Notifications
You must be signed in to change notification settings - Fork 0
/
02_pore_c_snakemake_pipeline_run.sh
73 lines (57 loc) · 2.25 KB
/
02_pore_c_snakemake_pipeline_run.sh
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
#!/bin/bash
#SBATCH --partition prod
#SBATCH --job-name=02_pore_c_snakemake_pipeline_run
#SBATCH --time=36:00:00
#SBATCH --ntasks 1
#SBATCH --cpus-per-task 24
#SBATCH --mem 80G
#SBATCH --output="./logs/04_pore_c_snakemake_pipeline_run/slurm-%j-%x.out"
# configure file path to project directory
project_dir="/NGS/scratch/KSCBIOM/HumanGenomics/guinea_pore_c"
# remove any old outputs of this script to avoid results being written twice to a file
rm -rf $project_dir/results/04_pore_c_snakemake_pipeline_run/Pore-C-Snakemake/
# get pore-c snakemake pipeline
echo ""
echo "Getting pore-c snakemake pipeline"
echo ""
git clone https://github.com/nanoporetech/Pore-C-Snakemake.git $project_dir/results/04_pore_c_snakemake_pipeline_run/Pore-C-Snakemake/
cd $project_dir/results/04_pore_c_snakemake_pipeline_run/Pore-C-Snakemake/
git checkout tags/0.3.0
cd $project_dir/
# set the shell to be used by conda for this script (and re-start shell to implement changes)
echo ""
echo "Configuring conda"
echo ""
conda init bash
source ~/.bashrc
# create conda environment with pipeline dependencies installed and activate it
echo ""
echo "Creating conda environment with pipeline dependencies installed"
echo ""
mamba env create --force -f $project_dir/results/04_pore_c_snakemake_pipeline_run/Pore-C-Snakemake/environment.yml
conda activate pore-c-snakemake
# generate pore-c snakemake pipeline DAG
echo ""
echo "Generating pore-c snakemake pipeline DAG"
echo ""
cd $project_dir/results/04_pore_c_snakemake_pipeline_run/Pore-C-Snakemake/
snakemake \
--configfile $project_dir/config/04_pore_c_snakemake_pipeline_run/config.yaml \
--dag | dot -Tpng > $project_dir/results/04_pore_c_snakemake_pipeline_run/Pore-C-Snakemake/pipeline_dag.png
# generate pore-c snakemake pipeline rulegraph
echo ""
echo "Generating pore-c snakemake pipeline rulegraph"
echo ""
snakemake \
--configfile $project_dir/config/04_pore_c_snakemake_pipeline_run/config.yaml \
--rulegraph | dot -Tpng > $project_dir/results/04_pore_c_snakemake_pipeline_run/Pore-C-Snakemake/pipeline_rulegraph.png
# run pore-c snakemake pipeline
echo ""
echo "Running pore-c snakemake pipeline"
echo ""
snakemake \
--use-conda \
test \
--cores 24 \
--configfile $project_dir/config/04_pore_c_snakemake_pipeline_run/config.yaml \
--conda-frontend mamba