From 451c10bb6bcd520dbdee66fcb62c42c2d732e2ab Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Mon, 10 May 2021 10:17:02 +0200
Subject: [PATCH] alntools: try fix for bam bai

---
 src/nf_modules/alntools/main.nf | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/nf_modules/alntools/main.nf b/src/nf_modules/alntools/main.nf
index 813a7d78..9644c02c 100644
--- a/src/nf_modules/alntools/main.nf
+++ b/src/nf_modules/alntools/main.nf
@@ -21,6 +21,8 @@ process bam2ec {
 
   script:
 """
+cp ${bam} file_bam.bam
+cp ${bam_idx} file_bam.bam.bai
 awk -F"[\\t;]" '
 \$3=="exon" {
         ID=gensub(/transcript_id \\"(.*)\\"/, "\\\\1", "g", \$11); 
@@ -31,6 +33,6 @@ END{
         {print i"\\t"LEN[i]}
     }
 ' ${gtf} > ${gtf.simpleName}_transcripts_lengths.tsv
-alntools bam2ec ${params.bam2ec} -t ${gtf.simpleName}_transcripts_lengths.tsv ${bam} ${bam.simpleName}.bin
+alntools bam2ec ${params.bam2ec} -t ${gtf.simpleName}_transcripts_lengths.tsv file_bam.bam ${bam.simpleName}.bin
 """
 }
\ No newline at end of file
-- 
GitLab