From 93eb643ba078c828c40443158d1ac0f8b54eb16e Mon Sep 17 00:00:00 2001
From: Kenzo-Hugo Hillion <kenzo-hugo.hillion1@pasteur.fr>
Date: Mon, 16 Mar 2020 15:08:23 +0100
Subject: [PATCH] starting cat

---
 tools/utils/cat/Snakefile                 | 12 ++++++++++++
 tools/utils/cat/example_usage/Snakefile   | 21 +++++++++++++++++++++
 tools/utils/cat/example_usage/config.yaml | 13 +++++++++++++
 3 files changed, 46 insertions(+)
 create mode 100644 tools/utils/cat/Snakefile
 create mode 100644 tools/utils/cat/example_usage/Snakefile
 create mode 100644 tools/utils/cat/example_usage/config.yaml

diff --git a/tools/utils/cat/Snakefile b/tools/utils/cat/Snakefile
new file mode 100644
index 0000000..f75e57c
--- /dev/null
+++ b/tools/utils/cat/Snakefile
@@ -0,0 +1,12 @@
+rule cat:
+    """
+    Split a FASTA file with the desired number of sequences per chunk
+    """
+    input:
+        __cat_input
+    output:
+        __cat_output
+    shell:
+        """
+        cat {input} > {output}
+        """
diff --git a/tools/utils/cat/example_usage/Snakefile b/tools/utils/cat/example_usage/Snakefile
new file mode 100644
index 0000000..810f43a
--- /dev/null
+++ b/tools/utils/cat/example_usage/Snakefile
@@ -0,0 +1,21 @@
+configfile: "config.yaml"
+
+# ==== Snakefile path ====
+__cat_rules = config.get("snakefiles", {}).get("cat")
+
+__main_output_dir = config.get('output_dir', 'output')
+
+# ==== Main config ====
+SAMPLES = config.get('samples')
+__input_dir = config.get('input_dir', 'data')
+
+# ==== EggNOGmapper2 Diamond ====
+__cat_merged_name = config.get('cat', {}).get('name_merge', 'cat_file')
+__cat_output_dir = __input_dir
+
+__cat_input = expand("{dir}/{{sample}}.emapper.seed_orthologs".format(dir=__input_dir), sample=SAMPLES)
+__cat_output = "{dir}/{file_name}".format(dir=__cat_output_dir, file_name=__cat_merged_name)
+include: __cat_rules
+
+rule all:
+    input: "{dir}/{file_name}".format(dir=__cat_output_dir, file_name=__cat_merged_name)
diff --git a/tools/utils/cat/example_usage/config.yaml b/tools/utils/cat/example_usage/config.yaml
new file mode 100644
index 0000000..f74b24f
--- /dev/null
+++ b/tools/utils/cat/example_usage/config.yaml
@@ -0,0 +1,13 @@
+snakefiles:
+    cat: /pasteur/projets/policy01/Atm/snakemake/tools/utils/cat/Snakefile
+
+input_dir: /pasteur/projets/policy01/Atm/kenzo/sandbox/20200210_test_snakemake/test_output/eggnogmapper2/diamond/
+output_dir: /pasteur/projets/policy01/Atm/kenzo/sandbox/20200210_test_snakemake/test_output
+
+samples:
+- test_00000
+- test_00001
+- test_00002
+
+cat:
+  name_merge: all.emapper.seed_orthologs 
-- 
GitLab