commit 1e5111ea9182ba7d013c0bc51993e64effc729af
Author: chloe.quignot <chloe.quignot@node06.example.org>
Date:   Wed Feb 21 16:22:53 2024 +0100

    initial commit - exercise0

diff --git a/Snakefile b/Snakefile
new file mode 100644
index 0000000..d3d6d3d
--- /dev/null
+++ b/Snakefile
@@ -0,0 +1,52 @@
+samples=["P10415", "P01308"]
+
+rule targets:
+    input:
+        expand("fasta/{sample}.fasta", sample=samples),
+        "fusionFasta/allSequences.fasta",
+        "mafft/mafft_res.fasta",
+
+
+rule loadData:
+    output:
+        "fasta/{sample}.fasta",
+    log:
+        stdout = "logs/{sample}_wget.stdout",
+        stderr = "logs/{sample}_wget.stderr",
+    params:
+        dirFasta = "fasta",
+    threads: 1 
+    shell:
+        """
+          wget --output-file {log.stderr} \
+               --directory-prefix {params.dirFasta} \
+               https://www.uniprot.org/uniprot/{wildcards.sample}.fasta > {log.stdout}
+        """
+
+
+rule fusionFasta:
+    input:
+        expand("fasta/{sample}.fasta", sample=samples),
+    output:
+        "fusionFasta/allSequences.fasta",
+    log:
+        "logs/fusionData.stderr",
+    threads: 1
+    shell:
+        """
+            cat {input} > {output} 2> {log}
+        """
+
+
+rule mafft:
+    input: 
+        rules.fusionFasta.output,
+    output:
+        "mafft/mafft_res.fasta",
+    log:
+        "logs/whichMafft.txt",
+    threads: 1
+    shell:
+        """
+            mafft {input} > {output} 2> {log}
+        """
diff --git a/readme_runSnake.txt b/readme_runSnake.txt
new file mode 100644
index 0000000..7a95619
--- /dev/null
+++ b/readme_runSnake.txt
@@ -0,0 +1,8 @@
+Pour faire fonctionner le pipeline il faut se connecter sur un noeud du cluster puis:
+
+- charger l'environnement snakemake:
+module load snakemake/snakemake-8.4.6
+module load nodes/mafft-7.475
+
+- executer le programme:
+snakemake --cores 4 
