From da795e6947a7d53012772f6bc1f7c787e844b9d8 Mon Sep 17 00:00:00 2001
From: rlegendr <rachel.legendre@pasteur.fr>
Date: Fri, 17 Sep 2021 14:14:46 +0200
Subject: [PATCH] fixe maestro path

---
 Snakefile                      |  8 ++++----
 config/config.yaml             | 24 +++++++++++++-----------
 workflow/rules/cutadapt.rules  |  2 +-
 workflow/rules/sortmerna.rules |  6 +++++-
 4 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/Snakefile b/Snakefile
index f57d18c..9a3899f 100755
--- a/Snakefile
+++ b/Snakefile
@@ -182,8 +182,8 @@ if config["bowtie2_mapping"]["do"]:
     # indexing for bowtie2
     bowtie2_index_fasta = unpack(mapping_index)
     bowtie2_index_log = "02-Mapping/{REF}/bowtie2/logs/bowtie2_{REF}_indexing.log"
-    bowtie2_index_output_done = os.path.join(config["genome"]["genome_directory"]+"{REF}/bowtie2/{REF}.1.bt2")
-    bowtie2_index_output_prefix = os.path.join(config["genome"]["genome_directory"]+"{REF}/bowtie2/{REF}")
+    bowtie2_index_output_done = os.path.join(config["genome"]["genome_directory"], "{REF}/bowtie2/{REF}.1.bt2")
+    bowtie2_index_output_prefix = os.path.join(config["genome"]["genome_directory"], "{REF}/bowtie2/{REF}")
                    
     include: os.path.join(RULES, "bowtie2_index.rules")
 
@@ -212,8 +212,8 @@ if config["star_mapping"]["do"]:
     star_index_fasta = unpack(mapping_index)
     star_mapping_splice_file = unpack(annot_index)
     star_index_log = "02-Mapping/{REF}/STAR/logs/STAR_{REF}_indexing.log"
-    star_index_output_done = os.path.join(config["genome"]["genome_directory"], "/{REF}/STAR/SAindex")
-    star_index_output_dir = os.path.join(config["genome"]["genome_directory"], "/{REF}/STAR/")
+    star_index_output_done = os.path.join(config["genome"]["genome_directory"], "{REF}/STAR/SAindex")
+    star_index_output_dir = os.path.join(config["genome"]["genome_directory"], "{REF}/STAR/")
  
     include: os.path.join(RULES, "star_index.rules")
 
diff --git a/config/config.yaml b/config/config.yaml
index 1bbad1d..439a315 100644
--- a/config/config.yaml
+++ b/config/config.yaml
@@ -53,17 +53,18 @@ tmpdir: "/pasteur/sonic/scratch/public/"
 # - rRNA_mapping: Mapping on ribosomal RNA
 #===============================================================================
 
+
 genome:
-    genome_directory: ../genome/
-    name: saccer3
-    fasta_file: ../genome/saccer3/saccer3.fa
-    gff_file: ../genome/saccer3/saccer3.gff
+    genome_directory: /pasteur/zeus/projets/p01/BioIT/Genomes
+    name: Rabies
+    fasta_file: /pasteur/zeus/projets/p01/BioIT/Genomes/Rabies/Rabies.fa
+    gff_file: /pasteur/zeus/projets/p01/BioIT/Genomes/Rabies/Rabies.gff
     host_mapping: true
     host_name: hg38
-    host_fasta_file: ../genome/hg38/hg38.fa
-    host_gff_file: ../genome/hg38/hg38.gff
+    host_fasta_file: /pasteur/zeus/projets/p01/BioIT/Genomes/hg38/hg38.fa
+    host_gff_file: /pasteur/zeus/projets/p01/BioIT/Genomes/hg38/hg38.gff
     rRNA_mapping: true
-    ribo_fasta_file: ../genome/hg38/hg38_rRNA.fa    
+    ribo_fasta_file: /pasteur/zeus/projets/p01/BioIT/Genomes/hg38/hg38_rRNA.fa  
 
 #===============================================================================
 # FastQC section
@@ -156,11 +157,12 @@ star_mapping:
 
 pseudomapping:
     do: yes
-    fasta: ../genome/hg38/hg38.fa
-    gtf: ../genome/hg38/hg38.gff
-    options: ""
+    fasta: /pasteur/zeus/projets/p01/BioIT/Genomes/hg38/hg38_cDNA.fa
+    gtf: /pasteur/zeus/projets/p01/BioIT/Genomes/hg38/hg38.gtf
+    options: "--single"
     kmer: 31 
-    threads: 4
+    threads: 12
+
 
 #############################################################################
 # feature_counts used to count reads against features
diff --git a/workflow/rules/cutadapt.rules b/workflow/rules/cutadapt.rules
index cc6ebec..d9f95d5 100755
--- a/workflow/rules/cutadapt.rules
+++ b/workflow/rules/cutadapt.rules
@@ -55,7 +55,7 @@ rule cutadapt:
     	outfiles=($tmp)	
     
         # add mode and adapter sequences
-        cmd+=" cutadapt -{params.mode} {params.adapters} -m {params.min} -q {params.qual} {params.options}  "
+        cmd+=" cutadapt -{params.mode} {params.adapters} -m {params.min} -q {params.qual} {params.options} -j {threads} "
         # paired end or single end
         if [[ ${{#infiles[@]}} -eq 2 ]];
         then
diff --git a/workflow/rules/sortmerna.rules b/workflow/rules/sortmerna.rules
index 8b05fdd..2128bb8 100755
--- a/workflow/rules/sortmerna.rules
+++ b/workflow/rules/sortmerna.rules
@@ -32,6 +32,7 @@ rule sortmerna:
         no_rRNA = temp(sortmerna_outfile_no_rRNA)
     singularity:
         "rnaflow.img"
+    shadow: "shallow"
     log:
         err = sortmerna_logs_err,
         out = sortmerna_logs_out
@@ -52,7 +53,10 @@ rule sortmerna:
         fi
 
 
-        sortmerna --ref ${{fasta}},${{index}} -a {threads} --reads {input.fastq} --aligned {output.rRNA} --fastx  --sam --num_alignments 1 --other {output.no_rRNA} --log -v > {log.out} 2> {log.err}
+        sortmerna --ref ${{fasta}},${{index}} -a {threads} --reads {input.fastq} --aligned {output.rRNA} --fastx --other {output.no_rRNA} --log -v > {log.out} 2> {log.err}
 
 
+        mv {output.no_rRNA}.fastq {output.no_rRNA}
+        mv {output.rRNA}.fastq {output.rRNA}
+
         """
-- 
GitLab