From 531b30b698208560353fee2766a6df8d10b63f59 Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Thu, 19 Aug 2021 14:03:35 +0200
Subject: [PATCH] emase-zero: filter g2tr list from sequence name in the fasta

---
 src/nf_modules/emase-zero/main.nf | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/nf_modules/emase-zero/main.nf b/src/nf_modules/emase-zero/main.nf
index 1d671a0f..1e7b659b 100644
--- a/src/nf_modules/emase-zero/main.nf
+++ b/src/nf_modules/emase-zero/main.nf
@@ -18,7 +18,7 @@ workflow count {
     g2tr(gtf)
     fasta_to_transcripts_lengths(fasta)
     bam2ec(bam_idx, fasta_to_transcripts_lengths.out.tsv)
-    emase(bam2ec.out.bin, bam2ec.out.tsv, g2tr.out.g2t)
+    emase(bam2ec.out.bin, fasta, bam2ec.out.tsv, g2tr.out.g2t)
 
   emit:
     count = emase.out.count
@@ -34,6 +34,7 @@ process emase {
 
   input:
     tuple val(file_id), path(bin)
+    tuple val(fasta_id), path(fasta)
     tuple val(transcript_length_id), path(transcript_length)
     tuple val(gene_to_transcript_id), path(gene_to_transcript)
 
@@ -42,10 +43,12 @@ process emase {
 
   script:
 """
+grep ">" ${fasta} | sed 's/>//' > tr_list.txt
+grep -Fw -f tr_list ${gene_to_transcript} > gene_to_transcript.txt
 emase-zero ${params.count} \
   -o ${bin.simpleName}.quantified \
   -l ${transcript_length} \
-  -g ${gene_to_transcript} \
+  -g gene_to_transcript.txt \
   ${bin}
 """
 }
\ No newline at end of file
-- 
GitLab