From c2cdbcc2fb921ddc507f10d42ac18bb3695fb375 Mon Sep 17 00:00:00 2001
From: z483800 <109-z483800@users.noreply.gitlab.biologie.ens-lyon.fr>
Date: Fri, 17 Jan 2020 15:00:46 +0000
Subject: [PATCH] add kalliso indexing

---
 src/RNAseq.config | 56 +++++++++++++++++++++++++++++++++++++++++++++++
 src/RNAseq.nf     | 18 +++++++++++++++
 2 files changed, 74 insertions(+)

diff --git a/src/RNAseq.config b/src/RNAseq.config
index 5d949d4..a9ea266 100644
--- a/src/RNAseq.config
+++ b/src/RNAseq.config
@@ -161,3 +161,59 @@ profiles {
     }
   }
 }
+
+profiles {
+  docker {
+    docker.temp = 'auto'
+    docker.enabled = true
+    process {
+      withNamek index_fasta {
+        container = "lbmc/kallisto:0.44.0"
+        cpus = 4
+      }
+    }
+  }
+  singularity {
+    singularity.enabled = true
+    singularity.cacheDir = "./bin/"
+    process {
+      withName: index_fasta {
+        container = "lbmc/kallisto:0.44.0"
+        cpus = 4
+      }
+    }
+  }
+  psmn{
+    process{
+      withName: index_fasta {
+        beforeScript = "source $baseDir/.conda_psmn.sh"
+        conda = "$baseDir/.conda_envs/kallisto_0.44.0"
+        executor = "sge"
+        clusterOptions = "-cwd -V"
+        cpus = 16
+        memory = "30GB"
+        time = "24h"
+        queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
+        penv = 'openmp16'
+      }
+    }
+  }
+  ccin2p3 {
+    singularity.enabled = true
+    singularity.cacheDir = "$baseDir/.singularity_in2p3/"
+    singularity.runOptions = "--bind /pbs,/sps,/scratch"
+    process{
+      withName: index_fasta {
+        container = "lbmc/kallisto:0.44.0"
+        scratch = true
+        stageInMode = "copy"
+        stageOutMode = "rsync"
+        executor = "sge"
+        clusterOptions = "-P P_lbmc -l os=cl7 -l sps=1 -r n\
+        "
+        cpus = 1
+        queue = 'huge'
+      }
+    }
+  }
+}
diff --git a/src/RNAseq.nf b/src/RNAseq.nf
index e9c859d..f6633f0 100644
--- a/src/RNAseq.nf
+++ b/src/RNAseq.nf
@@ -86,3 +86,21 @@ bedtools getfasta -name \
 -fi ${fasta} -bed ${bed} -fo ${bed.baseName}_extracted.fasta
 """
 }
+
+process index_fasta {
+  tag "$fasta.baseName"
+  publishDir "results/mapping/index/", mode: 'copy'
+
+  input:
+    file fasta from fasta_files_extracted
+
+  output:
+    file "*.index*" into index_files
+    file "*_kallisto_report.txt" into index_files_report
+
+  script:
+"""
+kallisto index -k 31 --make-unique -i ${fasta.baseName}.index ${fasta} \
+2> ${fasta.baseName}_kallisto_report.txt
+"""
+}
-- 
GitLab