Skip to content

Commit

Permalink
slurm
Browse files Browse the repository at this point in the history
  • Loading branch information
metavannier committed Jul 28, 2022
1 parent f94e62d commit 357f0a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 30 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ Configure the workflow according to your needs via editing the files and reposit

#### On a cluster

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

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

`sbatch sc_rnaseq_slurm_skylake.sh`
`sbatch run_slurm.sh`

### Step 4: Investigate results

Expand Down
3 changes: 3 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Docker container based on a minimal Ubuntu installation that includes conda-forge's mambaforge installer.
container: "docker://condaforge/mambaforge"

import pandas as pd
import numpy as np
from snakemake.utils import validate, min_version
Expand Down
32 changes: 5 additions & 27 deletions sc_rnaseq_slurm_skylake.sh → run_slurm.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,22 @@
#!/bin/sh
#SBATCH -J Job_scrna
#SBATCH -J Microbeannotator
#SBATCH -p skylake
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -n 12
#SBATCH -A a272
#SBATCH -t 00:30:00
#SBATCH -t 11:00:00
#SBATCH -o ./%N.%x.out
#SBATCH -e ./%N.%x.err

# This script needs to be started from
# the run directory
# This script needs to be started from the run directory

# Load the modules and start the virtual environment
module load userspace/all
module load python3/3.6.3
module load singularity/3.5.1

# Create a snakemake virtual environment if necessary
if [ ! -d snakemake_virtenv/ ]
then
bash 04_Workflow/create_snakemake_virtualenv.sh
fi

source /scratch/tvannier/sc-rnaseq/snakemake_virtenv/bin/activate

#export PATH=/scratch/tvannier/sc-rnaseq/snakemake_virtenv/condabin:$PATH
#export LD_LIBRARY_PATH=/scratch/tvannier/sc-rnaseq/snakemake_virtenv/condabin:$LD_LIBRARY_PATH

pip install snakemake==6.3.0
#pip install manager
pip install pandas
#pip install mamba

# move to the working directory
#cd /scratch/$SLURM_JOB_USER/sc-rnaseq/


# ================================================
# Run the workflow
Expand All @@ -46,7 +28,7 @@ snakemake --snakefile Snakefile \
--use-singularity \
--use-conda \
--conda-frontend conda \
--singularity-args="-B /scratch/$SLURM_JOB_USER/sc-rnaseq/" \
--singularity-args="-B /scratch/$SLURM_JOB_USER/inmed_dechevigny_scrnaseq/" \
--jobs 1 \
--latency-wait 20 \
--max-jobs-per-second 5 \
Expand All @@ -61,7 +43,3 @@ snakemake --snakefile Snakefile \
--mem-per-cpu {cluster.mem-per-cpu} \
--output {cluster.output} \
--error {cluster.error}' \

deactivate


0 comments on commit 357f0a0

Please sign in to comment.