From 986a0901c65fbda4bbf5b7f30de64c4c153b8bd3 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Thu, 22 Feb 2024 09:02:13 +0100 Subject: [PATCH] use a different output extension if --fasta is provided --- src/cutadapt/script.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cutadapt/script.sh b/src/cutadapt/script.sh index 1b5b325e..839761ac 100644 --- a/src/cutadapt/script.sh +++ b/src/cutadapt/script.sh @@ -178,11 +178,17 @@ echo ">> Output arguments" [[ "$par_fasta" == "false" ]] && unset par_fasta [[ "$par_info_file" == "false" ]] && unset par_info_file +if [[ -z $par_fasta ]]; then + ext="fastq" +else + ext="fa" +fi + if [ $mode = "se" ]; then output_args=$(echo \ ${par_report:+--report "${par_report}"} \ ${par_json:+--json "${par_output}/report.json"} \ - --output "$par_output/{name}_R1_001.fastq" \ + --output "$par_output/{name}_001.$ext" \ ${par_fasta:+--fasta} \ ${par_info_file:+--info-file} \ ) @@ -190,8 +196,8 @@ else output_args=$(echo \ ${par_report:+--report "${par_report}"} \ ${par_json:+--json "${par_output}/report.json"} \ - --output "$par_output/{name}_R1_001.fastq" \ - --paired-output "$par_output/{name}_R2_001.fastq" \ + --output "$par_output/{name}_R1_001.$ext" \ + --paired-output "$par_output/{name}_R2_001.$ext" \ ${par_fasta:+--fasta} \ ${par_info_file:+--info-file} \ )