From a8a88ec7541bbb8ce40cbe160522f73d9f0c5a6a Mon Sep 17 00:00:00 2001
From: samnooij <s.nooij@lumc.nl>
Date: Tue, 17 May 2022 15:02:19 +0200
Subject: [PATCH] Enable slurm-cluster-status by default

---
 .gitmodules                       |  3 +++
 README.md                         | 31 +++++++++++++++++++------------
 bin/slurm-cluster-status          |  1 +
 bin/slurm-cluster-status/.gitkeep |  0
 config/config.yaml                |  2 +-
 5 files changed, 24 insertions(+), 13 deletions(-)
 create mode 100644 .gitmodules
 create mode 160000 bin/slurm-cluster-status
 delete mode 100644 bin/slurm-cluster-status/.gitkeep

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..e339b86
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "bin/slurm-cluster-status"]
+	path = bin/slurm-cluster-status
+	url = https://github.com/LUMC/slurm-cluster-status
diff --git a/README.md b/README.md
index 6e6c029..4c4b454 100644
--- a/README.md
+++ b/README.md
@@ -64,7 +64,21 @@ conda activate snakemake
 
 (This workflow has been tested with snakemake version 5.10.0
 and likely also works with newer versions.)
- 
+
+Download the workflow to your current directory with:
+
+```bash
+git clone --recurse-submodules https://git.lumc.nl/snooij/metagenomics-scaffold-classification.git
+```
+
+Optionally rename the directory to which the workflow was downloaded,
+and change into it to start using.
+
+```bash
+mv metagenomics-scaffold-classification my_awesome_classification_project
+cd my_awesome_classification_project
+```
+
 Furthermore, the workflow requires the NCBI BLAST nr database with
 its associated taxonomic information and an index for use with DIAMOND.
 These have been kindly provided by the creators of CAT and can be found
@@ -141,7 +155,7 @@ In particular the bottom two lines are essential for working with SLURM:
 
 ```yaml
 cluster: "sbatch --parsable -N 1 -n 1 -c {threads} --mem={resources.mem} -t {resources.time} -D . -e log/SLURM/{name}-{jobid}.err -o log/SLURM/{name}-{jobid}.out"
-#cluster-status: "bin/slurm-cluster-status/slurm-cluster-status.py"
+cluster-status: "bin/slurm-cluster-status/slurm-cluster-status.py"
 ```
 
 It is recommended to add `--mail-type=FAIL --mail-user=[YOUR EMAIL ADDRESS]`,
@@ -153,16 +167,9 @@ for instance.
 [`config/parameters.yaml`](config/parameters.yaml) file.
 Change these when necessary on your system.)
 
-To use the (optional) custom Python script 'slurm-cluster-status'
-that can help Snakemake communicate with SLURM, remove the comment
-sign (#) from the bottom line in `config/parameters.yaml` and
-download the script by running:
-
-```bash
-cd bin
-git clone https://github.com/LUMC/slurm-cluster-status.git
-cd ..
-```
+The (optional) custom Python script 'slurm-cluster-status'
+that can help Snakemake communicate with SLURM is used by default.
+Remove the (bottom) line in `config/parameters.yaml` to disable it.
 
 Now everything should be set to run the workflow!
 
diff --git a/bin/slurm-cluster-status b/bin/slurm-cluster-status
new file mode 160000
index 0000000..81a1801
--- /dev/null
+++ b/bin/slurm-cluster-status
@@ -0,0 +1 @@
+Subproject commit 81a18016a4413e64a833343788fd7219448f8307
diff --git a/bin/slurm-cluster-status/.gitkeep b/bin/slurm-cluster-status/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/config/config.yaml b/config/config.yaml
index b8788d3..ea3ffdb 100644
--- a/config/config.yaml
+++ b/config/config.yaml
@@ -6,4 +6,4 @@ keep-going: true
 printshellcmds: true
 use-conda: true
 cluster: "sbatch --parsable -N 1 -n 1 -c {threads} --mem={resources.mem} -t {resources.time} -D . -e log/SLURM/{name}-{jobid}.err -o log/SLURM/{name}-{jobid}.out"
-#cluster-status: "bin/slurm-cluster-status/slurm-cluster-status.py"
+cluster-status: "bin/slurm-cluster-status/slurm-cluster-status.py"
-- 
GitLab