From 9fef6214d111c1e87ea307593f8bf6adc576fd48 Mon Sep 17 00:00:00 2001
From: nservant <nicolas.servant@curie.fr>
Date: Mon, 28 Feb 2022 19:26:37 +0100
Subject: [PATCH] [MODIF] add hicexplorer

---
 modules/local/hicexplorer/hicFindTADs.nf      | 29 +++++++++++++++++++
 .../local/hicexplorer/hicPlotDistVsCounts.nf  | 28 ++++++++++++++++++
 2 files changed, 57 insertions(+)
 create mode 100644 modules/local/hicexplorer/hicFindTADs.nf
 create mode 100644 modules/local/hicexplorer/hicPlotDistVsCounts.nf

diff --git a/modules/local/hicexplorer/hicFindTADs.nf b/modules/local/hicexplorer/hicFindTADs.nf
new file mode 100644
index 0000000..676e8e7
--- /dev/null
+++ b/modules/local/hicexplorer/hicFindTADs.nf
@@ -0,0 +1,29 @@
+/*
+ * hicexplorer - hicFindTADs
+ */
+ 
+process HIC_FIND_TADS {
+  label 'process_medium'
+
+  input:
+  tuple val(meta), path(cool)
+
+  output:
+  path("*hicfindtads*"), emit:results
+  path("versions.yml"), emit:versions
+
+  script:
+  def args = task.ext.args ?: ''
+  def prefix = task.ext.prefix ?: "${meta.id}"
+  """
+  hicFindTADs --matrix ${cool} \
+  	      --outPrefix ${prefix}_hicfindtads \
+	      ${args} \
+	      --numberOfProcessors ${task.cpus}
+
+  cat <<-END_VERSIONS > versions.yml
+  "${task.process}":
+      hicexplorer: \$(hicFindTADs --version 2>&1 | sed 's/hicFindTADs //')
+  END_VERSIONS
+  """
+}
diff --git a/modules/local/hicexplorer/hicPlotDistVsCounts.nf b/modules/local/hicexplorer/hicPlotDistVsCounts.nf
new file mode 100644
index 0000000..41041eb
--- /dev/null
+++ b/modules/local/hicexplorer/hicPlotDistVsCounts.nf
@@ -0,0 +1,28 @@
+/*
+ * hicexplorer - hicPlotDistVsCounts
+ */
+ 
+process HIC_PLOT_DIST_VS_COUNTS {
+  label 'process_medium'
+
+  input:
+  tuple val(meta), path(cool)
+
+  output:
+  path("*distcount*"), emit:results
+  path("versions.yml"), emit:versions
+
+  script:
+  def args = task.ext.args ?: ''
+  def prefix = task.ext.prefix ?: "${meta.id}"
+  """
+  hicPlotDistVsCounts --matrices ${cool} \
+                      --plotFile ${prefix}_distcount.png \
+  		      --outFileData ${prefix}_distcount.txt
+
+  cat <<-END_VERSIONS > versions.yml
+  "${task.process}":
+      hicexplorer: \$(hicPlotDistVsCounts --version 2>&1 | sed 's/hicPlotDistVsCounts //')
+  END_VERSIONS
+  """
+}
-- 
GitLab