Skip to content

Commit 51c7412

Browse files
committed
Merge branch 'SRP287614' of https://github.com/metavannier/scRNAseq_analysis_workflow into SRP287614
2 parents 04715e7 + b29083b commit 51c7412

6 files changed

+104
-6
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,12 @@
44
02_Container/cellranger.sif
55
05_Output
66
.vscode/
7+
.bash_history/
8+
.cache/
9+
.conda/
10+
.config/
11+
.java/
12+
.local/
13+
.singularity/
14+
snakemake_virtenv/
15+

04_Workflow/cellranger.smk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ rule cellranger:
4949
--jobmode=local \
5050
--localcores={config[cellranger][localcores]} \
5151
--localmem={config[cellranger][localmem]}
52-
mv ${{sample[$i]}}/out 05_Output/01_cellranger/${{sample[$i]}}/
52+
mv ${{sample[$i]}}/outs/* 05_Output/01_cellranger/${{sample[$i]}}/outs/
5353
rm -r ${{sample[$i]}}/
5454
mv 05_Output/01_cellranger/${{sample[$i]}}/outs/web_summary.html 05_Output/01_cellranger/${{sample[$i]}}/outs/${{sample[$i]}}_web_summary.html
5555
done
@@ -93,4 +93,4 @@ rule cellrangeraggr:
9393
mv ${{outfolder}}/outs/count/* ${{outaggr}}${{outfolder}}/outs/
9494
mv ${{outfolder}}/outs/web_summary.html ${{outaggr}}/${{outfolder}}/outs/aggregate_web_summary.html
9595
rm -r ${{outfolder}}
96-
"""
96+
"""
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
module load userspace/all
3+
module load python3/3.6.3
4+
#module load singularity/3.5.1
5+
6+
#mkdir snakemake_virtenv
7+
virtualenv-3.6 snakemake_virtenv
8+
source snakemake_virtenv/bin/activate
9+
pip3 install snakemake==5.22.1
10+
install numpy deactivate
11+
#virtualenv-3.6 -p python3 snakemake_virtenv
12+

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Configure the workflow according to your needs via editing the files and reposit
4848

4949
- You need [Singularity v3.5.3](https://github.com/hpcng/singularity/blob/master/INSTALL.md#install-golang) installed on your computer or cluster.
5050

51-
- Load snakemake from a docker container and run the workflow from the root by using these commands:
51+
- Load snakemake from a docker container and run the workflow from the working directory by using these commands:
5252

5353
`singularity run docker://snakemake/snakemake:v6.3.0`
5454

@@ -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
61+
- Write the batch script to run your snakemake from the working directory
6262

63-
` sbatch sc_rnaseq_slurm_skylake.sh`
63+
It will create a snakemake virtual environment and install the packages needed with pip.
6464

65-
singularity exec -H /scratch/tvannier/sc-rnaseq/ docker://snakemake/snakemake:v6.3.0 snakemake --use-conda --use-singularity --cores 12
65+
`sbatch sc_rnaseq_slurm_skylake.sh`
6666

6767
### Step 4: Investigate results
6868

cluster_config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
__default__:
2+
job-name: Job_scrna
3+
project: a272
4+
partition: skylake
5+
time: 09:00:00 # time limit for each job
6+
nodes-number: 1
7+
cores: 12
8+
mem-per-cpu: 5000
9+
output: ./%N.%x.out
10+
error: ./%N.%x.err

sc_rnaseq_slurm_skylake.sh

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/bin/sh
2+
#SBATCH -J Job_scrna
3+
#SBATCH -p skylake
4+
#SBATCH -N 1
5+
#SBATCH -n 1
6+
#SBATCH -A a272
7+
#SBATCH -t 00:30:00
8+
#SBATCH -o ./%N.%x.out
9+
#SBATCH -e ./%N.%x.err
10+
11+
# This script needs to be started from
12+
# the run directory
13+
14+
# Load the modules and start the virtual environment
15+
module load userspace/all
16+
module load python3/3.6.3
17+
module load singularity/3.5.1
18+
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+
30+
pip install snakemake==6.3.0
31+
#pip install manager
32+
pip install pandas
33+
#pip install mamba
34+
35+
# move to the working directory
36+
#cd /scratch/$SLURM_JOB_USER/sc-rnaseq/
37+
38+
39+
# ================================================
40+
# Run the workflow
41+
# ================================================
42+
43+
# Run snakemake
44+
snakemake --snakefile Snakefile \
45+
--reason \
46+
--use-singularity \
47+
--use-conda \
48+
--conda-frontend conda \
49+
--singularity-args="-B /scratch/$SLURM_JOB_USER/sc-rnaseq/" \
50+
--jobs 1 \
51+
--latency-wait 20 \
52+
--max-jobs-per-second 5 \
53+
--max-status-checks-per-second 5 \
54+
--cluster-config cluster_config.json \
55+
--cluster 'sbatch -A {cluster.project} \
56+
--job-name {cluster.job-name} \
57+
--partition {cluster.partition} \
58+
--time {cluster.time} \
59+
-N {cluster.nodes-number} \
60+
-n {cluster.cores} \
61+
--mem-per-cpu {cluster.mem-per-cpu} \
62+
--output {cluster.output} \
63+
--error {cluster.error}' \
64+
65+
deactivate
66+
67+

0 commit comments

Comments
 (0)