From dfc75475f9c7f32bd9785f405c4275e5a53b66a7 Mon Sep 17 00:00:00 2001
From: Emmanuel Labaronne <emmanuel.labaronne@ens-lyon.fr>
Date: Wed, 24 Mar 2021 14:25:53 +0100
Subject: [PATCH] src/RibosomeProfiling.nf : discard reverse alignments in
 postgenome alignement

---
 src/RibosomeProfiling.nf | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/RibosomeProfiling.nf b/src/RibosomeProfiling.nf
index aad75c17..929e7a7d 100644
--- a/src/RibosomeProfiling.nf
+++ b/src/RibosomeProfiling.nf
@@ -472,7 +472,7 @@ hisat2 -x ${index2_id} \
 --trim3 1 \
 --trim5 1 \
 2> ${file_id}_postgenome.txt \
-| samtools view -bS -F 4 -F 256 - \
+| samtools view -bS -F 4 -F 256 -F 16 - \
 | samtools sort -@ ${task.cpus} -o ${file_id}_postgenome.bam \
 && samtools index ${file_id}_postgenome.bam
 
@@ -504,7 +504,7 @@ if (params.do_dedup){
 
     when:
     params.do_dedup
-    
+
     shell:
     '''
     samtools view -h !{bam[0]} | awk '!seen[substr($1, length($1)-5) $3 $4 $10]++' | samtools view -bS -o !{file_id}_dedup.bam
@@ -594,7 +594,7 @@ if (params.do_postgenome){
          echo "total counts : $total" >> !{file_id}.txt
          echo "scaling factor : !{factor}" >> !{file_id}.txt
          if [ !{genome} -gt 0 ]
-         then 
+         then
            bamCoverage -p !{task.cpus} --binSize 1  --scaleFactor !{factor} -b !{genome_bam[0]} -o !{file_id}_genome.bigwig
          fi
          if [ !{postgenome} -gt 0 ]
@@ -642,7 +642,7 @@ if (params.do_postgenome){
          echo "genome aligment : !{genome} counts" >> !{file_id}.txt
          echo "scaling factor : !{factor}" >> !{file_id}.txt
          if [ !{genome} -gt 0 ]
-         then 
+         then
            bamCoverage -p !{task.cpus} --binSize 1  --scaleFactor !{factor} -b !{genome_bam[0]} -o !{file_id}_genome.bigwig
          fi
          '''
-- 
GitLab