From 79d0c26acc5a4363d1d80867c26871bbf6afa4d6 Mon Sep 17 00:00:00 2001 From: Madeline Scyphers Date: Mon, 4 Nov 2024 14:09:37 -0700 Subject: [PATCH] Paths as string concetation bugfix (issue #379) --- main.nf | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/main.nf b/main.nf index d438da45..22c09559 100644 --- a/main.nf +++ b/main.nf @@ -122,10 +122,8 @@ params.make_product_pkg = "dram_viz" // Move to nextflow.config when ready params.trees = 0 params.add_trees = 0 -params.trees = 0 params.trees_list = "dmso" //trees_list = "nar_nxr;dsr;mcra;amoa_pmoa;hydrogenase" -params.add_trees = "" params.tree_data_files = "${projectDir}/assets/trees/" params.trees_scripts = "${projectDir}/assets" @@ -635,7 +633,7 @@ if( params.rename || params.call ){ // If calling genes, then create a channel called ch_input_fastas. if ( params.input_fasta != "" ) { ch_input_fastas = Channel - .fromPath(params.input_fasta + params.fasta_fmt, checkIfExists: true) + .fromPath(file(params.input_fasta) / params.fasta_fmt, checkIfExists: true) .ifEmpty { exit 1, "Cannot find any fasta files matching: ${params.input_fasta}\nNB: Path needs to follow pattern: path/to/directory/" } } else { ch_input_fastas = Channel @@ -664,7 +662,7 @@ if( params.annotate ){ if( params.call == 0 ){ // Set ch_input_genes ch_called_proteins = Channel - .fromPath(params.input_genes + params.genes_fmt, checkIfExists: true) + .fromPath(file(params.input_genes) / params.genes_fmt, checkIfExists: true) .ifEmpty { exit 1, "If you specify --annotate without --call, you must provide a fasta file of called genes using --input_genes. Cannot find any called gene fasta files matching: ${params.input_genes}\nNB: Path needs to follow pattern: path/to/directory/" } .map { sampleName = it.getName().replaceAll(/\.[^.]+$/, '').replaceAll(/\./, '-') @@ -775,7 +773,7 @@ if( params.trees ) { .ifEmpty { exit 1, "If you specify --distill_ without --annotate, you must provide an annotations TSV file (--annotations ) with approprite formatting. Cannot find any called gene fasta files matching: ${params.annotations}\nNB: Path needs to follow pattern: path/to/directory/" } ch_collected_faa = Channel - .fromPath(params.input_genes + params.genes_fmt, checkIfExists: true) + .fromPath(file(params.input_genes) / params.genes_fmt, checkIfExists: true) .ifEmpty { exit 1, "If you specify --annotations without --input_genes, with the desire to run trees, you must provide a fasta file of called genes using --input_genes. Cannot find any called gene fasta files matching: ${params.input_genes}\nNB: Path needs to follow pattern: path/to/directory/" } .collect() }