From 8431633e4c0f744237b0565d3f1269fe648c64dd Mon Sep 17 00:00:00 2001
From: Blaise Li <blaise.li__git@nsup.org>
Date: Fri, 27 Apr 2018 11:22:36 +0200
Subject: [PATCH] Script and links to start pipelines more easily.

---
 CLIP-seq                         |  1 +
 CLIP/iCLIP-seq.snakefile         |  1 +
 GRO-seq                          |  1 +
 PRO-seq/GRO-seq.snakefile        |  1 +
 RNA-seq                          |  1 +
 iCLIP                            |  1 +
 iCLIP-seq                        |  1 +
 run_GRO-seq_pipeline             |  1 +
 run_PRO-seq_pipeline             |  1 +
 run_RNA-seq_pipeline             |  1 +
 run_Ribo-seq_pipeline            |  1 +
 run_iCLIP-seq_pipeline           |  1 +
 run_iCLIP_pipeline               |  1 +
 run_pipeline.sh                  | 74 ++++++++++++++++++++++++++++++++
 run_sRNA-seq_pipeline            |  1 +
 run_small_RNA-seq_pipeline       |  1 +
 small_RNA-seq/sRNA-seq.snakefile |  1 +
 17 files changed, 90 insertions(+)
 create mode 120000 CLIP-seq
 create mode 120000 CLIP/iCLIP-seq.snakefile
 create mode 120000 GRO-seq
 create mode 120000 PRO-seq/GRO-seq.snakefile
 create mode 120000 RNA-seq
 create mode 120000 iCLIP
 create mode 120000 iCLIP-seq
 create mode 120000 run_GRO-seq_pipeline
 create mode 120000 run_PRO-seq_pipeline
 create mode 120000 run_RNA-seq_pipeline
 create mode 120000 run_Ribo-seq_pipeline
 create mode 120000 run_iCLIP-seq_pipeline
 create mode 120000 run_iCLIP_pipeline
 create mode 100755 run_pipeline.sh
 create mode 120000 run_sRNA-seq_pipeline
 create mode 120000 run_small_RNA-seq_pipeline
 create mode 120000 small_RNA-seq/sRNA-seq.snakefile

