From 803af8b722c2c35021b12721b4b5b1fc35bbb07a Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Mon, 20 May 2019 11:02:06 +0200
Subject: [PATCH] singularity test at in2p3

---
 src/kallisto_index.pbs                  | 29 +++++++++++++++++++++++++
 src/nf_modules/kallisto/indexing.config | 16 ++++++++++++++
 src/nf_modules/kallisto/indexing.nf     |  3 +++
 3 files changed, 48 insertions(+)
 create mode 100644 src/kallisto_index.pbs

diff --git a/src/kallisto_index.pbs b/src/kallisto_index.pbs
new file mode 100644
index 00000000..43d26c72
--- /dev/null
+++ b/src/kallisto_index.pbs
@@ -0,0 +1,29 @@
+#! /usr/local/bin/bash -l
+#####################################
+# job script example with GE options
+#####################################
+#$ -q demon
+#$ -l demon=1
+#$ -P P_lbmc
+#$ -N nf_pipe
+#$ -o /sps/lbmc/<user>/logs/ # change to your username !
+#$ -e /sps/lbmc/<user>/logs/ # change to your username !
+#$ -r n       # relaunch y/n
+#$ -M <email>@ens-lyon.fr # change to your mail !
+#$ -m be      ## send an email when the job starts and ends
+#$ -l os=cl7  ## choose OS
+#$ -l sps=1   ## acces /sps directory
+#####################################
+
+NF_VERSION=19.04
+NF=/pbs/throng/lbmc/cl7/nextflow/${NF_VERSION}/nextflow
+# change to your username
+SCRATCH=/sps/lbmc/lmodolo/
+# change to your project / pipeline !
+PIPELINE=${SCRATCH}/nextflow/src/nf_modules/kallisto/indexing.nf
+# change to your project / pipeline !
+CONFIG=${SCRATCH}/nextflow/src/nf_modules/kallisto/indexing.config
+
+${NF} ${PIPELINE} -c ${CONFIG} -profile ccin2p3 \
+--fasta "${SCRATCH}/<project>/data/fasta" \
+-w "${SCRATCH}"
diff --git a/src/nf_modules/kallisto/indexing.config b/src/nf_modules/kallisto/indexing.config
index a89cc5a3..fd223447 100644
--- a/src/nf_modules/kallisto/indexing.config
+++ b/src/nf_modules/kallisto/indexing.config
@@ -49,4 +49,20 @@ profiles {
       }
     }
   }
+  ccin2p3_singularity {
+    singularity.enabled = true
+    process{
+      withName: index_fasta {
+        container = "/sps/lbmc/common/singularity/kallisto:0.44.0.img"
+        scratch = true
+        stageInMode = "copy"
+        stageOutMode = "rsync"
+        executor = "sge"
+        clusterOptions = "-P P_lbmc -l os=cl7 -l sps=1 -r n \
+        -o ~/logs/ -e ~/logs/"
+        cpus = 1
+        queue = 'huge'
+      }
+    }
+  }
 }
diff --git a/src/nf_modules/kallisto/indexing.nf b/src/nf_modules/kallisto/indexing.nf
index ea153569..f24b0c1c 100644
--- a/src/nf_modules/kallisto/indexing.nf
+++ b/src/nf_modules/kallisto/indexing.nf
@@ -10,6 +10,7 @@ Channel
 process index_fasta {
   tag "$fasta.baseName"
   publishDir "results/mapping/index/", mode: 'copy'
+  echo true
 
   input:
     file fasta from fasta_file
@@ -20,8 +21,10 @@ process index_fasta {
 
   script:
 """
+pwd
 kallisto index -k 31 --make-unique -i ${fasta.baseName}.index ${fasta} \
 2> ${fasta.baseName}_kallisto_report.txt
+pwd
 """
 }
 
-- 
GitLab