From e222d3b8068152221a818842d21f0e94500dc72e Mon Sep 17 00:00:00 2001 From: Matthieu Muffato Date: Tue, 31 Oct 2023 12:57:15 +0000 Subject: [PATCH] Collect the size of the genome (file size is a good proxy) --- subworkflows/local/prepare_genome.nf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subworkflows/local/prepare_genome.nf b/subworkflows/local/prepare_genome.nf index b5f23fd..5264569 100644 --- a/subworkflows/local/prepare_genome.nf +++ b/subworkflows/local/prepare_genome.nf @@ -19,12 +19,15 @@ workflow PREPARE_GENOME { // Uncompress genome fasta file if required if ( params.fasta.endsWith('.gz') ) { - ch_fasta = GUNZIP ( fasta ).gunzip + ch_unzipped = GUNZIP ( fasta ).gunzip ch_versions = ch_versions.mix ( GUNZIP.out.versions ) } else { - ch_fasta = fasta + ch_unzipped = fasta } + ch_unzipped + | map { meta, fa -> [ meta + [id: fa.baseName, genome_size: fa.size()], fa] } + | set { ch_fasta } // Unmask genome fasta UNMASK ( ch_fasta )