diff --git a/CLIP-seq b/CLIP-seq
new file mode 120000
index 0000000..a634613
--- /dev/null
+++ b/CLIP-seq
@@ -0,0 +1 @@
+CLIP
\ No newline at end of file
diff --git a/CLIP/iCLIP-seq.snakefile b/CLIP/iCLIP-seq.snakefile
new file mode 120000
index 0000000..f746f80
--- /dev/null
+++ b/CLIP/iCLIP-seq.snakefile
@@ -0,0 +1 @@
+iCLIP.snakefile
\ No newline at end of file
diff --git a/GRO-seq b/GRO-seq
new file mode 120000
index 0000000..7deb020
--- /dev/null
+++ b/GRO-seq
@@ -0,0 +1 @@
+PRO-seq
\ No newline at end of file
diff --git a/PRO-seq/GRO-seq.snakefile b/PRO-seq/GRO-seq.snakefile
new file mode 120000
index 0000000..896853b
--- /dev/null
+++ b/PRO-seq/GRO-seq.snakefile
@@ -0,0 +1 @@
+PRO-seq.snakefile
\ No newline at end of file
diff --git a/RNA-seq b/RNA-seq
new file mode 120000
index 0000000..c345b90
--- /dev/null
+++ b/RNA-seq
@@ -0,0 +1 @@
+RNA_Seq_Cecere
\ No newline at end of file
diff --git a/iCLIP b/iCLIP
new file mode 120000
index 0000000..a634613
--- /dev/null
+++ b/iCLIP
@@ -0,0 +1 @@
+CLIP
\ No newline at end of file
diff --git a/iCLIP-seq b/iCLIP-seq
new file mode 120000
index 0000000..ddfad45
--- /dev/null
+++ b/iCLIP-seq
@@ -0,0 +1 @@
+iCLIP
\ No newline at end of file
diff --git a/run_GRO-seq_pipeline b/run_GRO-seq_pipeline
new file mode 120000
index 0000000..f2500be
--- /dev/null
+++ b/run_GRO-seq_pipeline
@@ -0,0 +1 @@
+run_pipeline.sh
\ No newline at end of file
diff --git a/run_PRO-seq_pipeline b/run_PRO-seq_pipeline
new file mode 120000
index 0000000..f2500be
--- /dev/null
+++ b/run_PRO-seq_pipeline
@@ -0,0 +1 @@
+run_pipeline.sh
\ No newline at end of file
diff --git a/run_RNA-seq_pipeline b/run_RNA-seq_pipeline
new file mode 120000
index 0000000..f2500be
--- /dev/null
+++ b/run_RNA-seq_pipeline
@@ -0,0 +1 @@
+run_pipeline.sh
\ No newline at end of file
diff --git a/run_Ribo-seq_pipeline b/run_Ribo-seq_pipeline
new file mode 120000
index 0000000..f2500be
--- /dev/null
+++ b/run_Ribo-seq_pipeline
@@ -0,0 +1 @@
+run_pipeline.sh
\ No newline at end of file
diff --git a/run_iCLIP-seq_pipeline b/run_iCLIP-seq_pipeline
new file mode 120000
index 0000000..f2500be
--- /dev/null
+++ b/run_iCLIP-seq_pipeline
@@ -0,0 +1 @@
+run_pipeline.sh
\ No newline at end of file
diff --git a/run_iCLIP_pipeline b/run_iCLIP_pipeline
new file mode 120000
index 0000000..f2500be
--- /dev/null
+++ b/run_iCLIP_pipeline
@@ -0,0 +1 @@
+run_pipeline.sh
\ No newline at end of file
diff --git a/run_pipeline.sh b/run_pipeline.sh
new file mode 100755
index 0000000..ad6a528
--- /dev/null
+++ b/run_pipeline.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+# Usage: run_pipeline.sh [<snakefile>] <configuration_file> [extra arguments for snakemake]
+# If no snakefile is provided, the script should be called from one of its aliases.
+# Each alias will run a specific pipeline, depending on its name.
+
+# http://linuxcommand.org/wss0150.php
+PROGNAME=$(basename "${0}")
+
+function error_exit
+{
+#	----------------------------------------------------------------
+#	Function for exit due to fatal program error
+#		Accepts 1 argument:
+#			string containing descriptive error message
+#	----------------------------------------------------------------
+    echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
+    exit 1
+}
+
+# https://stackoverflow.com/a/1638397/1878788
+# Absolute path to this script
+SCRIPT=$(readlink -f "${0}")
+# Absolute path this script is in
+BASEDIR=$(dirname "${SCRIPT}")
+
+# This script can be called from various symbolic links.
+# The name of the link determines which snakefile to use.
+# PRO-seq and GRO-seq are actually the same pipeline
+# similarly for sRNA-seq and small_RNA-seq
+# similarly for iCLIP-seq and iCLIP
+case "${PROGNAME}" in
+    "run_RNA-seq_pipeline")
+        snakefile="${BASEDIR}/RNA-seq/RNA-seq.snakefile"
+        ;;
+    "run_GRO-seq_pipeline")
+        snakefile="${BASEDIR}/PRO-seq/GRO-seq.snakefile"
+        ;;
+    "run_PRO-seq_pipeline")
+        snakefile="${BASEDIR}/PRO-seq/PRO-seq.snakefile"
+        ;;
+    "run_small_RNA-seq_pipeline")
+        snakefile="${BASEDIR}/small_RNA-seq/small_RNA-seq.snakefile"
+        ;;
+    "run_sRNA-seq_pipeline")
+        snakefile="${BASEDIR}/sRNA-seq/sRNA-seq.snakefile"
+        ;;
+    "run_iCLIP-seq_pipeline")
+        snakefile="${BASEDIR}/iCLIP-seq/iCLIP-seq.snakefile"
+        ;;
+    "run_iCLIP_pipeline")
+        snakefile="${BASEDIR}/iCLIP/iCLIP.snakefile"
+        ;;
+    "run_Ribo-seq_pipeline")
+        snakefile="${BASEDIR}/Ribo-seq/Ribo-seq.snakefile"
+        ;;
+    *)
+        snakefile="${1}"
+        shift
+        ;;
+esac
+
+configfile="${1}"
+shift
+
+if [ -e ${configfile} ]
+then
+    cmd="snakemake -s ${snakefile} --configfile ${configfile} $@"
+else
+    error_exit "Pipeline configuration file ${configfile} not found."
+fi
+echo ${cmd}
+eval ${cmd} || error_exit "${cmd} failed"
+
+exit 0
diff --git a/run_sRNA-seq_pipeline b/run_sRNA-seq_pipeline
new file mode 120000
index 0000000..f2500be
--- /dev/null
+++ b/run_sRNA-seq_pipeline
@@ -0,0 +1 @@
+run_pipeline.sh
\ No newline at end of file
diff --git a/run_small_RNA-seq_pipeline b/run_small_RNA-seq_pipeline
new file mode 120000
index 0000000..f2500be
--- /dev/null
+++ b/run_small_RNA-seq_pipeline
@@ -0,0 +1 @@
+run_pipeline.sh
\ No newline at end of file
diff --git a/small_RNA-seq/sRNA-seq.snakefile b/small_RNA-seq/sRNA-seq.snakefile
new file mode 120000
index 0000000..c6ff303
--- /dev/null
+++ b/small_RNA-seq/sRNA-seq.snakefile
@@ -0,0 +1 @@
+small_RNA-seq.snakefile
\ No newline at end of file
-- 
GitLab