Skip to content

Commit 357f0a0

Browse files
committed
slurm
1 parent f94e62d commit 357f0a0

File tree

3 files changed

+11
-30
lines changed

3 files changed

+11
-30
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ Configure the workflow according to your needs via editing the files and reposit
5858

5959
#### On a cluster
6060

61-
- Write the batch script to run your snakemake from the working directory
61+
- Adapt the batch scripts run_slurm.sh and cluster_config.json file to run your snakemake from the working directory
6262

63-
It will create a snakemake virtual environment and install the packages needed with pip.
63+
It will install snakemake with pip and run the workflow in the HPC:
6464

65-
`sbatch sc_rnaseq_slurm_skylake.sh`
65+
`sbatch run_slurm.sh`
6666

6767
### Step 4: Investigate results
6868

Snakefile

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Docker container based on a minimal Ubuntu installation that includes conda-forge's mambaforge installer.
2+
container: "docker://condaforge/mambaforge"
3+
14
import pandas as pd
25
import numpy as np
36
from snakemake.utils import validate, min_version
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,22 @@
11
#!/bin/sh
2-
#SBATCH -J Job_scrna
2+
#SBATCH -J Microbeannotator
33
#SBATCH -p skylake
44
#SBATCH -N 1
5-
#SBATCH -n 1
5+
#SBATCH -n 12
66
#SBATCH -A a272
7-
#SBATCH -t 00:30:00
7+
#SBATCH -t 11:00:00
88
#SBATCH -o ./%N.%x.out
99
#SBATCH -e ./%N.%x.err
1010

11-
# This script needs to be started from
12-
# the run directory
11+
# This script needs to be started from the run directory
1312

1413
# Load the modules and start the virtual environment
1514
module load userspace/all
1615
module load python3/3.6.3
1716
module load singularity/3.5.1
1817

19-
# Create a snakemake virtual environment if necessary
20-
if [ ! -d snakemake_virtenv/ ]
21-
then
22-
bash 04_Workflow/create_snakemake_virtualenv.sh
23-
fi
24-
25-
source /scratch/tvannier/sc-rnaseq/snakemake_virtenv/bin/activate
26-
27-
#export PATH=/scratch/tvannier/sc-rnaseq/snakemake_virtenv/condabin:$PATH
28-
#export LD_LIBRARY_PATH=/scratch/tvannier/sc-rnaseq/snakemake_virtenv/condabin:$LD_LIBRARY_PATH
29-
3018
pip install snakemake==6.3.0
31-
#pip install manager
3219
pip install pandas
33-
#pip install mamba
34-
35-
# move to the working directory
36-
#cd /scratch/$SLURM_JOB_USER/sc-rnaseq/
37-
3820

3921
# ================================================
4022
# Run the workflow
@@ -46,7 +28,7 @@ snakemake --snakefile Snakefile \
4628
--use-singularity \
4729
--use-conda \
4830
--conda-frontend conda \
49-
--singularity-args="-B /scratch/$SLURM_JOB_USER/sc-rnaseq/" \
31+
--singularity-args="-B /scratch/$SLURM_JOB_USER/inmed_dechevigny_scrnaseq/" \
5032
--jobs 1 \
5133
--latency-wait 20 \
5234
--max-jobs-per-second 5 \
@@ -61,7 +43,3 @@ snakemake --snakefile Snakefile \
6143
--mem-per-cpu {cluster.mem-per-cpu} \
6244
--output {cluster.output} \
6345
--error {cluster.error}' \
64-
65-
deactivate
66-
67-

0 commit comments

Comments
 (0)