#!/usr/bin/env bash

# rnaseq main
# 
# This wrapper script is auto-generated by viash 0.9.0 and is thus a derivative
# work thereof. This software comes with ABSOLUTELY NO WARRANTY from Data
# Intuitive.
# 
# The component may contain files which fall under a different license. The
# authors of this component should specify the license in the header of such
# files, or include a separate license file detailing the licenses of all included
# files.

set -e

if [ -z "$VIASH_TEMP" ]; then
  VIASH_TEMP=${VIASH_TEMP:-$VIASH_TMPDIR}
  VIASH_TEMP=${VIASH_TEMP:-$VIASH_TEMPDIR}
  VIASH_TEMP=${VIASH_TEMP:-$VIASH_TMP}
  VIASH_TEMP=${VIASH_TEMP:-$TMPDIR}
  VIASH_TEMP=${VIASH_TEMP:-$TMP}
  VIASH_TEMP=${VIASH_TEMP:-$TEMPDIR}
  VIASH_TEMP=${VIASH_TEMP:-$TEMP}
  VIASH_TEMP=${VIASH_TEMP:-/tmp}
fi

# define helper functions
# ViashQuote: put quotes around non flag values
# $1     : unquoted string
# return : possibly quoted string
# examples:
#   ViashQuote --foo      # returns --foo
#   ViashQuote bar        # returns 'bar'
#   Viashquote --foo=bar  # returns --foo='bar'
function ViashQuote {
  if [[ "$1" =~ ^-+[a-zA-Z0-9_\-]+=.+$ ]]; then
    echo "$1" | sed "s#=\(.*\)#='\1'#"
  elif [[ "$1" =~ ^-+[a-zA-Z0-9_\-]+$ ]]; then
    echo "$1"
  else
    echo "'$1'"
  fi
}
# ViashRemoveFlags: Remove leading flag
# $1     : string with a possible leading flag
# return : string without possible leading flag
# examples:
#   ViashRemoveFlags --foo=bar  # returns bar
function ViashRemoveFlags {
  echo "$1" | sed 's/^--*[a-zA-Z0-9_\-]*=//'
}
# ViashSourceDir: return the path of a bash file, following symlinks
# usage   : ViashSourceDir ${BASH_SOURCE[0]}
# $1      : Should always be set to ${BASH_SOURCE[0]}
# returns : The absolute path of the bash file
function ViashSourceDir {
  local source="$1"
  while [ -h "$source" ]; do
    local dir="$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd )"
    source="$(readlink "$source")"
    [[ $source != /* ]] && source="$dir/$source"
  done
  cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd
}
# ViashFindTargetDir: return the path of the '.build.yaml' file, following symlinks
# usage   : ViashFindTargetDir 'ScriptPath'
# $1      : The location from where to start the upward search
# returns : The absolute path of the '.build.yaml' file
function ViashFindTargetDir {
  local source="$1"
  while [[ "$source" != "" && ! -e "$source/.build.yaml" ]]; do
    source=${source%/*}
  done
  echo $source
}
# see https://en.wikipedia.org/wiki/Syslog#Severity_level
VIASH_LOGCODE_EMERGENCY=0
VIASH_LOGCODE_ALERT=1
VIASH_LOGCODE_CRITICAL=2
VIASH_LOGCODE_ERROR=3
VIASH_LOGCODE_WARNING=4
VIASH_LOGCODE_NOTICE=5
VIASH_LOGCODE_INFO=6
VIASH_LOGCODE_DEBUG=7
VIASH_VERBOSITY=$VIASH_LOGCODE_NOTICE

# ViashLog: Log events depending on the verbosity level
# usage: ViashLog 1 alert Oh no something went wrong!
# $1: required verbosity level
# $2: display tag
# $3+: messages to display
# stdout: Your input, prepended by '[$2] '.
function ViashLog {
  local required_level="$1"
  local display_tag="$2"
  shift 2
  if [ $VIASH_VERBOSITY -ge $required_level ]; then
    >&2 echo "[$display_tag]" "$@"
  fi
}

# ViashEmergency: log events when the system is unstable
# usage: ViashEmergency Oh no something went wrong.
# stdout: Your input, prepended by '[emergency] '.
function ViashEmergency {
  ViashLog $VIASH_LOGCODE_EMERGENCY emergency "$@"
}

# ViashAlert: log events when actions must be taken immediately (e.g. corrupted system database)
# usage: ViashAlert Oh no something went wrong.
# stdout: Your input, prepended by '[alert] '.
function ViashAlert {
  ViashLog $VIASH_LOGCODE_ALERT alert "$@"
}

# ViashCritical: log events when a critical condition occurs
# usage: ViashCritical Oh no something went wrong.
# stdout: Your input, prepended by '[critical] '.
function ViashCritical {
  ViashLog $VIASH_LOGCODE_CRITICAL critical "$@"
}

# ViashError: log events when an error condition occurs
# usage: ViashError Oh no something went wrong.
# stdout: Your input, prepended by '[error] '.
function ViashError {
  ViashLog $VIASH_LOGCODE_ERROR error "$@"
}

# ViashWarning: log potentially abnormal events
# usage: ViashWarning Something may have gone wrong.
# stdout: Your input, prepended by '[warning] '.
function ViashWarning {
  ViashLog $VIASH_LOGCODE_WARNING warning "$@"
}

# ViashNotice: log significant but normal events
# usage: ViashNotice This just happened.
# stdout: Your input, prepended by '[notice] '.
function ViashNotice {
  ViashLog $VIASH_LOGCODE_NOTICE notice "$@"
}

# ViashInfo: log normal events
# usage: ViashInfo This just happened.
# stdout: Your input, prepended by '[info] '.
function ViashInfo {
  ViashLog $VIASH_LOGCODE_INFO info "$@"
}

# ViashDebug: log all events, for debugging purposes
# usage: ViashDebug This just happened.
# stdout: Your input, prepended by '[debug] '.
function ViashDebug {
  ViashLog $VIASH_LOGCODE_DEBUG debug "$@"
}

# find source folder of this component
VIASH_META_RESOURCES_DIR=`ViashSourceDir ${BASH_SOURCE[0]}`

# find the root of the built components & dependencies
VIASH_TARGET_DIR=`ViashFindTargetDir $VIASH_META_RESOURCES_DIR`

# define meta fields
VIASH_META_NAME="rnaseq"
VIASH_META_FUNCTIONALITY_NAME="rnaseq"
VIASH_META_EXECUTABLE="$VIASH_META_RESOURCES_DIR/$VIASH_META_NAME"
VIASH_META_CONFIG="$VIASH_META_RESOURCES_DIR/.config.vsh.yaml"
VIASH_META_TEMP_DIR="$VIASH_TEMP"


# ViashHelp: Display helpful explanation about this executable
function ViashHelp {
  echo "rnaseq main"
  echo ""
  echo "A viash workflow for the nf-core/rnaseq pipeline."
  echo ""
  echo "Input:"
  echo "    --id"
  echo "        type: string, required parameter"
  echo "        example: foo"
  echo "        ID of the sample."
  echo ""
  echo "    --fastq_1"
  echo "        type: file, required parameter, multiple values allowed, file must exist"
  echo "        Path to the sample (or read 1 of paired end sample)."
  echo ""
  echo "    --fastq_2"
  echo "        type: file, multiple values allowed"
  echo "        Path to read 2 of the sample."
  echo ""
  echo "    --strandedness"
  echo "        type: string"
  echo "        default: auto"
  echo "        choices: [ unstranded, forward, reverse, auto ]"
  echo "        Sample strand-specificity. Must be one of unstranded, forward, reverse"
  echo "        or auto"
  echo ""
  echo "Reference genome options:"
  echo "    --fasta"
  echo "        type: file, required parameter, file must exist"
  echo "        Path to FASTA genome file."
  echo ""
  echo "    --gtf"
  echo "        type: file, file must exist"
  echo "        Path to GTF annotation file. This parameter is *mandatory* if --genome"
  echo "        is not specified."
  echo ""
  echo "    --gff"
  echo "        type: file, file must exist"
  echo "        Path to GFF3 annotation file. Required if \"--gtf\" is not specified."
  echo ""
  echo "    --additional_fasta"
  echo "        type: file, file must exist"
  echo "        FASTA file to concatenate to genome FASTA file e.g. containing spike-in"
  echo "        sequences."
  echo ""
  echo "    --transcript_fasta"
  echo "        type: file, file must exist"
  echo "        Path to FASTA transcriptome file."
  echo ""
  echo "    --gene_bed"
  echo "        type: file, file must exist"
  echo "        Path to BED file containing gene intervals. This will be created from"
  echo "        the GTF file if not specified."
  echo ""
  echo "    --splicesites"
  echo "        type: file, file must exist"
  echo "        Splice sites file required for HISAT2."
  echo ""
  echo "    --star_index"
  echo "        type: file, file must exist"
  echo "        Path to directory or tar.gz archive for pre-built STAR index."
  echo ""
  echo "    --rsem_index"
  echo "        type: file, file must exist"
  echo "        Path to directory or tar.gz archive for pre-built RSEM index."
  echo ""
  echo "    --salmon_index"
  echo "        type: file, file must exist"
  echo "        Path to directory or tar.gz archive for pre-built Salmon index."
  echo ""
  echo "    --kallisto_index"
  echo "        type: file, file must exist"
  echo "        Path to directory or tar.gz archive for pre-built Kallisto index."
  echo ""
  echo "    --gencode"
  echo "        type: boolean_true"
  echo "        Specify if the GTF annotation is in GENCODE format."
  echo ""
  echo "    --gtf_extra_attributes"
  echo "        type: string"
  echo "        default: gene_name"
  echo "        Additional gene identifiers from the input GTF file when running Salmon."
  echo "        More than one value can be specified separated by comma."
  echo ""
  echo "    --gtf_group_features"
  echo "        type: string"
  echo "        default: gene_id"
  echo "        Define the attribute type used to group features in the GTF file when"
  echo "        running Salmon."
  echo ""
  echo "    --featurecounts_group_type"
  echo "        type: string"
  echo "        default: gene_biotype"
  echo "        The attribute type used to group feature types in the GTF file when"
  echo "        generating the biotype plot with featureCounts."
  echo ""
  echo "    --featurecounts_feature_type"
  echo "        type: string"
  echo "        default: exon"
  echo "        By default, the pipeline assigns reads based on the 'exon' attribute"
  echo "        within the GTF file."
  echo ""
  echo "    --star_sjdb_gtf_feature_exon"
  echo "        type: string"
  echo "        Feature type in GTF file to be used as exons for building transcripts"
  echo ""
  echo "Read trimming options:"
  echo "    --trimmer"
  echo "        type: string"
  echo "        default: trimgalore"
  echo "        choices: [ trimgalore, fastp ]"
  echo "        Specify the trimming tool to use."
  echo ""
  echo "    --min_trimmed_reads"
  echo "        type: integer"
  echo "        default: 10000"
  echo "        Minimum number of trimmed reads below which samples are removed from"
  echo "        further processing. Some downstream steps in the pipeline will fail if"
  echo "        this threshold is too low."
  echo ""
  echo "Read filtering options:"
  echo "    --bbsplit_fasta_list"
  echo "        type: file, multiple values allowed, file must exist"
  echo "        List of reference genomes (separated by \";\") to filter reads against"
  echo "        with BBSplit."
  echo ""
  echo "    --bbsplit_index"
  echo "        type: file, file must exist"
  echo "        Path to directory or tar.gz archive for pre-built BBSplit index."
  echo ""
  echo "    --remove_ribo_rna"
  echo "        type: boolean_true"
  echo "        Enable the removal of reads derived from ribosomal RNA using SortMeRNA."
  echo ""
  echo "    --ribo_database_manifest"
  echo "        type: file, file must exist"
  echo "        default: src/assets/rrna-db-defaults.txt"
  echo "        Text file containing paths to fasta files (one per line) that will be"
  echo "        used to create the database for SortMeRNA."
  echo ""
  echo "UMI options:"
  echo "    --with_umi"
  echo "        type: boolean_true"
  echo "        Enable UMI-based read deduplication."
  echo ""
  echo "    --umitools_extract_method"
  echo "        type: string"
  echo "        default: string"
  echo "        choices: [ string, regex ]"
  echo "        UMI pattern to use."
  echo ""
  echo "    --umitools_bc_pattern"
  echo "        type: string"
  echo "        The UMI barcode pattern to use e.g. 'NNNNNN' indicates that the first 6"
  echo "        nucleotides of the read are from the UMI."
  echo ""
  echo "    --umitools_bc_pattern2"
  echo "        type: string"
  echo "        The UMI barcode pattern to use if the UMI is located in read 2."
  echo ""
  echo "    --umi_discard_read"
  echo "        type: integer"
  echo "        default: 0"
  echo "        choices: [ 0, 1, 2 ]"
  echo "        After UMI barcode extraction discard either R1 or R2 by setting this"
  echo "        parameter to 1 or 2, respectively."
  echo ""
  echo "    --umitools_umi_separator"
  echo "        type: string"
  echo "        default: _"
  echo "        The character that separates the UMI in the read name. Most likely a"
  echo "        colon if you skipped the extraction with UMI-tools and used other"
  echo "        software."
  echo ""
  echo "    --umitools_grouping_method"
  echo "        type: string"
  echo "        default: directional"
  echo "        choices: [ unique, percentile, cluster, adjacency, directional ]"
  echo "        Method to use to determine read groups by subsuming those with similar"
  echo "        UMIs. All methods start by identifying the reads with the same mapping"
  echo "        position, but treat similar yet nonidentical UMIs differently."
  echo ""
  echo "    --umi_dedup_stats"
  echo "        type: boolean_true"
  echo "        Generate output stats when running \"umi_tools dedup\"."
  echo ""
  echo "Alignment options:"
  echo "    --aligner"
  echo "        type: string"
  echo "        default: star_salmon"
  echo "        choices: [ star_salmon, star_rsem, hisat2 ]"
  echo "        Specifies the alignment algorithm to use - available options are"
  echo "        'star_salmon', 'star_rsem' and 'hisat2'."
  echo ""
  echo "    --pseudo_aligner"
  echo "        type: string"
  echo "        default: salmon"
  echo "        choices: [ salmon, kallisto ]"
  echo "        Specifies the pseudo aligner to use - available options are 'salmon'."
  echo "        Runs in addition to '--aligner'."
  echo ""
  echo "    --pseudo_aligner_kmer_size"
  echo "        type: integer"
  echo "        default: 31"
  echo "        Kmer length passed to indexing step of pseudoaligners."
  echo ""
  echo "    --kallisto_quant_fragment_length"
  echo "        type: double"
  echo "        For single-end mode only, the estimated average fragment length to use"
  echo "        for quantification with Kallisto."
  echo ""
  echo "    --kallisto_quant_fragment_length_sd"
  echo "        type: double"
  echo "        For single-end mode only, the estimated standard deviation of the"
  echo "        fragment length for quantification with Kallisto."
  echo ""
  echo "    --bam_csi_index"
  echo "        type: boolean_true"
  echo "        Create a CSI index for BAM files instead of the traditional BAI index."
  echo "        This will be required for genomes with larger chromosome sizes."
  echo ""
  echo "    --salmon_quant_libtype"
  echo "        type: string"
  echo "        Override Salmon library type inferred based on strandedness defined in"
  echo "        meta object."
  echo ""
  echo "    --min_mapped_reads"
  echo "        type: integer"
  echo "        default: 5"
  echo "        Minimum percentage of uniquely mapped reads below which samples are"
  echo "        removed from further processing."
  echo ""
  echo "    --stringtie_ignore_gtf"
  echo "        type: boolean_true"
  echo "        Perform reference-guided de novo assembly of transcripts using"
  echo "        StringTie, i.e. don't restrict to those in GTF file."
  echo ""
  echo "    --extra_stringtie_args"
  echo "        type: string"
  echo "        default: -v"
  echo "        Extra arguments to pass to stringtie command in addition to defaults"
  echo "        defined by the pipeline."
  echo ""
  echo "    --save_unaligned"
  echo "        type: boolean_true"
  echo "        Where possible, save unaligned reads from either STAR, HISAT2 or Salmon"
  echo "        to the results directory."
  echo ""
  echo "    --save_align_intermeds"
  echo "        type: boolean_true"
  echo "        Save the intermediate BAM files from the alignment step."
  echo ""
  echo "    --skip_alignment"
  echo "        type: boolean_true"
  echo "        Skip all of the alignment-based processes within the pipeline."
  echo ""
  echo "    --skip_pseudo_alignment"
  echo "        type: boolean_true"
  echo "        Skip all of the pseudo-alignment-based processes within the pipeline."
  echo ""
  echo "Process skipping options:"
  echo "    --skip_fastqc"
  echo "        type: boolean"
  echo "        default: false"
  echo "        Skip FatQC step."
  echo ""
  echo "    --skip_trimming"
  echo "        type: boolean"
  echo "        default: false"
  echo "        Skip the adapter trimming step."
  echo ""
  echo "    --skip_umi_extract"
  echo "        type: boolean"
  echo "        default: false"
  echo "        Skip umi_tools extract step."
  echo ""
  echo "    --skip_qc"
  echo "        type: boolean_true"
  echo "        Skip all QC steps except for MultiQC."
  echo ""
  echo "    --skip_markduplicates"
  echo "        type: boolean_true"
  echo "        Skip picard MarkDuplicates step."
  echo ""
  echo "    --skip_stringtie"
  echo "        type: boolean_true"
  echo "        Skip StringTie."
  echo ""
  echo "    --skip_biotype_qc"
  echo "        type: boolean_true"
  echo "        Skip additional featureCounts process for biotype QC."
  echo ""
  echo "    --skip_bigwig"
  echo "        type: boolean_true"
  echo "        Skip bigWig file creation."
  echo ""
  echo "    --skip_preseq"
  echo "        type: boolean_true"
  echo "        Skip Preseq."
  echo ""
  echo "    --skip_dupradar"
  echo "        type: boolean_true"
  echo "        Skip dupRadar."
  echo ""
  echo "    --skip_qualimap"
  echo "        type: boolean_true"
  echo "        Skip Qualimap."
  echo ""
  echo "    --skip_rseqc"
  echo "        type: boolean_true"
  echo "        Skip RSeQC."
  echo ""
  echo "    --skip_multiqc"
  echo "        type: boolean_true"
  echo "        Skip MultiQC."
  echo ""
  echo "Other process arguments:"
  echo "    --extra_picard_args"
  echo "        type: string"
  echo "        default:  --ASSUME_SORTED true --REMOVE_DUPLICATES false"
  echo "--VALIDATION_STRINGENCY LENIENT --TMP_DIR tmp"
  echo "        Extra arguments to pass to picard MarkDuplicates command in addition to"
  echo "        defaults defined by the pipeline."
  echo ""
  echo "    --extra_preseq_args"
  echo "        type: string"
  echo "        default: -verbose -seed 1 -seg_len 100000000"
  echo "        Extra arguments to pass to preseq lc_extrap command in addition to"
  echo "        defaults defined by the pipeline"
  echo ""
  echo "    --deseq2_vst"
  echo "        type: boolean"
  echo "        default: true"
  echo "        Use vst transformation instead of rlog with DESeq2"
  echo ""
  echo "    --rseqc_modules"
  echo "        type: string, multiple values allowed"
  echo "        default:"
  echo "bam_stat;inner_distance;infer_experiment;junction_annotation;junction_saturation;read_distribution;read_duplication"
  echo "        choices: [ bam_stat, inner_distance, infer_experiment,"
  echo "junction_annotation, junction_saturation, read_distribution, read_duplication,"
  echo "tin ]"
  echo "        Specify the RSeQC modules to run_wf (comma-separated list)"
  echo ""
  echo "MultiQC paramenters:"
  echo "    --multiqc_custom_config"
  echo "        type: file, file must exist"
  echo "        Custom multiqc configuration file"
  echo ""
  echo "    --multiqc_title"
  echo "        type: string"
  echo "        Custom multiqc title"
  echo ""
  echo "    --multiqc_methods_description"
  echo "        type: file, file must exist"
  echo ""
  echo "Output:"
  echo "    --output_fasta"
  echo "        type: file, output, file must exist"
  echo "        default: reference/genome.fasta"
  echo ""
  echo "    --output_gtf"
  echo "        type: file, output, file must exist"
  echo "        default: reference/gene_annotation.gtf"
  echo ""
  echo "    --output_transcript_fasta"
  echo "        type: file, output, file must exist"
  echo "        default: reference/transcriptome.fasta"
  echo ""
  echo "    --output_gene_bed"
  echo "        type: file, output, file must exist"
  echo "        default: reference/gene_annotation.bed"
  echo ""
  echo "    --output_star_index"
  echo "        type: file, output, file must exist"
  echo "        default: reference/index/STAR"
  echo "        Path to STAR index."
  echo ""
  echo "    --output_salmon_index"
  echo "        type: file, output, file must exist"
  echo "        default: reference/index/Salmon"
  echo "        Path to Salmon index."
  echo ""
  echo "    --output_bbsplit_index"
  echo "        type: file, output, file must exist"
  echo "        default: reference/index/BBSplit"
  echo "        Path to BBSplit index."
  echo ""
  echo "    --output_kallisto_index"
  echo "        type: file, output, file must exist"
  echo "        default: reference/index/Kallisto"
  echo "        Path to Kallisto index."
  echo ""
  echo "    --output_fastq_1"
  echo "        type: file, output"
  echo "        default: fastq/\${id}_r1.fastq.gz"
  echo "        Path to output directory"
  echo ""
  echo "    --output_fastq_2"
  echo "        type: file, output"
  echo "        default: fastq/\${id}_r2.fastq.gz"
  echo "        Path to output directory"
  echo ""
  echo "    --fastqc_html_1"
  echo "        type: file, output"
  echo "        default: fastqc_raw/\${id}_r1.fastqc.html"
  echo "        FastQC HTML report for read 1."
  echo ""
  echo "    --fastqc_html_2"
  echo "        type: file, output"
  echo "        default: fastqc_raw/\${id}_r2.fastqc.html"
  echo "        FastQC HTML report for read 2."
  echo ""
  echo "    --fastqc_zip_1"
  echo "        type: file, output"
  echo "        default: fastqc_raw/\${id}_r1.fastqc.zip"
  echo "        FastQC report archive for read 1."
  echo ""
  echo "    --fastqc_zip_2"
  echo "        type: file, output"
  echo "        default: fastqc_raw/\${id}_r2.fastqc.zip"
  echo "        FastQC report archive for read 2."
  echo ""
  echo "    --trim_html_1"
  echo "        type: file, output"
  echo "        default: fastqc_trim/\${id}_r1.trimmed_fastqc.html"
  echo ""
  echo "    --trim_html_2"
  echo "        type: file, output"
  echo "        default: fastqc_trim/\${id}_r2.trimmed_fastqc.html"
  echo ""
  echo "    --trim_zip_1"
  echo "        type: file, output"
  echo "        default: fastqc_trim/\${id}_r1.trimmed_fastqc.zip"
  echo ""
  echo "    --trim_zip_2"
  echo "        type: file, output"
  echo "        default: fastqc_trim/\${id}_r2.trimmed_fastqc.zip"
  echo ""
  echo "    --trim_log_1"
  echo "        type: file, output"
  echo "        default: trimgalore/\${id}_r1.trimming_report.txt"
  echo ""
  echo "    --trim_log_2"
  echo "        type: file, output"
  echo "        default: trimgalore/\${id}_r2.trimming_report.txt"
  echo ""
  echo "    --fastp_trim_json"
  echo "        type: file, output, file must exist"
  echo "        default: fastp/\$id_out.json"
  echo "        The fastp json format report file name"
  echo ""
  echo "    --fastp_trim_html"
  echo "        type: file, output, file must exist"
  echo "        default: fastp/\$id_out.html"
  echo "        The fastp html format report file name"
  echo ""
  echo "    --sortmerna_log"
  echo "        type: file, output"
  echo "        default: sortmerna/\$id.log"
  echo "        Sortmerna log file."
  echo ""
  echo "    --star_alignment"
  echo "        type: file, output, file must exist"
  echo "        default: STAR/\$id"
  echo ""
  echo "    --genome_bam_sorted"
  echo "        type: file, output, file must exist"
  echo "        default: STAR/genome_processed/\$id.genome.bam"
  echo ""
  echo "    --genome_bam_index"
  echo "        type: file, output, file must exist"
  echo "        default: STAR/genome_processed/\$id.genome.bam.bai"
  echo ""
  echo "    --transcriptome_bam"
  echo "        type: file, output, file must exist"
  echo "        default: STAR/transcriptome_processed/\$id.transcriptome.bam"
  echo ""
  echo "    --transcriptome_bam_index"
  echo "        type: file, output, file must exist"
  echo "        default: STAR/transcriptome_processed/\$id.transcriptome.bam.bai"
  echo ""
  echo "    --star_log"
  echo "        type: file, output, file must exist"
  echo "        default: STAR/log/\$id.log"
  echo ""
  echo "    --genome_bam_stats"
  echo "        type: file, output, file must exist"
  echo "        default: samtools_stats/\$id.genome.stats"
  echo ""
  echo "    --genome_bam_flagstat"
  echo "        type: file, output, file must exist"
  echo "        default: samtools_stats/\$id.genome.flagstat"
  echo ""
  echo "    --genome_bam_idxstats"
  echo "        type: file, output, file must exist"
  echo "        default: samtools_stats/\$id.genome.idxstats"
  echo ""
  echo "    --transcriptome_bam_stats"
  echo "        type: file, output, file must exist"
  echo "        default: samtools_stats/\$id.transcriptome.stats"
  echo ""
  echo "    --transcriptome_bam_flagstat"
  echo "        type: file, output, file must exist"
  echo "        default: samtools_stats/\$id.transcriptome.flagstat"
  echo ""
  echo "    --transcriptome_bam_idxstats"
  echo "        type: file, output, file must exist"
  echo "        default: samtools_stats/\$id.transcriptome.idxstats"
  echo ""
  echo "    --salmon_quant_results"
  echo "        type: file, output, file must exist"
  echo "        default: STAR_Salmon/\$id"
  echo ""
  echo "    --salmon_quant_results_file"
  echo "        type: file, output, file must exist"
  echo "        default: STAR_Salmon/\$id/quant.sf"
  echo ""
  echo "    --pseudo_quant_results"
  echo "        type: file, output, file must exist"
  echo "        default: Pseudo_align_quant/\$id"
  echo ""
  echo "    --rsem_counts_gene"
  echo "        type: file, output, file must exist"
  echo "        default: RSEM/\$id.genes.results"
  echo "        Expression counts on gene level"
  echo ""
  echo "    --rsem_counts_transcripts"
  echo "        type: file, output, file must exist"
  echo "        default: RSEM/\$id.isoforms.results"
  echo "        Expression counts on transcript level"
  echo ""
  echo "    --bam_star_rsem"
  echo "        type: file, output, file must exist"
  echo "        default: RSEM/\$id.STAR.genome.bam"
  echo "        BAM file generated by STAR (from RSEM)"
  echo ""
  echo "    --bam_genome_rsem"
  echo "        type: file, output, file must exist"
  echo "        default: RSEM/\$id.genome.bam"
  echo "        Genome BAM file (from RSEM)"
  echo ""
  echo "    --bam_transcript_rsem"
  echo "        type: file, output, file must exist"
  echo "        default: RSEM/\$id.transcript.bam"
  echo "        Transcript BAM file (from RSEM)"
  echo ""
  echo "    --tpm_gene"
  echo "        type: file, output, file must exist"
  echo "        default: transcript_quantification/gene_tpm.tsv"
  echo ""
  echo "    --counts_gene"
  echo "        type: file, output, file must exist"
  echo "        default: transcript_quantification/gene_counts.tsv"
  echo ""
  echo "    --counts_gene_length_scaled"
  echo "        type: file, output, file must exist"
  echo "        default: transcript_quantification/gene_counts_length_scaled.tsv"
  echo ""
  echo "    --counts_gene_scaled"
  echo "        type: file, output, file must exist"
  echo "        default: transcript_quantification/gene_counts_scaled.tsv"
  echo ""
  echo "    --tpm_transcript"
  echo "        type: file, output, file must exist"
  echo "        default: transcript_quantification/transcript_tpm.tsv"
  echo ""
  echo "    --counts_transcript"
  echo "        type: file, output, file must exist"
  echo "        default: transcript_quantification/transcript_counts.tsv"
  echo ""
  echo "    --quant_merged_summarizedexperiment"
  echo "        type: file, output, file must exist"
  echo "        default: transcript_quantification/summarizedexperiment"
  echo ""
  echo "    --markduplicates_metrics"
  echo "        type: file, output, file must exist"
  echo "        default: picard/\$id.MarkDuplicates.metrics.txt"
  echo ""
  echo "    --stringtie_transcript_gtf"
  echo "        type: file, output, file must exist"
  echo "        default: stringtie/\$id.transcripts.gtf"
  echo ""
  echo "    --stringtie_coverage_gtf"
  echo "        type: file, output, file must exist"
  echo "        default: stringtie/\$id.coverage.gtf"
  echo ""
  echo "    --stringtie_abundance"
  echo "        type: file, output, file must exist"
  echo "        default: stringtie/\$id.gene_abundance.txt"
  echo ""
  echo "    --stringtie_ballgown"
  echo "        type: file, output, file must exist"
  echo "        default: stringtie/\$id.ballgown"
  echo ""
  echo "    --featurecounts"
  echo "        type: file, output, file must exist"
  echo "        default: featurecounts/\$id.featureCounts.txt"
  echo ""
  echo "    --featurecounts_summary"
  echo "        type: file, output, file must exist"
  echo "        default: featurecounts/\$id.featureCounts.txt.summary"
  echo ""
  echo "    --featurecounts_multiqc"
  echo "        type: file, output"
  echo "        default: featurecounts/\$id.featureCounts_mqc.tsv"
  echo ""
  echo "    --featurecounts_rrna_multiqc"
  echo "        type: file, output"
  echo "        default: featurecounts/\$id.featureCounts_rrna_mqc.tsv"
  echo ""
  echo "    --bedgraph_forward"
  echo "        type: file, output, file must exist"
  echo "        default: bedgraph/\$id.forward.bedgraph"
  echo ""
  echo "    --bedgraph_reverse"
  echo "        type: file, output, file must exist"
  echo "        default: bedgraph/\$id.reverse.bedgraph"
  echo ""
  echo "    --bigwig_forward"
  echo "        type: file, output, file must exist"
  echo "        default: bigwig/\$id.forward.bigwig"
  echo ""
  echo "    --bigwig_reverse"
  echo "        type: file, output, file must exist"
  echo "        default: bigwig/\$id.reverse.bigwig"
  echo ""
  echo "    --preseq_output"
  echo "        type: file, output, file must exist"
  echo "        default: preseq/\$id.lc_extrap.txt"
  echo ""
  echo "    --bamstat_output"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/bamstat/\$id.mapping_quality.txt"
  echo "        Path to output file (txt) of mapping quality statistics"
  echo ""
  echo "    --strandedness_output"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/inferexperiment/\$id.strandedness.txt"
  echo "        Path to output report (txt) of inferred strandedness"
  echo ""
  echo "    --inner_dist_output_stats"
  echo "        type: file, output"
  echo "        default: RSeQC/innerdistance/\$id.inner_distance.stats"
  echo "        output file (txt) with summary statistics of inner distances of paired"
  echo "        reads"
  echo ""
  echo "    --inner_dist_output_dist"
  echo "        type: file, output"
  echo "        default: RSeQC/innerdistance/txt/\$id.inner_distance.txt"
  echo "        output file (txt) with inner distances of all paired reads"
  echo ""
  echo "    --inner_dist_output_freq"
  echo "        type: file, output"
  echo "        default: RSeQC/innerdistance/txt/\$id.inner_distance_freq.txt"
  echo "        output file (txt) with frequencies of inner distances of all paired"
  echo "        reads"
  echo ""
  echo "    --inner_dist_output_plot"
  echo "        type: file, output"
  echo "        default: RSeQC/innerdistance/pdf/\$id.inner_distance_plot.pdf"
  echo "        output file (pdf) with histogram plot of of inner distances of all"
  echo "        paired reads"
  echo ""
  echo "    --inner_dist_output_plot_r"
  echo "        type: file, output"
  echo "        default: RSeQC/innerdistance/rscript/\$id.inner_distance_plot.r"
  echo "        output file (R) with script of histogram plot of of inner distances of"
  echo "        all paired reads"
  echo ""
  echo "    --junction_annotation_output_log"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/junctionannotation/log/\$id.junction_annotation.log"
  echo "        output log of junction annotation script"
  echo ""
  echo "    --junction_annotation_output_plot_r"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/junctionannotation/rscript/\$id.junction_annotation_plot.r"
  echo "        R script to generate splice_junction and splice_events plot"
  echo ""
  echo "    --junction_annotation_output_junction_bed"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/junctionannotation/bed/\$id.junction_annotation.bed"
  echo "        junction annotation file (bed format)"
  echo ""
  echo "    --junction_annotation_output_junction_interact"
  echo "        type: file, output, file must exist"
  echo "        default:"
  echo "RSeQC/junctionannotation/bed/\$id.junction_annotation.Interact.bed"
  echo "        interact file (bed format) of junctions. Can be uploaded to UCSC genome"
  echo "        browser or converted to bigInteract (using bedToBigBed program) for"
  echo "        visualization."
  echo ""
  echo "    --junction_annotation_output_junction_sheet"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/junctionannotation/xls/\$id.junction_annotation.xls"
  echo "        junction annotation file (xls format)"
  echo ""
  echo "    --junction_annotation_output_splice_events_plot"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/junctionannotation/pdf/\$id.splice_events.pdf"
  echo "        plot of splice events (pdf)"
  echo ""
  echo "    --junction_annotation_output_splice_junctions_plot"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/junctionannotation/pdf/\$id.splice_junctions_plot.pdf"
  echo "        plot of junctions (pdf)"
  echo ""
  echo "    --junction_saturation_output_plot_r"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/junctionsaturation/rscript/\$id.junction_saturation_plot.r"
  echo "        r script to generate junction_saturation_plot plot"
  echo ""
  echo "    --junction_saturation_output_plot"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/junctionsaturation/pdf/\$id.junction_saturation_plot.pdf"
  echo "        plot of junction saturation (pdf"
  echo ""
  echo "    --read_distribution_output"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/readdistribution/\$id.read_distribution.txt"
  echo "        output file (txt) of read distribution analysis."
  echo ""
  echo "    --read_duplication_output_duplication_rate_plot_r"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/readduplication/rscrpt/\$id.duplication_rate_plot.r"
  echo "        R script for generating duplication rate plot"
  echo ""
  echo "    --read_duplication_output_duplication_rate_plot"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/readduplication/pdf/\$id.duplication_rate_plot.pdf"
  echo "        duplication rate plot (pdf)"
  echo ""
  echo "    --read_duplication_output_duplication_rate_mapping"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/readduplication/xls/\$id.duplication_rate_mapping.xls"
  echo "        Summary of mapping-based read duplication"
  echo ""
  echo "    --read_duplication_output_duplication_rate_sequence"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/readduplication/xls/\$id.duplication_rate_sequencing.xls"
  echo "        Summary of sequencing-based read duplication"
  echo ""
  echo "    --tin_output_summary"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/tin/txt/\$id.tin_summary.txt"
  echo "        summary statistics (txt) of calculated TIN metrics"
  echo ""
  echo "    --tin_output_metrics"
  echo "        type: file, output, file must exist"
  echo "        default: RSeQC/tin/xls/\$id.tin.xls"
  echo "        file with TIN metrics (xls)"
  echo ""
  echo "    --dupradar_output_dupmatrix"
  echo "        type: file, output, file must exist"
  echo "        default: dupradar/gene_data/\$id.dup_matrix.txt"
  echo "        path to output file (txt) of duplicate tag counts"
  echo ""
  echo "    --dupradar_output_dup_intercept_mqc"
  echo "        type: file, output, file must exist"
  echo "        default: dupradar/mqc_intercept/\$id.dup_intercept_mqc.txt"
  echo "        path to output file (txt) of multiqc intercept value DupRadar"
  echo ""
  echo "    --dupradar_output_duprate_exp_boxplot"
  echo "        type: file, output, file must exist"
  echo "        default: dupradar/box_plot/\$id.duprate_exp_boxplot.pdf"
  echo "        path to output file (pdf) of distribution of expression box plot"
  echo ""
  echo "    --dupradar_output_duprate_exp_densplot"
  echo "        type: file, output, file must exist"
  echo "        default: dupradar/scatter_plot/\$id.duprate_exp_densityplot.pdf"
  echo "        path to output file (pdf) of 2D density scatter plot of duplicate tag"
  echo "        counts"
  echo ""
  echo "    --dupradar_output_duprate_exp_denscurve_mqc"
  echo "        type: file, output, file must exist"
  echo "        default: dupradar/density_curve/\$id.duprate_exp_density_curve_mqc.pdf"
  echo "        path to output file (pdf) of density curve of gene duplication multiqc"
  echo ""
  echo "    --dupradar_output_expression_histogram"
  echo "        type: file, output, file must exist"
  echo "        default: dupradar/histogram/\$id.expression_hist.pdf"
  echo "        path to output file (pdf) of distribution of RPK values per gene"
  echo "        histogram"
  echo ""
  echo "    --dupradar_output_intercept_slope"
  echo "        type: file, output, file must exist"
  echo "        default: dupradar/intercept_slope/\$id.intercept_slope.txt"
  echo ""
  echo "    --qualimap_qc_report"
  echo "        type: file, output, file must exist"
  echo "        default: Qualimap/\$id.rnaseq_qc_results.txt"
  echo "        Text file containing the RNAseq QC results."
  echo ""
  echo "    --qualimap_counts"
  echo "        type: file, output, file must exist"
  echo "        default: Qualimap/\$id.counts.txt"
  echo "        Output file for computed counts."
  echo ""
  echo "    --qualimap_report"
  echo "        type: file, output, file must exist"
  echo "        default: Qualimap/\$id.report.html"
  echo "        Report output file. Supported formats are PDF or HTML."
  echo ""
  echo "    --deseq2_output"
  echo "        type: file, output, file must exist"
  echo "        default: deseq2_qc"
  echo ""
  echo "    --deseq2_output_pseudo"
  echo "        type: file, output, file must exist"
  echo "        default: deseq2_qc_pseudo"
  echo ""
  echo "    --multiqc_report"
  echo "        type: file, output, file must exist"
  echo "        default: multiqc/multiqc_report.html"
  echo ""
  echo "    --multiqc_data"
  echo "        type: file, output, file must exist"
  echo "        default: multiqc/multiqc_data"
  echo ""
  echo "    --multiqc_plots"
  echo "        type: file, output, file must exist"
  echo "        default: multiqc/multiqc_plots"
  echo ""
  echo "    --multiqc_versions"
  echo "        type: file, output, file must exist"
  echo ""
  echo "    --pseudo_counts_gene"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_alignment_quantification/gene_counts.tsv"
  echo ""
  echo "    --pseudo_counts_gene_length_scaled"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_alignment_quantification/gene_counts_length_scaled.tsv"
  echo ""
  echo "    --pseudo_counts_gene_scaled"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_alignment_quantification/gene_counts_scaled.tsv"
  echo ""
  echo "    --pseudo_tpm_gene"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_alignment_quantification/gene_tpm.tsv"
  echo ""
  echo "    --pseudo_tpm_transcript"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_alignment_quantification/transcript_tpm.tsv"
  echo ""
  echo "    --pseudo_counts_transcript"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_alignment_quantification/transcript_counts.tsv"
  echo ""
  echo "    --pseudo_quant_merged_summarizedexperiment"
  echo "        type: file, output, file must exist"
  echo "        default:"
  echo "pseudo_alignment_quantification/quant_merged_summarizedexperiment"
}

# initialise variables
VIASH_MODE='run'
VIASH_ENGINE_ID='native'

# initialise array
VIASH_POSITIONAL_ARGS=''

while [[ $# -gt 0 ]]; do
    case "$1" in
        -h|--help)
            ViashHelp
            exit
            ;;
        ---v|---verbose)
            let "VIASH_VERBOSITY=VIASH_VERBOSITY+1"
            shift 1
            ;;
        ---verbosity)
            VIASH_VERBOSITY="$2"
            shift 2
            ;;
        ---verbosity=*)
            VIASH_VERBOSITY="$(ViashRemoveFlags "$1")"
            shift 1
            ;;
        --version)
            echo "rnaseq main"
            exit
            ;;
        --id)
            [ -n "$VIASH_PAR_ID" ] && ViashError Bad arguments for option \'--id\': \'$VIASH_PAR_ID\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ID="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --id. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --id=*)
            [ -n "$VIASH_PAR_ID" ] && ViashError Bad arguments for option \'--id=*\': \'$VIASH_PAR_ID\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ID=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --fastq_1)
            if [ -z "$VIASH_PAR_FASTQ_1" ]; then
              VIASH_PAR_FASTQ_1="$2"
            else
              VIASH_PAR_FASTQ_1="$VIASH_PAR_FASTQ_1;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --fastq_1. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --fastq_1=*)
            if [ -z "$VIASH_PAR_FASTQ_1" ]; then
              VIASH_PAR_FASTQ_1=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_FASTQ_1="$VIASH_PAR_FASTQ_1;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --fastq_2)
            if [ -z "$VIASH_PAR_FASTQ_2" ]; then
              VIASH_PAR_FASTQ_2="$2"
            else
              VIASH_PAR_FASTQ_2="$VIASH_PAR_FASTQ_2;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --fastq_2. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --fastq_2=*)
            if [ -z "$VIASH_PAR_FASTQ_2" ]; then
              VIASH_PAR_FASTQ_2=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_FASTQ_2="$VIASH_PAR_FASTQ_2;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --strandedness)
            [ -n "$VIASH_PAR_STRANDEDNESS" ] && ViashError Bad arguments for option \'--strandedness\': \'$VIASH_PAR_STRANDEDNESS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRANDEDNESS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --strandedness. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --strandedness=*)
            [ -n "$VIASH_PAR_STRANDEDNESS" ] && ViashError Bad arguments for option \'--strandedness=*\': \'$VIASH_PAR_STRANDEDNESS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRANDEDNESS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --fasta)
            [ -n "$VIASH_PAR_FASTA" ] && ViashError Bad arguments for option \'--fasta\': \'$VIASH_PAR_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTA="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --fasta. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --fasta=*)
            [ -n "$VIASH_PAR_FASTA" ] && ViashError Bad arguments for option \'--fasta=*\': \'$VIASH_PAR_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTA=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --gtf)
            [ -n "$VIASH_PAR_GTF" ] && ViashError Bad arguments for option \'--gtf\': \'$VIASH_PAR_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GTF="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --gtf. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --gtf=*)
            [ -n "$VIASH_PAR_GTF" ] && ViashError Bad arguments for option \'--gtf=*\': \'$VIASH_PAR_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GTF=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --gff)
            [ -n "$VIASH_PAR_GFF" ] && ViashError Bad arguments for option \'--gff\': \'$VIASH_PAR_GFF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GFF="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --gff. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --gff=*)
            [ -n "$VIASH_PAR_GFF" ] && ViashError Bad arguments for option \'--gff=*\': \'$VIASH_PAR_GFF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GFF=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --additional_fasta)
            [ -n "$VIASH_PAR_ADDITIONAL_FASTA" ] && ViashError Bad arguments for option \'--additional_fasta\': \'$VIASH_PAR_ADDITIONAL_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ADDITIONAL_FASTA="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --additional_fasta. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --additional_fasta=*)
            [ -n "$VIASH_PAR_ADDITIONAL_FASTA" ] && ViashError Bad arguments for option \'--additional_fasta=*\': \'$VIASH_PAR_ADDITIONAL_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ADDITIONAL_FASTA=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --transcript_fasta)
            [ -n "$VIASH_PAR_TRANSCRIPT_FASTA" ] && ViashError Bad arguments for option \'--transcript_fasta\': \'$VIASH_PAR_TRANSCRIPT_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRANSCRIPT_FASTA="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --transcript_fasta. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --transcript_fasta=*)
            [ -n "$VIASH_PAR_TRANSCRIPT_FASTA" ] && ViashError Bad arguments for option \'--transcript_fasta=*\': \'$VIASH_PAR_TRANSCRIPT_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRANSCRIPT_FASTA=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --gene_bed)
            [ -n "$VIASH_PAR_GENE_BED" ] && ViashError Bad arguments for option \'--gene_bed\': \'$VIASH_PAR_GENE_BED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENE_BED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --gene_bed. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --gene_bed=*)
            [ -n "$VIASH_PAR_GENE_BED" ] && ViashError Bad arguments for option \'--gene_bed=*\': \'$VIASH_PAR_GENE_BED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENE_BED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --splicesites)
            [ -n "$VIASH_PAR_SPLICESITES" ] && ViashError Bad arguments for option \'--splicesites\': \'$VIASH_PAR_SPLICESITES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SPLICESITES="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --splicesites. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --splicesites=*)
            [ -n "$VIASH_PAR_SPLICESITES" ] && ViashError Bad arguments for option \'--splicesites=*\': \'$VIASH_PAR_SPLICESITES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SPLICESITES=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --star_index)
            [ -n "$VIASH_PAR_STAR_INDEX" ] && ViashError Bad arguments for option \'--star_index\': \'$VIASH_PAR_STAR_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STAR_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --star_index. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --star_index=*)
            [ -n "$VIASH_PAR_STAR_INDEX" ] && ViashError Bad arguments for option \'--star_index=*\': \'$VIASH_PAR_STAR_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STAR_INDEX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --rsem_index)
            [ -n "$VIASH_PAR_RSEM_INDEX" ] && ViashError Bad arguments for option \'--rsem_index\': \'$VIASH_PAR_RSEM_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RSEM_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --rsem_index. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --rsem_index=*)
            [ -n "$VIASH_PAR_RSEM_INDEX" ] && ViashError Bad arguments for option \'--rsem_index=*\': \'$VIASH_PAR_RSEM_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RSEM_INDEX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --salmon_index)
            [ -n "$VIASH_PAR_SALMON_INDEX" ] && ViashError Bad arguments for option \'--salmon_index\': \'$VIASH_PAR_SALMON_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SALMON_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --salmon_index. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --salmon_index=*)
            [ -n "$VIASH_PAR_SALMON_INDEX" ] && ViashError Bad arguments for option \'--salmon_index=*\': \'$VIASH_PAR_SALMON_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SALMON_INDEX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --kallisto_index)
            [ -n "$VIASH_PAR_KALLISTO_INDEX" ] && ViashError Bad arguments for option \'--kallisto_index\': \'$VIASH_PAR_KALLISTO_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_KALLISTO_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --kallisto_index. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --kallisto_index=*)
            [ -n "$VIASH_PAR_KALLISTO_INDEX" ] && ViashError Bad arguments for option \'--kallisto_index=*\': \'$VIASH_PAR_KALLISTO_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_KALLISTO_INDEX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --gencode)
            [ -n "$VIASH_PAR_GENCODE" ] && ViashError Bad arguments for option \'--gencode\': \'$VIASH_PAR_GENCODE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENCODE=true
            shift 1
            ;;
        --gtf_extra_attributes)
            [ -n "$VIASH_PAR_GTF_EXTRA_ATTRIBUTES" ] && ViashError Bad arguments for option \'--gtf_extra_attributes\': \'$VIASH_PAR_GTF_EXTRA_ATTRIBUTES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GTF_EXTRA_ATTRIBUTES="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --gtf_extra_attributes. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --gtf_extra_attributes=*)
            [ -n "$VIASH_PAR_GTF_EXTRA_ATTRIBUTES" ] && ViashError Bad arguments for option \'--gtf_extra_attributes=*\': \'$VIASH_PAR_GTF_EXTRA_ATTRIBUTES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GTF_EXTRA_ATTRIBUTES=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --gtf_group_features)
            [ -n "$VIASH_PAR_GTF_GROUP_FEATURES" ] && ViashError Bad arguments for option \'--gtf_group_features\': \'$VIASH_PAR_GTF_GROUP_FEATURES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GTF_GROUP_FEATURES="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --gtf_group_features. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --gtf_group_features=*)
            [ -n "$VIASH_PAR_GTF_GROUP_FEATURES" ] && ViashError Bad arguments for option \'--gtf_group_features=*\': \'$VIASH_PAR_GTF_GROUP_FEATURES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GTF_GROUP_FEATURES=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --featurecounts_group_type)
            [ -n "$VIASH_PAR_FEATURECOUNTS_GROUP_TYPE" ] && ViashError Bad arguments for option \'--featurecounts_group_type\': \'$VIASH_PAR_FEATURECOUNTS_GROUP_TYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FEATURECOUNTS_GROUP_TYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --featurecounts_group_type. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --featurecounts_group_type=*)
            [ -n "$VIASH_PAR_FEATURECOUNTS_GROUP_TYPE" ] && ViashError Bad arguments for option \'--featurecounts_group_type=*\': \'$VIASH_PAR_FEATURECOUNTS_GROUP_TYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FEATURECOUNTS_GROUP_TYPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --featurecounts_feature_type)
            [ -n "$VIASH_PAR_FEATURECOUNTS_FEATURE_TYPE" ] && ViashError Bad arguments for option \'--featurecounts_feature_type\': \'$VIASH_PAR_FEATURECOUNTS_FEATURE_TYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FEATURECOUNTS_FEATURE_TYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --featurecounts_feature_type. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --featurecounts_feature_type=*)
            [ -n "$VIASH_PAR_FEATURECOUNTS_FEATURE_TYPE" ] && ViashError Bad arguments for option \'--featurecounts_feature_type=*\': \'$VIASH_PAR_FEATURECOUNTS_FEATURE_TYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FEATURECOUNTS_FEATURE_TYPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --star_sjdb_gtf_feature_exon)
            [ -n "$VIASH_PAR_STAR_SJDB_GTF_FEATURE_EXON" ] && ViashError Bad arguments for option \'--star_sjdb_gtf_feature_exon\': \'$VIASH_PAR_STAR_SJDB_GTF_FEATURE_EXON\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STAR_SJDB_GTF_FEATURE_EXON="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --star_sjdb_gtf_feature_exon. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --star_sjdb_gtf_feature_exon=*)
            [ -n "$VIASH_PAR_STAR_SJDB_GTF_FEATURE_EXON" ] && ViashError Bad arguments for option \'--star_sjdb_gtf_feature_exon=*\': \'$VIASH_PAR_STAR_SJDB_GTF_FEATURE_EXON\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STAR_SJDB_GTF_FEATURE_EXON=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --trimmer)
            [ -n "$VIASH_PAR_TRIMMER" ] && ViashError Bad arguments for option \'--trimmer\': \'$VIASH_PAR_TRIMMER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIMMER="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --trimmer. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --trimmer=*)
            [ -n "$VIASH_PAR_TRIMMER" ] && ViashError Bad arguments for option \'--trimmer=*\': \'$VIASH_PAR_TRIMMER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIMMER=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --min_trimmed_reads)
            [ -n "$VIASH_PAR_MIN_TRIMMED_READS" ] && ViashError Bad arguments for option \'--min_trimmed_reads\': \'$VIASH_PAR_MIN_TRIMMED_READS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MIN_TRIMMED_READS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --min_trimmed_reads. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --min_trimmed_reads=*)
            [ -n "$VIASH_PAR_MIN_TRIMMED_READS" ] && ViashError Bad arguments for option \'--min_trimmed_reads=*\': \'$VIASH_PAR_MIN_TRIMMED_READS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MIN_TRIMMED_READS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --bbsplit_fasta_list)
            if [ -z "$VIASH_PAR_BBSPLIT_FASTA_LIST" ]; then
              VIASH_PAR_BBSPLIT_FASTA_LIST="$2"
            else
              VIASH_PAR_BBSPLIT_FASTA_LIST="$VIASH_PAR_BBSPLIT_FASTA_LIST;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --bbsplit_fasta_list. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --bbsplit_fasta_list=*)
            if [ -z "$VIASH_PAR_BBSPLIT_FASTA_LIST" ]; then
              VIASH_PAR_BBSPLIT_FASTA_LIST=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_BBSPLIT_FASTA_LIST="$VIASH_PAR_BBSPLIT_FASTA_LIST;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --bbsplit_index)
            [ -n "$VIASH_PAR_BBSPLIT_INDEX" ] && ViashError Bad arguments for option \'--bbsplit_index\': \'$VIASH_PAR_BBSPLIT_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BBSPLIT_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --bbsplit_index. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --bbsplit_index=*)
            [ -n "$VIASH_PAR_BBSPLIT_INDEX" ] && ViashError Bad arguments for option \'--bbsplit_index=*\': \'$VIASH_PAR_BBSPLIT_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BBSPLIT_INDEX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --remove_ribo_rna)
            [ -n "$VIASH_PAR_REMOVE_RIBO_RNA" ] && ViashError Bad arguments for option \'--remove_ribo_rna\': \'$VIASH_PAR_REMOVE_RIBO_RNA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_REMOVE_RIBO_RNA=true
            shift 1
            ;;
        --ribo_database_manifest)
            [ -n "$VIASH_PAR_RIBO_DATABASE_MANIFEST" ] && ViashError Bad arguments for option \'--ribo_database_manifest\': \'$VIASH_PAR_RIBO_DATABASE_MANIFEST\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RIBO_DATABASE_MANIFEST="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --ribo_database_manifest. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --ribo_database_manifest=*)
            [ -n "$VIASH_PAR_RIBO_DATABASE_MANIFEST" ] && ViashError Bad arguments for option \'--ribo_database_manifest=*\': \'$VIASH_PAR_RIBO_DATABASE_MANIFEST\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RIBO_DATABASE_MANIFEST=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --with_umi)
            [ -n "$VIASH_PAR_WITH_UMI" ] && ViashError Bad arguments for option \'--with_umi\': \'$VIASH_PAR_WITH_UMI\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WITH_UMI=true
            shift 1
            ;;
        --umitools_extract_method)
            [ -n "$VIASH_PAR_UMITOOLS_EXTRACT_METHOD" ] && ViashError Bad arguments for option \'--umitools_extract_method\': \'$VIASH_PAR_UMITOOLS_EXTRACT_METHOD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMITOOLS_EXTRACT_METHOD="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --umitools_extract_method. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --umitools_extract_method=*)
            [ -n "$VIASH_PAR_UMITOOLS_EXTRACT_METHOD" ] && ViashError Bad arguments for option \'--umitools_extract_method=*\': \'$VIASH_PAR_UMITOOLS_EXTRACT_METHOD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMITOOLS_EXTRACT_METHOD=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --umitools_bc_pattern)
            [ -n "$VIASH_PAR_UMITOOLS_BC_PATTERN" ] && ViashError Bad arguments for option \'--umitools_bc_pattern\': \'$VIASH_PAR_UMITOOLS_BC_PATTERN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMITOOLS_BC_PATTERN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --umitools_bc_pattern. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --umitools_bc_pattern=*)
            [ -n "$VIASH_PAR_UMITOOLS_BC_PATTERN" ] && ViashError Bad arguments for option \'--umitools_bc_pattern=*\': \'$VIASH_PAR_UMITOOLS_BC_PATTERN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMITOOLS_BC_PATTERN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --umitools_bc_pattern2)
            [ -n "$VIASH_PAR_UMITOOLS_BC_PATTERN2" ] && ViashError Bad arguments for option \'--umitools_bc_pattern2\': \'$VIASH_PAR_UMITOOLS_BC_PATTERN2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMITOOLS_BC_PATTERN2="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --umitools_bc_pattern2. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --umitools_bc_pattern2=*)
            [ -n "$VIASH_PAR_UMITOOLS_BC_PATTERN2" ] && ViashError Bad arguments for option \'--umitools_bc_pattern2=*\': \'$VIASH_PAR_UMITOOLS_BC_PATTERN2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMITOOLS_BC_PATTERN2=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --umi_discard_read)
            [ -n "$VIASH_PAR_UMI_DISCARD_READ" ] && ViashError Bad arguments for option \'--umi_discard_read\': \'$VIASH_PAR_UMI_DISCARD_READ\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMI_DISCARD_READ="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --umi_discard_read. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --umi_discard_read=*)
            [ -n "$VIASH_PAR_UMI_DISCARD_READ" ] && ViashError Bad arguments for option \'--umi_discard_read=*\': \'$VIASH_PAR_UMI_DISCARD_READ\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMI_DISCARD_READ=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --umitools_umi_separator)
            [ -n "$VIASH_PAR_UMITOOLS_UMI_SEPARATOR" ] && ViashError Bad arguments for option \'--umitools_umi_separator\': \'$VIASH_PAR_UMITOOLS_UMI_SEPARATOR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMITOOLS_UMI_SEPARATOR="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --umitools_umi_separator. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --umitools_umi_separator=*)
            [ -n "$VIASH_PAR_UMITOOLS_UMI_SEPARATOR" ] && ViashError Bad arguments for option \'--umitools_umi_separator=*\': \'$VIASH_PAR_UMITOOLS_UMI_SEPARATOR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMITOOLS_UMI_SEPARATOR=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --umitools_grouping_method)
            [ -n "$VIASH_PAR_UMITOOLS_GROUPING_METHOD" ] && ViashError Bad arguments for option \'--umitools_grouping_method\': \'$VIASH_PAR_UMITOOLS_GROUPING_METHOD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMITOOLS_GROUPING_METHOD="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --umitools_grouping_method. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --umitools_grouping_method=*)
            [ -n "$VIASH_PAR_UMITOOLS_GROUPING_METHOD" ] && ViashError Bad arguments for option \'--umitools_grouping_method=*\': \'$VIASH_PAR_UMITOOLS_GROUPING_METHOD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMITOOLS_GROUPING_METHOD=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --umi_dedup_stats)
            [ -n "$VIASH_PAR_UMI_DEDUP_STATS" ] && ViashError Bad arguments for option \'--umi_dedup_stats\': \'$VIASH_PAR_UMI_DEDUP_STATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UMI_DEDUP_STATS=true
            shift 1
            ;;
        --aligner)
            [ -n "$VIASH_PAR_ALIGNER" ] && ViashError Bad arguments for option \'--aligner\': \'$VIASH_PAR_ALIGNER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNER="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --aligner. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --aligner=*)
            [ -n "$VIASH_PAR_ALIGNER" ] && ViashError Bad arguments for option \'--aligner=*\': \'$VIASH_PAR_ALIGNER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNER=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_aligner)
            [ -n "$VIASH_PAR_PSEUDO_ALIGNER" ] && ViashError Bad arguments for option \'--pseudo_aligner\': \'$VIASH_PAR_PSEUDO_ALIGNER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_ALIGNER="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_aligner. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_aligner=*)
            [ -n "$VIASH_PAR_PSEUDO_ALIGNER" ] && ViashError Bad arguments for option \'--pseudo_aligner=*\': \'$VIASH_PAR_PSEUDO_ALIGNER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_ALIGNER=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_aligner_kmer_size)
            [ -n "$VIASH_PAR_PSEUDO_ALIGNER_KMER_SIZE" ] && ViashError Bad arguments for option \'--pseudo_aligner_kmer_size\': \'$VIASH_PAR_PSEUDO_ALIGNER_KMER_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_ALIGNER_KMER_SIZE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_aligner_kmer_size. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_aligner_kmer_size=*)
            [ -n "$VIASH_PAR_PSEUDO_ALIGNER_KMER_SIZE" ] && ViashError Bad arguments for option \'--pseudo_aligner_kmer_size=*\': \'$VIASH_PAR_PSEUDO_ALIGNER_KMER_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_ALIGNER_KMER_SIZE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --kallisto_quant_fragment_length)
            [ -n "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH" ] && ViashError Bad arguments for option \'--kallisto_quant_fragment_length\': \'$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --kallisto_quant_fragment_length. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --kallisto_quant_fragment_length=*)
            [ -n "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH" ] && ViashError Bad arguments for option \'--kallisto_quant_fragment_length=*\': \'$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --kallisto_quant_fragment_length_sd)
            [ -n "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD" ] && ViashError Bad arguments for option \'--kallisto_quant_fragment_length_sd\': \'$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --kallisto_quant_fragment_length_sd. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --kallisto_quant_fragment_length_sd=*)
            [ -n "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD" ] && ViashError Bad arguments for option \'--kallisto_quant_fragment_length_sd=*\': \'$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --bam_csi_index)
            [ -n "$VIASH_PAR_BAM_CSI_INDEX" ] && ViashError Bad arguments for option \'--bam_csi_index\': \'$VIASH_PAR_BAM_CSI_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAM_CSI_INDEX=true
            shift 1
            ;;
        --salmon_quant_libtype)
            [ -n "$VIASH_PAR_SALMON_QUANT_LIBTYPE" ] && ViashError Bad arguments for option \'--salmon_quant_libtype\': \'$VIASH_PAR_SALMON_QUANT_LIBTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SALMON_QUANT_LIBTYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --salmon_quant_libtype. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --salmon_quant_libtype=*)
            [ -n "$VIASH_PAR_SALMON_QUANT_LIBTYPE" ] && ViashError Bad arguments for option \'--salmon_quant_libtype=*\': \'$VIASH_PAR_SALMON_QUANT_LIBTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SALMON_QUANT_LIBTYPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --min_mapped_reads)
            [ -n "$VIASH_PAR_MIN_MAPPED_READS" ] && ViashError Bad arguments for option \'--min_mapped_reads\': \'$VIASH_PAR_MIN_MAPPED_READS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MIN_MAPPED_READS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --min_mapped_reads. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --min_mapped_reads=*)
            [ -n "$VIASH_PAR_MIN_MAPPED_READS" ] && ViashError Bad arguments for option \'--min_mapped_reads=*\': \'$VIASH_PAR_MIN_MAPPED_READS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MIN_MAPPED_READS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --stringtie_ignore_gtf)
            [ -n "$VIASH_PAR_STRINGTIE_IGNORE_GTF" ] && ViashError Bad arguments for option \'--stringtie_ignore_gtf\': \'$VIASH_PAR_STRINGTIE_IGNORE_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRINGTIE_IGNORE_GTF=true
            shift 1
            ;;
        --extra_stringtie_args)
            [ -n "$VIASH_PAR_EXTRA_STRINGTIE_ARGS" ] && ViashError Bad arguments for option \'--extra_stringtie_args\': \'$VIASH_PAR_EXTRA_STRINGTIE_ARGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_EXTRA_STRINGTIE_ARGS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --extra_stringtie_args. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --extra_stringtie_args=*)
            [ -n "$VIASH_PAR_EXTRA_STRINGTIE_ARGS" ] && ViashError Bad arguments for option \'--extra_stringtie_args=*\': \'$VIASH_PAR_EXTRA_STRINGTIE_ARGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_EXTRA_STRINGTIE_ARGS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --save_unaligned)
            [ -n "$VIASH_PAR_SAVE_UNALIGNED" ] && ViashError Bad arguments for option \'--save_unaligned\': \'$VIASH_PAR_SAVE_UNALIGNED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SAVE_UNALIGNED=true
            shift 1
            ;;
        --save_align_intermeds)
            [ -n "$VIASH_PAR_SAVE_ALIGN_INTERMEDS" ] && ViashError Bad arguments for option \'--save_align_intermeds\': \'$VIASH_PAR_SAVE_ALIGN_INTERMEDS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SAVE_ALIGN_INTERMEDS=true
            shift 1
            ;;
        --skip_alignment)
            [ -n "$VIASH_PAR_SKIP_ALIGNMENT" ] && ViashError Bad arguments for option \'--skip_alignment\': \'$VIASH_PAR_SKIP_ALIGNMENT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_ALIGNMENT=true
            shift 1
            ;;
        --skip_pseudo_alignment)
            [ -n "$VIASH_PAR_SKIP_PSEUDO_ALIGNMENT" ] && ViashError Bad arguments for option \'--skip_pseudo_alignment\': \'$VIASH_PAR_SKIP_PSEUDO_ALIGNMENT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_PSEUDO_ALIGNMENT=true
            shift 1
            ;;
        --skip_fastqc)
            [ -n "$VIASH_PAR_SKIP_FASTQC" ] && ViashError Bad arguments for option \'--skip_fastqc\': \'$VIASH_PAR_SKIP_FASTQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_FASTQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --skip_fastqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --skip_fastqc=*)
            [ -n "$VIASH_PAR_SKIP_FASTQC" ] && ViashError Bad arguments for option \'--skip_fastqc=*\': \'$VIASH_PAR_SKIP_FASTQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_FASTQC=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --skip_trimming)
            [ -n "$VIASH_PAR_SKIP_TRIMMING" ] && ViashError Bad arguments for option \'--skip_trimming\': \'$VIASH_PAR_SKIP_TRIMMING\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_TRIMMING="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --skip_trimming. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --skip_trimming=*)
            [ -n "$VIASH_PAR_SKIP_TRIMMING" ] && ViashError Bad arguments for option \'--skip_trimming=*\': \'$VIASH_PAR_SKIP_TRIMMING\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_TRIMMING=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --skip_umi_extract)
            [ -n "$VIASH_PAR_SKIP_UMI_EXTRACT" ] && ViashError Bad arguments for option \'--skip_umi_extract\': \'$VIASH_PAR_SKIP_UMI_EXTRACT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_UMI_EXTRACT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --skip_umi_extract. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --skip_umi_extract=*)
            [ -n "$VIASH_PAR_SKIP_UMI_EXTRACT" ] && ViashError Bad arguments for option \'--skip_umi_extract=*\': \'$VIASH_PAR_SKIP_UMI_EXTRACT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_UMI_EXTRACT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --skip_qc)
            [ -n "$VIASH_PAR_SKIP_QC" ] && ViashError Bad arguments for option \'--skip_qc\': \'$VIASH_PAR_SKIP_QC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_QC=true
            shift 1
            ;;
        --skip_markduplicates)
            [ -n "$VIASH_PAR_SKIP_MARKDUPLICATES" ] && ViashError Bad arguments for option \'--skip_markduplicates\': \'$VIASH_PAR_SKIP_MARKDUPLICATES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_MARKDUPLICATES=true
            shift 1
            ;;
        --skip_stringtie)
            [ -n "$VIASH_PAR_SKIP_STRINGTIE" ] && ViashError Bad arguments for option \'--skip_stringtie\': \'$VIASH_PAR_SKIP_STRINGTIE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_STRINGTIE=true
            shift 1
            ;;
        --skip_biotype_qc)
            [ -n "$VIASH_PAR_SKIP_BIOTYPE_QC" ] && ViashError Bad arguments for option \'--skip_biotype_qc\': \'$VIASH_PAR_SKIP_BIOTYPE_QC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_BIOTYPE_QC=true
            shift 1
            ;;
        --skip_bigwig)
            [ -n "$VIASH_PAR_SKIP_BIGWIG" ] && ViashError Bad arguments for option \'--skip_bigwig\': \'$VIASH_PAR_SKIP_BIGWIG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_BIGWIG=true
            shift 1
            ;;
        --skip_preseq)
            [ -n "$VIASH_PAR_SKIP_PRESEQ" ] && ViashError Bad arguments for option \'--skip_preseq\': \'$VIASH_PAR_SKIP_PRESEQ\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_PRESEQ=true
            shift 1
            ;;
        --skip_dupradar)
            [ -n "$VIASH_PAR_SKIP_DUPRADAR" ] && ViashError Bad arguments for option \'--skip_dupradar\': \'$VIASH_PAR_SKIP_DUPRADAR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_DUPRADAR=true
            shift 1
            ;;
        --skip_qualimap)
            [ -n "$VIASH_PAR_SKIP_QUALIMAP" ] && ViashError Bad arguments for option \'--skip_qualimap\': \'$VIASH_PAR_SKIP_QUALIMAP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_QUALIMAP=true
            shift 1
            ;;
        --skip_rseqc)
            [ -n "$VIASH_PAR_SKIP_RSEQC" ] && ViashError Bad arguments for option \'--skip_rseqc\': \'$VIASH_PAR_SKIP_RSEQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_RSEQC=true
            shift 1
            ;;
        --skip_multiqc)
            [ -n "$VIASH_PAR_SKIP_MULTIQC" ] && ViashError Bad arguments for option \'--skip_multiqc\': \'$VIASH_PAR_SKIP_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_MULTIQC=true
            shift 1
            ;;
        --extra_picard_args)
            [ -n "$VIASH_PAR_EXTRA_PICARD_ARGS" ] && ViashError Bad arguments for option \'--extra_picard_args\': \'$VIASH_PAR_EXTRA_PICARD_ARGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_EXTRA_PICARD_ARGS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --extra_picard_args. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --extra_picard_args=*)
            [ -n "$VIASH_PAR_EXTRA_PICARD_ARGS" ] && ViashError Bad arguments for option \'--extra_picard_args=*\': \'$VIASH_PAR_EXTRA_PICARD_ARGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_EXTRA_PICARD_ARGS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --extra_preseq_args)
            [ -n "$VIASH_PAR_EXTRA_PRESEQ_ARGS" ] && ViashError Bad arguments for option \'--extra_preseq_args\': \'$VIASH_PAR_EXTRA_PRESEQ_ARGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_EXTRA_PRESEQ_ARGS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --extra_preseq_args. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --extra_preseq_args=*)
            [ -n "$VIASH_PAR_EXTRA_PRESEQ_ARGS" ] && ViashError Bad arguments for option \'--extra_preseq_args=*\': \'$VIASH_PAR_EXTRA_PRESEQ_ARGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_EXTRA_PRESEQ_ARGS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --deseq2_vst)
            [ -n "$VIASH_PAR_DESEQ2_VST" ] && ViashError Bad arguments for option \'--deseq2_vst\': \'$VIASH_PAR_DESEQ2_VST\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DESEQ2_VST="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --deseq2_vst. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --deseq2_vst=*)
            [ -n "$VIASH_PAR_DESEQ2_VST" ] && ViashError Bad arguments for option \'--deseq2_vst=*\': \'$VIASH_PAR_DESEQ2_VST\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DESEQ2_VST=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --rseqc_modules)
            if [ -z "$VIASH_PAR_RSEQC_MODULES" ]; then
              VIASH_PAR_RSEQC_MODULES="$2"
            else
              VIASH_PAR_RSEQC_MODULES="$VIASH_PAR_RSEQC_MODULES;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --rseqc_modules. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --rseqc_modules=*)
            if [ -z "$VIASH_PAR_RSEQC_MODULES" ]; then
              VIASH_PAR_RSEQC_MODULES=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_RSEQC_MODULES="$VIASH_PAR_RSEQC_MODULES;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --multiqc_custom_config)
            [ -n "$VIASH_PAR_MULTIQC_CUSTOM_CONFIG" ] && ViashError Bad arguments for option \'--multiqc_custom_config\': \'$VIASH_PAR_MULTIQC_CUSTOM_CONFIG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_CUSTOM_CONFIG="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --multiqc_custom_config. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --multiqc_custom_config=*)
            [ -n "$VIASH_PAR_MULTIQC_CUSTOM_CONFIG" ] && ViashError Bad arguments for option \'--multiqc_custom_config=*\': \'$VIASH_PAR_MULTIQC_CUSTOM_CONFIG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_CUSTOM_CONFIG=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --multiqc_title)
            [ -n "$VIASH_PAR_MULTIQC_TITLE" ] && ViashError Bad arguments for option \'--multiqc_title\': \'$VIASH_PAR_MULTIQC_TITLE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_TITLE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --multiqc_title. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --multiqc_title=*)
            [ -n "$VIASH_PAR_MULTIQC_TITLE" ] && ViashError Bad arguments for option \'--multiqc_title=*\': \'$VIASH_PAR_MULTIQC_TITLE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_TITLE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --multiqc_methods_description)
            [ -n "$VIASH_PAR_MULTIQC_METHODS_DESCRIPTION" ] && ViashError Bad arguments for option \'--multiqc_methods_description\': \'$VIASH_PAR_MULTIQC_METHODS_DESCRIPTION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_METHODS_DESCRIPTION="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --multiqc_methods_description. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --multiqc_methods_description=*)
            [ -n "$VIASH_PAR_MULTIQC_METHODS_DESCRIPTION" ] && ViashError Bad arguments for option \'--multiqc_methods_description=*\': \'$VIASH_PAR_MULTIQC_METHODS_DESCRIPTION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_METHODS_DESCRIPTION=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --output_fasta)
            [ -n "$VIASH_PAR_OUTPUT_FASTA" ] && ViashError Bad arguments for option \'--output_fasta\': \'$VIASH_PAR_OUTPUT_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_FASTA="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --output_fasta. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --output_fasta=*)
            [ -n "$VIASH_PAR_OUTPUT_FASTA" ] && ViashError Bad arguments for option \'--output_fasta=*\': \'$VIASH_PAR_OUTPUT_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_FASTA=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --output_gtf)
            [ -n "$VIASH_PAR_OUTPUT_GTF" ] && ViashError Bad arguments for option \'--output_gtf\': \'$VIASH_PAR_OUTPUT_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_GTF="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --output_gtf. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --output_gtf=*)
            [ -n "$VIASH_PAR_OUTPUT_GTF" ] && ViashError Bad arguments for option \'--output_gtf=*\': \'$VIASH_PAR_OUTPUT_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_GTF=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --output_transcript_fasta)
            [ -n "$VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA" ] && ViashError Bad arguments for option \'--output_transcript_fasta\': \'$VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --output_transcript_fasta. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --output_transcript_fasta=*)
            [ -n "$VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA" ] && ViashError Bad arguments for option \'--output_transcript_fasta=*\': \'$VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --output_gene_bed)
            [ -n "$VIASH_PAR_OUTPUT_GENE_BED" ] && ViashError Bad arguments for option \'--output_gene_bed\': \'$VIASH_PAR_OUTPUT_GENE_BED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_GENE_BED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --output_gene_bed. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --output_gene_bed=*)
            [ -n "$VIASH_PAR_OUTPUT_GENE_BED" ] && ViashError Bad arguments for option \'--output_gene_bed=*\': \'$VIASH_PAR_OUTPUT_GENE_BED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_GENE_BED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --output_star_index)
            [ -n "$VIASH_PAR_OUTPUT_STAR_INDEX" ] && ViashError Bad arguments for option \'--output_star_index\': \'$VIASH_PAR_OUTPUT_STAR_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_STAR_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --output_star_index. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --output_star_index=*)
            [ -n "$VIASH_PAR_OUTPUT_STAR_INDEX" ] && ViashError Bad arguments for option \'--output_star_index=*\': \'$VIASH_PAR_OUTPUT_STAR_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_STAR_INDEX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --output_salmon_index)
            [ -n "$VIASH_PAR_OUTPUT_SALMON_INDEX" ] && ViashError Bad arguments for option \'--output_salmon_index\': \'$VIASH_PAR_OUTPUT_SALMON_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_SALMON_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --output_salmon_index. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --output_salmon_index=*)
            [ -n "$VIASH_PAR_OUTPUT_SALMON_INDEX" ] && ViashError Bad arguments for option \'--output_salmon_index=*\': \'$VIASH_PAR_OUTPUT_SALMON_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_SALMON_INDEX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --output_bbsplit_index)
            [ -n "$VIASH_PAR_OUTPUT_BBSPLIT_INDEX" ] && ViashError Bad arguments for option \'--output_bbsplit_index\': \'$VIASH_PAR_OUTPUT_BBSPLIT_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_BBSPLIT_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --output_bbsplit_index. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --output_bbsplit_index=*)
            [ -n "$VIASH_PAR_OUTPUT_BBSPLIT_INDEX" ] && ViashError Bad arguments for option \'--output_bbsplit_index=*\': \'$VIASH_PAR_OUTPUT_BBSPLIT_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_BBSPLIT_INDEX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --output_kallisto_index)
            [ -n "$VIASH_PAR_OUTPUT_KALLISTO_INDEX" ] && ViashError Bad arguments for option \'--output_kallisto_index\': \'$VIASH_PAR_OUTPUT_KALLISTO_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_KALLISTO_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --output_kallisto_index. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --output_kallisto_index=*)
            [ -n "$VIASH_PAR_OUTPUT_KALLISTO_INDEX" ] && ViashError Bad arguments for option \'--output_kallisto_index=*\': \'$VIASH_PAR_OUTPUT_KALLISTO_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_KALLISTO_INDEX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --output_fastq_1)
            [ -n "$VIASH_PAR_OUTPUT_FASTQ_1" ] && ViashError Bad arguments for option \'--output_fastq_1\': \'$VIASH_PAR_OUTPUT_FASTQ_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_FASTQ_1="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --output_fastq_1. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --output_fastq_1=*)
            [ -n "$VIASH_PAR_OUTPUT_FASTQ_1" ] && ViashError Bad arguments for option \'--output_fastq_1=*\': \'$VIASH_PAR_OUTPUT_FASTQ_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_FASTQ_1=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --output_fastq_2)
            [ -n "$VIASH_PAR_OUTPUT_FASTQ_2" ] && ViashError Bad arguments for option \'--output_fastq_2\': \'$VIASH_PAR_OUTPUT_FASTQ_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_FASTQ_2="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --output_fastq_2. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --output_fastq_2=*)
            [ -n "$VIASH_PAR_OUTPUT_FASTQ_2" ] && ViashError Bad arguments for option \'--output_fastq_2=*\': \'$VIASH_PAR_OUTPUT_FASTQ_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_FASTQ_2=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --fastqc_html_1)
            [ -n "$VIASH_PAR_FASTQC_HTML_1" ] && ViashError Bad arguments for option \'--fastqc_html_1\': \'$VIASH_PAR_FASTQC_HTML_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTQC_HTML_1="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --fastqc_html_1. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --fastqc_html_1=*)
            [ -n "$VIASH_PAR_FASTQC_HTML_1" ] && ViashError Bad arguments for option \'--fastqc_html_1=*\': \'$VIASH_PAR_FASTQC_HTML_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTQC_HTML_1=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --fastqc_html_2)
            [ -n "$VIASH_PAR_FASTQC_HTML_2" ] && ViashError Bad arguments for option \'--fastqc_html_2\': \'$VIASH_PAR_FASTQC_HTML_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTQC_HTML_2="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --fastqc_html_2. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --fastqc_html_2=*)
            [ -n "$VIASH_PAR_FASTQC_HTML_2" ] && ViashError Bad arguments for option \'--fastqc_html_2=*\': \'$VIASH_PAR_FASTQC_HTML_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTQC_HTML_2=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --fastqc_zip_1)
            [ -n "$VIASH_PAR_FASTQC_ZIP_1" ] && ViashError Bad arguments for option \'--fastqc_zip_1\': \'$VIASH_PAR_FASTQC_ZIP_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTQC_ZIP_1="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --fastqc_zip_1. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --fastqc_zip_1=*)
            [ -n "$VIASH_PAR_FASTQC_ZIP_1" ] && ViashError Bad arguments for option \'--fastqc_zip_1=*\': \'$VIASH_PAR_FASTQC_ZIP_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTQC_ZIP_1=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --fastqc_zip_2)
            [ -n "$VIASH_PAR_FASTQC_ZIP_2" ] && ViashError Bad arguments for option \'--fastqc_zip_2\': \'$VIASH_PAR_FASTQC_ZIP_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTQC_ZIP_2="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --fastqc_zip_2. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --fastqc_zip_2=*)
            [ -n "$VIASH_PAR_FASTQC_ZIP_2" ] && ViashError Bad arguments for option \'--fastqc_zip_2=*\': \'$VIASH_PAR_FASTQC_ZIP_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTQC_ZIP_2=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --trim_html_1)
            [ -n "$VIASH_PAR_TRIM_HTML_1" ] && ViashError Bad arguments for option \'--trim_html_1\': \'$VIASH_PAR_TRIM_HTML_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIM_HTML_1="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --trim_html_1. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --trim_html_1=*)
            [ -n "$VIASH_PAR_TRIM_HTML_1" ] && ViashError Bad arguments for option \'--trim_html_1=*\': \'$VIASH_PAR_TRIM_HTML_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIM_HTML_1=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --trim_html_2)
            [ -n "$VIASH_PAR_TRIM_HTML_2" ] && ViashError Bad arguments for option \'--trim_html_2\': \'$VIASH_PAR_TRIM_HTML_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIM_HTML_2="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --trim_html_2. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --trim_html_2=*)
            [ -n "$VIASH_PAR_TRIM_HTML_2" ] && ViashError Bad arguments for option \'--trim_html_2=*\': \'$VIASH_PAR_TRIM_HTML_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIM_HTML_2=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --trim_zip_1)
            [ -n "$VIASH_PAR_TRIM_ZIP_1" ] && ViashError Bad arguments for option \'--trim_zip_1\': \'$VIASH_PAR_TRIM_ZIP_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIM_ZIP_1="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --trim_zip_1. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --trim_zip_1=*)
            [ -n "$VIASH_PAR_TRIM_ZIP_1" ] && ViashError Bad arguments for option \'--trim_zip_1=*\': \'$VIASH_PAR_TRIM_ZIP_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIM_ZIP_1=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --trim_zip_2)
            [ -n "$VIASH_PAR_TRIM_ZIP_2" ] && ViashError Bad arguments for option \'--trim_zip_2\': \'$VIASH_PAR_TRIM_ZIP_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIM_ZIP_2="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --trim_zip_2. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --trim_zip_2=*)
            [ -n "$VIASH_PAR_TRIM_ZIP_2" ] && ViashError Bad arguments for option \'--trim_zip_2=*\': \'$VIASH_PAR_TRIM_ZIP_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIM_ZIP_2=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --trim_log_1)
            [ -n "$VIASH_PAR_TRIM_LOG_1" ] && ViashError Bad arguments for option \'--trim_log_1\': \'$VIASH_PAR_TRIM_LOG_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIM_LOG_1="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --trim_log_1. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --trim_log_1=*)
            [ -n "$VIASH_PAR_TRIM_LOG_1" ] && ViashError Bad arguments for option \'--trim_log_1=*\': \'$VIASH_PAR_TRIM_LOG_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIM_LOG_1=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --trim_log_2)
            [ -n "$VIASH_PAR_TRIM_LOG_2" ] && ViashError Bad arguments for option \'--trim_log_2\': \'$VIASH_PAR_TRIM_LOG_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIM_LOG_2="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --trim_log_2. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --trim_log_2=*)
            [ -n "$VIASH_PAR_TRIM_LOG_2" ] && ViashError Bad arguments for option \'--trim_log_2=*\': \'$VIASH_PAR_TRIM_LOG_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRIM_LOG_2=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --fastp_trim_json)
            [ -n "$VIASH_PAR_FASTP_TRIM_JSON" ] && ViashError Bad arguments for option \'--fastp_trim_json\': \'$VIASH_PAR_FASTP_TRIM_JSON\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTP_TRIM_JSON="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --fastp_trim_json. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --fastp_trim_json=*)
            [ -n "$VIASH_PAR_FASTP_TRIM_JSON" ] && ViashError Bad arguments for option \'--fastp_trim_json=*\': \'$VIASH_PAR_FASTP_TRIM_JSON\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTP_TRIM_JSON=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --fastp_trim_html)
            [ -n "$VIASH_PAR_FASTP_TRIM_HTML" ] && ViashError Bad arguments for option \'--fastp_trim_html\': \'$VIASH_PAR_FASTP_TRIM_HTML\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTP_TRIM_HTML="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --fastp_trim_html. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --fastp_trim_html=*)
            [ -n "$VIASH_PAR_FASTP_TRIM_HTML" ] && ViashError Bad arguments for option \'--fastp_trim_html=*\': \'$VIASH_PAR_FASTP_TRIM_HTML\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FASTP_TRIM_HTML=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sortmerna_log)
            [ -n "$VIASH_PAR_SORTMERNA_LOG" ] && ViashError Bad arguments for option \'--sortmerna_log\': \'$VIASH_PAR_SORTMERNA_LOG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SORTMERNA_LOG="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sortmerna_log. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sortmerna_log=*)
            [ -n "$VIASH_PAR_SORTMERNA_LOG" ] && ViashError Bad arguments for option \'--sortmerna_log=*\': \'$VIASH_PAR_SORTMERNA_LOG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SORTMERNA_LOG=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --star_alignment)
            [ -n "$VIASH_PAR_STAR_ALIGNMENT" ] && ViashError Bad arguments for option \'--star_alignment\': \'$VIASH_PAR_STAR_ALIGNMENT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STAR_ALIGNMENT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --star_alignment. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --star_alignment=*)
            [ -n "$VIASH_PAR_STAR_ALIGNMENT" ] && ViashError Bad arguments for option \'--star_alignment=*\': \'$VIASH_PAR_STAR_ALIGNMENT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STAR_ALIGNMENT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --genome_bam_sorted)
            [ -n "$VIASH_PAR_GENOME_BAM_SORTED" ] && ViashError Bad arguments for option \'--genome_bam_sorted\': \'$VIASH_PAR_GENOME_BAM_SORTED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENOME_BAM_SORTED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --genome_bam_sorted. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --genome_bam_sorted=*)
            [ -n "$VIASH_PAR_GENOME_BAM_SORTED" ] && ViashError Bad arguments for option \'--genome_bam_sorted=*\': \'$VIASH_PAR_GENOME_BAM_SORTED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENOME_BAM_SORTED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --genome_bam_index)
            [ -n "$VIASH_PAR_GENOME_BAM_INDEX" ] && ViashError Bad arguments for option \'--genome_bam_index\': \'$VIASH_PAR_GENOME_BAM_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENOME_BAM_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --genome_bam_index. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --genome_bam_index=*)
            [ -n "$VIASH_PAR_GENOME_BAM_INDEX" ] && ViashError Bad arguments for option \'--genome_bam_index=*\': \'$VIASH_PAR_GENOME_BAM_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENOME_BAM_INDEX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --transcriptome_bam)
            [ -n "$VIASH_PAR_TRANSCRIPTOME_BAM" ] && ViashError Bad arguments for option \'--transcriptome_bam\': \'$VIASH_PAR_TRANSCRIPTOME_BAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRANSCRIPTOME_BAM="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --transcriptome_bam. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --transcriptome_bam=*)
            [ -n "$VIASH_PAR_TRANSCRIPTOME_BAM" ] && ViashError Bad arguments for option \'--transcriptome_bam=*\': \'$VIASH_PAR_TRANSCRIPTOME_BAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRANSCRIPTOME_BAM=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --transcriptome_bam_index)
            [ -n "$VIASH_PAR_TRANSCRIPTOME_BAM_INDEX" ] && ViashError Bad arguments for option \'--transcriptome_bam_index\': \'$VIASH_PAR_TRANSCRIPTOME_BAM_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRANSCRIPTOME_BAM_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --transcriptome_bam_index. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --transcriptome_bam_index=*)
            [ -n "$VIASH_PAR_TRANSCRIPTOME_BAM_INDEX" ] && ViashError Bad arguments for option \'--transcriptome_bam_index=*\': \'$VIASH_PAR_TRANSCRIPTOME_BAM_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRANSCRIPTOME_BAM_INDEX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --star_log)
            [ -n "$VIASH_PAR_STAR_LOG" ] && ViashError Bad arguments for option \'--star_log\': \'$VIASH_PAR_STAR_LOG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STAR_LOG="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --star_log. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --star_log=*)
            [ -n "$VIASH_PAR_STAR_LOG" ] && ViashError Bad arguments for option \'--star_log=*\': \'$VIASH_PAR_STAR_LOG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STAR_LOG=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --genome_bam_stats)
            [ -n "$VIASH_PAR_GENOME_BAM_STATS" ] && ViashError Bad arguments for option \'--genome_bam_stats\': \'$VIASH_PAR_GENOME_BAM_STATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENOME_BAM_STATS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --genome_bam_stats. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --genome_bam_stats=*)
            [ -n "$VIASH_PAR_GENOME_BAM_STATS" ] && ViashError Bad arguments for option \'--genome_bam_stats=*\': \'$VIASH_PAR_GENOME_BAM_STATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENOME_BAM_STATS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --genome_bam_flagstat)
            [ -n "$VIASH_PAR_GENOME_BAM_FLAGSTAT" ] && ViashError Bad arguments for option \'--genome_bam_flagstat\': \'$VIASH_PAR_GENOME_BAM_FLAGSTAT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENOME_BAM_FLAGSTAT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --genome_bam_flagstat. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --genome_bam_flagstat=*)
            [ -n "$VIASH_PAR_GENOME_BAM_FLAGSTAT" ] && ViashError Bad arguments for option \'--genome_bam_flagstat=*\': \'$VIASH_PAR_GENOME_BAM_FLAGSTAT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENOME_BAM_FLAGSTAT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --genome_bam_idxstats)
            [ -n "$VIASH_PAR_GENOME_BAM_IDXSTATS" ] && ViashError Bad arguments for option \'--genome_bam_idxstats\': \'$VIASH_PAR_GENOME_BAM_IDXSTATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENOME_BAM_IDXSTATS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --genome_bam_idxstats. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --genome_bam_idxstats=*)
            [ -n "$VIASH_PAR_GENOME_BAM_IDXSTATS" ] && ViashError Bad arguments for option \'--genome_bam_idxstats=*\': \'$VIASH_PAR_GENOME_BAM_IDXSTATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENOME_BAM_IDXSTATS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --transcriptome_bam_stats)
            [ -n "$VIASH_PAR_TRANSCRIPTOME_BAM_STATS" ] && ViashError Bad arguments for option \'--transcriptome_bam_stats\': \'$VIASH_PAR_TRANSCRIPTOME_BAM_STATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRANSCRIPTOME_BAM_STATS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --transcriptome_bam_stats. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --transcriptome_bam_stats=*)
            [ -n "$VIASH_PAR_TRANSCRIPTOME_BAM_STATS" ] && ViashError Bad arguments for option \'--transcriptome_bam_stats=*\': \'$VIASH_PAR_TRANSCRIPTOME_BAM_STATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRANSCRIPTOME_BAM_STATS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --transcriptome_bam_flagstat)
            [ -n "$VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT" ] && ViashError Bad arguments for option \'--transcriptome_bam_flagstat\': \'$VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --transcriptome_bam_flagstat. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --transcriptome_bam_flagstat=*)
            [ -n "$VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT" ] && ViashError Bad arguments for option \'--transcriptome_bam_flagstat=*\': \'$VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --transcriptome_bam_idxstats)
            [ -n "$VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS" ] && ViashError Bad arguments for option \'--transcriptome_bam_idxstats\': \'$VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --transcriptome_bam_idxstats. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --transcriptome_bam_idxstats=*)
            [ -n "$VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS" ] && ViashError Bad arguments for option \'--transcriptome_bam_idxstats=*\': \'$VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --salmon_quant_results)
            [ -n "$VIASH_PAR_SALMON_QUANT_RESULTS" ] && ViashError Bad arguments for option \'--salmon_quant_results\': \'$VIASH_PAR_SALMON_QUANT_RESULTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SALMON_QUANT_RESULTS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --salmon_quant_results. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --salmon_quant_results=*)
            [ -n "$VIASH_PAR_SALMON_QUANT_RESULTS" ] && ViashError Bad arguments for option \'--salmon_quant_results=*\': \'$VIASH_PAR_SALMON_QUANT_RESULTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SALMON_QUANT_RESULTS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --salmon_quant_results_file)
            [ -n "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE" ] && ViashError Bad arguments for option \'--salmon_quant_results_file\': \'$VIASH_PAR_SALMON_QUANT_RESULTS_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SALMON_QUANT_RESULTS_FILE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --salmon_quant_results_file. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --salmon_quant_results_file=*)
            [ -n "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE" ] && ViashError Bad arguments for option \'--salmon_quant_results_file=*\': \'$VIASH_PAR_SALMON_QUANT_RESULTS_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SALMON_QUANT_RESULTS_FILE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_quant_results)
            [ -n "$VIASH_PAR_PSEUDO_QUANT_RESULTS" ] && ViashError Bad arguments for option \'--pseudo_quant_results\': \'$VIASH_PAR_PSEUDO_QUANT_RESULTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_QUANT_RESULTS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_quant_results. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_quant_results=*)
            [ -n "$VIASH_PAR_PSEUDO_QUANT_RESULTS" ] && ViashError Bad arguments for option \'--pseudo_quant_results=*\': \'$VIASH_PAR_PSEUDO_QUANT_RESULTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_QUANT_RESULTS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --rsem_counts_gene)
            [ -n "$VIASH_PAR_RSEM_COUNTS_GENE" ] && ViashError Bad arguments for option \'--rsem_counts_gene\': \'$VIASH_PAR_RSEM_COUNTS_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RSEM_COUNTS_GENE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --rsem_counts_gene. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --rsem_counts_gene=*)
            [ -n "$VIASH_PAR_RSEM_COUNTS_GENE" ] && ViashError Bad arguments for option \'--rsem_counts_gene=*\': \'$VIASH_PAR_RSEM_COUNTS_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RSEM_COUNTS_GENE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --rsem_counts_transcripts)
            [ -n "$VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS" ] && ViashError Bad arguments for option \'--rsem_counts_transcripts\': \'$VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --rsem_counts_transcripts. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --rsem_counts_transcripts=*)
            [ -n "$VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS" ] && ViashError Bad arguments for option \'--rsem_counts_transcripts=*\': \'$VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --bam_star_rsem)
            [ -n "$VIASH_PAR_BAM_STAR_RSEM" ] && ViashError Bad arguments for option \'--bam_star_rsem\': \'$VIASH_PAR_BAM_STAR_RSEM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAM_STAR_RSEM="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --bam_star_rsem. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --bam_star_rsem=*)
            [ -n "$VIASH_PAR_BAM_STAR_RSEM" ] && ViashError Bad arguments for option \'--bam_star_rsem=*\': \'$VIASH_PAR_BAM_STAR_RSEM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAM_STAR_RSEM=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --bam_genome_rsem)
            [ -n "$VIASH_PAR_BAM_GENOME_RSEM" ] && ViashError Bad arguments for option \'--bam_genome_rsem\': \'$VIASH_PAR_BAM_GENOME_RSEM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAM_GENOME_RSEM="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --bam_genome_rsem. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --bam_genome_rsem=*)
            [ -n "$VIASH_PAR_BAM_GENOME_RSEM" ] && ViashError Bad arguments for option \'--bam_genome_rsem=*\': \'$VIASH_PAR_BAM_GENOME_RSEM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAM_GENOME_RSEM=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --bam_transcript_rsem)
            [ -n "$VIASH_PAR_BAM_TRANSCRIPT_RSEM" ] && ViashError Bad arguments for option \'--bam_transcript_rsem\': \'$VIASH_PAR_BAM_TRANSCRIPT_RSEM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAM_TRANSCRIPT_RSEM="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --bam_transcript_rsem. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --bam_transcript_rsem=*)
            [ -n "$VIASH_PAR_BAM_TRANSCRIPT_RSEM" ] && ViashError Bad arguments for option \'--bam_transcript_rsem=*\': \'$VIASH_PAR_BAM_TRANSCRIPT_RSEM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAM_TRANSCRIPT_RSEM=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --tpm_gene)
            [ -n "$VIASH_PAR_TPM_GENE" ] && ViashError Bad arguments for option \'--tpm_gene\': \'$VIASH_PAR_TPM_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TPM_GENE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --tpm_gene. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --tpm_gene=*)
            [ -n "$VIASH_PAR_TPM_GENE" ] && ViashError Bad arguments for option \'--tpm_gene=*\': \'$VIASH_PAR_TPM_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TPM_GENE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --counts_gene)
            [ -n "$VIASH_PAR_COUNTS_GENE" ] && ViashError Bad arguments for option \'--counts_gene\': \'$VIASH_PAR_COUNTS_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_COUNTS_GENE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --counts_gene. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --counts_gene=*)
            [ -n "$VIASH_PAR_COUNTS_GENE" ] && ViashError Bad arguments for option \'--counts_gene=*\': \'$VIASH_PAR_COUNTS_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_COUNTS_GENE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --counts_gene_length_scaled)
            [ -n "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED" ] && ViashError Bad arguments for option \'--counts_gene_length_scaled\': \'$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_COUNTS_GENE_LENGTH_SCALED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --counts_gene_length_scaled. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --counts_gene_length_scaled=*)
            [ -n "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED" ] && ViashError Bad arguments for option \'--counts_gene_length_scaled=*\': \'$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_COUNTS_GENE_LENGTH_SCALED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --counts_gene_scaled)
            [ -n "$VIASH_PAR_COUNTS_GENE_SCALED" ] && ViashError Bad arguments for option \'--counts_gene_scaled\': \'$VIASH_PAR_COUNTS_GENE_SCALED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_COUNTS_GENE_SCALED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --counts_gene_scaled. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --counts_gene_scaled=*)
            [ -n "$VIASH_PAR_COUNTS_GENE_SCALED" ] && ViashError Bad arguments for option \'--counts_gene_scaled=*\': \'$VIASH_PAR_COUNTS_GENE_SCALED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_COUNTS_GENE_SCALED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --tpm_transcript)
            [ -n "$VIASH_PAR_TPM_TRANSCRIPT" ] && ViashError Bad arguments for option \'--tpm_transcript\': \'$VIASH_PAR_TPM_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TPM_TRANSCRIPT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --tpm_transcript. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --tpm_transcript=*)
            [ -n "$VIASH_PAR_TPM_TRANSCRIPT" ] && ViashError Bad arguments for option \'--tpm_transcript=*\': \'$VIASH_PAR_TPM_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TPM_TRANSCRIPT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --counts_transcript)
            [ -n "$VIASH_PAR_COUNTS_TRANSCRIPT" ] && ViashError Bad arguments for option \'--counts_transcript\': \'$VIASH_PAR_COUNTS_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_COUNTS_TRANSCRIPT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --counts_transcript. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --counts_transcript=*)
            [ -n "$VIASH_PAR_COUNTS_TRANSCRIPT" ] && ViashError Bad arguments for option \'--counts_transcript=*\': \'$VIASH_PAR_COUNTS_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_COUNTS_TRANSCRIPT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --quant_merged_summarizedexperiment)
            [ -n "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ] && ViashError Bad arguments for option \'--quant_merged_summarizedexperiment\': \'$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --quant_merged_summarizedexperiment. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --quant_merged_summarizedexperiment=*)
            [ -n "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ] && ViashError Bad arguments for option \'--quant_merged_summarizedexperiment=*\': \'$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --markduplicates_metrics)
            [ -n "$VIASH_PAR_MARKDUPLICATES_METRICS" ] && ViashError Bad arguments for option \'--markduplicates_metrics\': \'$VIASH_PAR_MARKDUPLICATES_METRICS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MARKDUPLICATES_METRICS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --markduplicates_metrics. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --markduplicates_metrics=*)
            [ -n "$VIASH_PAR_MARKDUPLICATES_METRICS" ] && ViashError Bad arguments for option \'--markduplicates_metrics=*\': \'$VIASH_PAR_MARKDUPLICATES_METRICS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MARKDUPLICATES_METRICS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --stringtie_transcript_gtf)
            [ -n "$VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF" ] && ViashError Bad arguments for option \'--stringtie_transcript_gtf\': \'$VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --stringtie_transcript_gtf. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --stringtie_transcript_gtf=*)
            [ -n "$VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF" ] && ViashError Bad arguments for option \'--stringtie_transcript_gtf=*\': \'$VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --stringtie_coverage_gtf)
            [ -n "$VIASH_PAR_STRINGTIE_COVERAGE_GTF" ] && ViashError Bad arguments for option \'--stringtie_coverage_gtf\': \'$VIASH_PAR_STRINGTIE_COVERAGE_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRINGTIE_COVERAGE_GTF="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --stringtie_coverage_gtf. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --stringtie_coverage_gtf=*)
            [ -n "$VIASH_PAR_STRINGTIE_COVERAGE_GTF" ] && ViashError Bad arguments for option \'--stringtie_coverage_gtf=*\': \'$VIASH_PAR_STRINGTIE_COVERAGE_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRINGTIE_COVERAGE_GTF=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --stringtie_abundance)
            [ -n "$VIASH_PAR_STRINGTIE_ABUNDANCE" ] && ViashError Bad arguments for option \'--stringtie_abundance\': \'$VIASH_PAR_STRINGTIE_ABUNDANCE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRINGTIE_ABUNDANCE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --stringtie_abundance. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --stringtie_abundance=*)
            [ -n "$VIASH_PAR_STRINGTIE_ABUNDANCE" ] && ViashError Bad arguments for option \'--stringtie_abundance=*\': \'$VIASH_PAR_STRINGTIE_ABUNDANCE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRINGTIE_ABUNDANCE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --stringtie_ballgown)
            [ -n "$VIASH_PAR_STRINGTIE_BALLGOWN" ] && ViashError Bad arguments for option \'--stringtie_ballgown\': \'$VIASH_PAR_STRINGTIE_BALLGOWN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRINGTIE_BALLGOWN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --stringtie_ballgown. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --stringtie_ballgown=*)
            [ -n "$VIASH_PAR_STRINGTIE_BALLGOWN" ] && ViashError Bad arguments for option \'--stringtie_ballgown=*\': \'$VIASH_PAR_STRINGTIE_BALLGOWN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRINGTIE_BALLGOWN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --featurecounts)
            [ -n "$VIASH_PAR_FEATURECOUNTS" ] && ViashError Bad arguments for option \'--featurecounts\': \'$VIASH_PAR_FEATURECOUNTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FEATURECOUNTS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --featurecounts. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --featurecounts=*)
            [ -n "$VIASH_PAR_FEATURECOUNTS" ] && ViashError Bad arguments for option \'--featurecounts=*\': \'$VIASH_PAR_FEATURECOUNTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FEATURECOUNTS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --featurecounts_summary)
            [ -n "$VIASH_PAR_FEATURECOUNTS_SUMMARY" ] && ViashError Bad arguments for option \'--featurecounts_summary\': \'$VIASH_PAR_FEATURECOUNTS_SUMMARY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FEATURECOUNTS_SUMMARY="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --featurecounts_summary. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --featurecounts_summary=*)
            [ -n "$VIASH_PAR_FEATURECOUNTS_SUMMARY" ] && ViashError Bad arguments for option \'--featurecounts_summary=*\': \'$VIASH_PAR_FEATURECOUNTS_SUMMARY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FEATURECOUNTS_SUMMARY=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --featurecounts_multiqc)
            [ -n "$VIASH_PAR_FEATURECOUNTS_MULTIQC" ] && ViashError Bad arguments for option \'--featurecounts_multiqc\': \'$VIASH_PAR_FEATURECOUNTS_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FEATURECOUNTS_MULTIQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --featurecounts_multiqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --featurecounts_multiqc=*)
            [ -n "$VIASH_PAR_FEATURECOUNTS_MULTIQC" ] && ViashError Bad arguments for option \'--featurecounts_multiqc=*\': \'$VIASH_PAR_FEATURECOUNTS_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FEATURECOUNTS_MULTIQC=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --featurecounts_rrna_multiqc)
            [ -n "$VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC" ] && ViashError Bad arguments for option \'--featurecounts_rrna_multiqc\': \'$VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --featurecounts_rrna_multiqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --featurecounts_rrna_multiqc=*)
            [ -n "$VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC" ] && ViashError Bad arguments for option \'--featurecounts_rrna_multiqc=*\': \'$VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --bedgraph_forward)
            [ -n "$VIASH_PAR_BEDGRAPH_FORWARD" ] && ViashError Bad arguments for option \'--bedgraph_forward\': \'$VIASH_PAR_BEDGRAPH_FORWARD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BEDGRAPH_FORWARD="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --bedgraph_forward. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --bedgraph_forward=*)
            [ -n "$VIASH_PAR_BEDGRAPH_FORWARD" ] && ViashError Bad arguments for option \'--bedgraph_forward=*\': \'$VIASH_PAR_BEDGRAPH_FORWARD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BEDGRAPH_FORWARD=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --bedgraph_reverse)
            [ -n "$VIASH_PAR_BEDGRAPH_REVERSE" ] && ViashError Bad arguments for option \'--bedgraph_reverse\': \'$VIASH_PAR_BEDGRAPH_REVERSE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BEDGRAPH_REVERSE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --bedgraph_reverse. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --bedgraph_reverse=*)
            [ -n "$VIASH_PAR_BEDGRAPH_REVERSE" ] && ViashError Bad arguments for option \'--bedgraph_reverse=*\': \'$VIASH_PAR_BEDGRAPH_REVERSE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BEDGRAPH_REVERSE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --bigwig_forward)
            [ -n "$VIASH_PAR_BIGWIG_FORWARD" ] && ViashError Bad arguments for option \'--bigwig_forward\': \'$VIASH_PAR_BIGWIG_FORWARD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BIGWIG_FORWARD="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --bigwig_forward. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --bigwig_forward=*)
            [ -n "$VIASH_PAR_BIGWIG_FORWARD" ] && ViashError Bad arguments for option \'--bigwig_forward=*\': \'$VIASH_PAR_BIGWIG_FORWARD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BIGWIG_FORWARD=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --bigwig_reverse)
            [ -n "$VIASH_PAR_BIGWIG_REVERSE" ] && ViashError Bad arguments for option \'--bigwig_reverse\': \'$VIASH_PAR_BIGWIG_REVERSE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BIGWIG_REVERSE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --bigwig_reverse. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --bigwig_reverse=*)
            [ -n "$VIASH_PAR_BIGWIG_REVERSE" ] && ViashError Bad arguments for option \'--bigwig_reverse=*\': \'$VIASH_PAR_BIGWIG_REVERSE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BIGWIG_REVERSE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --preseq_output)
            [ -n "$VIASH_PAR_PRESEQ_OUTPUT" ] && ViashError Bad arguments for option \'--preseq_output\': \'$VIASH_PAR_PRESEQ_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PRESEQ_OUTPUT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --preseq_output. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --preseq_output=*)
            [ -n "$VIASH_PAR_PRESEQ_OUTPUT" ] && ViashError Bad arguments for option \'--preseq_output=*\': \'$VIASH_PAR_PRESEQ_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PRESEQ_OUTPUT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --bamstat_output)
            [ -n "$VIASH_PAR_BAMSTAT_OUTPUT" ] && ViashError Bad arguments for option \'--bamstat_output\': \'$VIASH_PAR_BAMSTAT_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAMSTAT_OUTPUT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --bamstat_output. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --bamstat_output=*)
            [ -n "$VIASH_PAR_BAMSTAT_OUTPUT" ] && ViashError Bad arguments for option \'--bamstat_output=*\': \'$VIASH_PAR_BAMSTAT_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAMSTAT_OUTPUT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --strandedness_output)
            [ -n "$VIASH_PAR_STRANDEDNESS_OUTPUT" ] && ViashError Bad arguments for option \'--strandedness_output\': \'$VIASH_PAR_STRANDEDNESS_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRANDEDNESS_OUTPUT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --strandedness_output. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --strandedness_output=*)
            [ -n "$VIASH_PAR_STRANDEDNESS_OUTPUT" ] && ViashError Bad arguments for option \'--strandedness_output=*\': \'$VIASH_PAR_STRANDEDNESS_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRANDEDNESS_OUTPUT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --inner_dist_output_stats)
            [ -n "$VIASH_PAR_INNER_DIST_OUTPUT_STATS" ] && ViashError Bad arguments for option \'--inner_dist_output_stats\': \'$VIASH_PAR_INNER_DIST_OUTPUT_STATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_INNER_DIST_OUTPUT_STATS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --inner_dist_output_stats. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --inner_dist_output_stats=*)
            [ -n "$VIASH_PAR_INNER_DIST_OUTPUT_STATS" ] && ViashError Bad arguments for option \'--inner_dist_output_stats=*\': \'$VIASH_PAR_INNER_DIST_OUTPUT_STATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_INNER_DIST_OUTPUT_STATS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --inner_dist_output_dist)
            [ -n "$VIASH_PAR_INNER_DIST_OUTPUT_DIST" ] && ViashError Bad arguments for option \'--inner_dist_output_dist\': \'$VIASH_PAR_INNER_DIST_OUTPUT_DIST\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_INNER_DIST_OUTPUT_DIST="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --inner_dist_output_dist. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --inner_dist_output_dist=*)
            [ -n "$VIASH_PAR_INNER_DIST_OUTPUT_DIST" ] && ViashError Bad arguments for option \'--inner_dist_output_dist=*\': \'$VIASH_PAR_INNER_DIST_OUTPUT_DIST\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_INNER_DIST_OUTPUT_DIST=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --inner_dist_output_freq)
            [ -n "$VIASH_PAR_INNER_DIST_OUTPUT_FREQ" ] && ViashError Bad arguments for option \'--inner_dist_output_freq\': \'$VIASH_PAR_INNER_DIST_OUTPUT_FREQ\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_INNER_DIST_OUTPUT_FREQ="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --inner_dist_output_freq. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --inner_dist_output_freq=*)
            [ -n "$VIASH_PAR_INNER_DIST_OUTPUT_FREQ" ] && ViashError Bad arguments for option \'--inner_dist_output_freq=*\': \'$VIASH_PAR_INNER_DIST_OUTPUT_FREQ\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_INNER_DIST_OUTPUT_FREQ=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --inner_dist_output_plot)
            [ -n "$VIASH_PAR_INNER_DIST_OUTPUT_PLOT" ] && ViashError Bad arguments for option \'--inner_dist_output_plot\': \'$VIASH_PAR_INNER_DIST_OUTPUT_PLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_INNER_DIST_OUTPUT_PLOT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --inner_dist_output_plot. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --inner_dist_output_plot=*)
            [ -n "$VIASH_PAR_INNER_DIST_OUTPUT_PLOT" ] && ViashError Bad arguments for option \'--inner_dist_output_plot=*\': \'$VIASH_PAR_INNER_DIST_OUTPUT_PLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_INNER_DIST_OUTPUT_PLOT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --inner_dist_output_plot_r)
            [ -n "$VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R" ] && ViashError Bad arguments for option \'--inner_dist_output_plot_r\': \'$VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --inner_dist_output_plot_r. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --inner_dist_output_plot_r=*)
            [ -n "$VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R" ] && ViashError Bad arguments for option \'--inner_dist_output_plot_r=*\': \'$VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --junction_annotation_output_log)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG" ] && ViashError Bad arguments for option \'--junction_annotation_output_log\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --junction_annotation_output_log. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --junction_annotation_output_log=*)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG" ] && ViashError Bad arguments for option \'--junction_annotation_output_log=*\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --junction_annotation_output_plot_r)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R" ] && ViashError Bad arguments for option \'--junction_annotation_output_plot_r\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --junction_annotation_output_plot_r. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --junction_annotation_output_plot_r=*)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R" ] && ViashError Bad arguments for option \'--junction_annotation_output_plot_r=*\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --junction_annotation_output_junction_bed)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED" ] && ViashError Bad arguments for option \'--junction_annotation_output_junction_bed\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --junction_annotation_output_junction_bed. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --junction_annotation_output_junction_bed=*)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED" ] && ViashError Bad arguments for option \'--junction_annotation_output_junction_bed=*\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --junction_annotation_output_junction_interact)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT" ] && ViashError Bad arguments for option \'--junction_annotation_output_junction_interact\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --junction_annotation_output_junction_interact. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --junction_annotation_output_junction_interact=*)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT" ] && ViashError Bad arguments for option \'--junction_annotation_output_junction_interact=*\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --junction_annotation_output_junction_sheet)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET" ] && ViashError Bad arguments for option \'--junction_annotation_output_junction_sheet\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --junction_annotation_output_junction_sheet. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --junction_annotation_output_junction_sheet=*)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET" ] && ViashError Bad arguments for option \'--junction_annotation_output_junction_sheet=*\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --junction_annotation_output_splice_events_plot)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT" ] && ViashError Bad arguments for option \'--junction_annotation_output_splice_events_plot\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --junction_annotation_output_splice_events_plot. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --junction_annotation_output_splice_events_plot=*)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT" ] && ViashError Bad arguments for option \'--junction_annotation_output_splice_events_plot=*\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --junction_annotation_output_splice_junctions_plot)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT" ] && ViashError Bad arguments for option \'--junction_annotation_output_splice_junctions_plot\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --junction_annotation_output_splice_junctions_plot. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --junction_annotation_output_splice_junctions_plot=*)
            [ -n "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT" ] && ViashError Bad arguments for option \'--junction_annotation_output_splice_junctions_plot=*\': \'$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --junction_saturation_output_plot_r)
            [ -n "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R" ] && ViashError Bad arguments for option \'--junction_saturation_output_plot_r\': \'$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --junction_saturation_output_plot_r. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --junction_saturation_output_plot_r=*)
            [ -n "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R" ] && ViashError Bad arguments for option \'--junction_saturation_output_plot_r=*\': \'$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --junction_saturation_output_plot)
            [ -n "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT" ] && ViashError Bad arguments for option \'--junction_saturation_output_plot\': \'$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --junction_saturation_output_plot. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --junction_saturation_output_plot=*)
            [ -n "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT" ] && ViashError Bad arguments for option \'--junction_saturation_output_plot=*\': \'$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --read_distribution_output)
            [ -n "$VIASH_PAR_READ_DISTRIBUTION_OUTPUT" ] && ViashError Bad arguments for option \'--read_distribution_output\': \'$VIASH_PAR_READ_DISTRIBUTION_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READ_DISTRIBUTION_OUTPUT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --read_distribution_output. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --read_distribution_output=*)
            [ -n "$VIASH_PAR_READ_DISTRIBUTION_OUTPUT" ] && ViashError Bad arguments for option \'--read_distribution_output=*\': \'$VIASH_PAR_READ_DISTRIBUTION_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READ_DISTRIBUTION_OUTPUT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --read_duplication_output_duplication_rate_plot_r)
            [ -n "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R" ] && ViashError Bad arguments for option \'--read_duplication_output_duplication_rate_plot_r\': \'$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --read_duplication_output_duplication_rate_plot_r. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --read_duplication_output_duplication_rate_plot_r=*)
            [ -n "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R" ] && ViashError Bad arguments for option \'--read_duplication_output_duplication_rate_plot_r=*\': \'$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --read_duplication_output_duplication_rate_plot)
            [ -n "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT" ] && ViashError Bad arguments for option \'--read_duplication_output_duplication_rate_plot\': \'$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --read_duplication_output_duplication_rate_plot. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --read_duplication_output_duplication_rate_plot=*)
            [ -n "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT" ] && ViashError Bad arguments for option \'--read_duplication_output_duplication_rate_plot=*\': \'$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --read_duplication_output_duplication_rate_mapping)
            [ -n "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING" ] && ViashError Bad arguments for option \'--read_duplication_output_duplication_rate_mapping\': \'$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --read_duplication_output_duplication_rate_mapping. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --read_duplication_output_duplication_rate_mapping=*)
            [ -n "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING" ] && ViashError Bad arguments for option \'--read_duplication_output_duplication_rate_mapping=*\': \'$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --read_duplication_output_duplication_rate_sequence)
            [ -n "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE" ] && ViashError Bad arguments for option \'--read_duplication_output_duplication_rate_sequence\': \'$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --read_duplication_output_duplication_rate_sequence. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --read_duplication_output_duplication_rate_sequence=*)
            [ -n "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE" ] && ViashError Bad arguments for option \'--read_duplication_output_duplication_rate_sequence=*\': \'$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --tin_output_summary)
            [ -n "$VIASH_PAR_TIN_OUTPUT_SUMMARY" ] && ViashError Bad arguments for option \'--tin_output_summary\': \'$VIASH_PAR_TIN_OUTPUT_SUMMARY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TIN_OUTPUT_SUMMARY="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --tin_output_summary. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --tin_output_summary=*)
            [ -n "$VIASH_PAR_TIN_OUTPUT_SUMMARY" ] && ViashError Bad arguments for option \'--tin_output_summary=*\': \'$VIASH_PAR_TIN_OUTPUT_SUMMARY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TIN_OUTPUT_SUMMARY=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --tin_output_metrics)
            [ -n "$VIASH_PAR_TIN_OUTPUT_METRICS" ] && ViashError Bad arguments for option \'--tin_output_metrics\': \'$VIASH_PAR_TIN_OUTPUT_METRICS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TIN_OUTPUT_METRICS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --tin_output_metrics. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --tin_output_metrics=*)
            [ -n "$VIASH_PAR_TIN_OUTPUT_METRICS" ] && ViashError Bad arguments for option \'--tin_output_metrics=*\': \'$VIASH_PAR_TIN_OUTPUT_METRICS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TIN_OUTPUT_METRICS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --dupradar_output_dupmatrix)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX" ] && ViashError Bad arguments for option \'--dupradar_output_dupmatrix\': \'$VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --dupradar_output_dupmatrix. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --dupradar_output_dupmatrix=*)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX" ] && ViashError Bad arguments for option \'--dupradar_output_dupmatrix=*\': \'$VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --dupradar_output_dup_intercept_mqc)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC" ] && ViashError Bad arguments for option \'--dupradar_output_dup_intercept_mqc\': \'$VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --dupradar_output_dup_intercept_mqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --dupradar_output_dup_intercept_mqc=*)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC" ] && ViashError Bad arguments for option \'--dupradar_output_dup_intercept_mqc=*\': \'$VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --dupradar_output_duprate_exp_boxplot)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT" ] && ViashError Bad arguments for option \'--dupradar_output_duprate_exp_boxplot\': \'$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --dupradar_output_duprate_exp_boxplot. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --dupradar_output_duprate_exp_boxplot=*)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT" ] && ViashError Bad arguments for option \'--dupradar_output_duprate_exp_boxplot=*\': \'$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --dupradar_output_duprate_exp_densplot)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT" ] && ViashError Bad arguments for option \'--dupradar_output_duprate_exp_densplot\': \'$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --dupradar_output_duprate_exp_densplot. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --dupradar_output_duprate_exp_densplot=*)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT" ] && ViashError Bad arguments for option \'--dupradar_output_duprate_exp_densplot=*\': \'$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --dupradar_output_duprate_exp_denscurve_mqc)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC" ] && ViashError Bad arguments for option \'--dupradar_output_duprate_exp_denscurve_mqc\': \'$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --dupradar_output_duprate_exp_denscurve_mqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --dupradar_output_duprate_exp_denscurve_mqc=*)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC" ] && ViashError Bad arguments for option \'--dupradar_output_duprate_exp_denscurve_mqc=*\': \'$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --dupradar_output_expression_histogram)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM" ] && ViashError Bad arguments for option \'--dupradar_output_expression_histogram\': \'$VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --dupradar_output_expression_histogram. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --dupradar_output_expression_histogram=*)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM" ] && ViashError Bad arguments for option \'--dupradar_output_expression_histogram=*\': \'$VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --dupradar_output_intercept_slope)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE" ] && ViashError Bad arguments for option \'--dupradar_output_intercept_slope\': \'$VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --dupradar_output_intercept_slope. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --dupradar_output_intercept_slope=*)
            [ -n "$VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE" ] && ViashError Bad arguments for option \'--dupradar_output_intercept_slope=*\': \'$VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --qualimap_qc_report)
            [ -n "$VIASH_PAR_QUALIMAP_QC_REPORT" ] && ViashError Bad arguments for option \'--qualimap_qc_report\': \'$VIASH_PAR_QUALIMAP_QC_REPORT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUALIMAP_QC_REPORT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --qualimap_qc_report. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --qualimap_qc_report=*)
            [ -n "$VIASH_PAR_QUALIMAP_QC_REPORT" ] && ViashError Bad arguments for option \'--qualimap_qc_report=*\': \'$VIASH_PAR_QUALIMAP_QC_REPORT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUALIMAP_QC_REPORT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --qualimap_counts)
            [ -n "$VIASH_PAR_QUALIMAP_COUNTS" ] && ViashError Bad arguments for option \'--qualimap_counts\': \'$VIASH_PAR_QUALIMAP_COUNTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUALIMAP_COUNTS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --qualimap_counts. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --qualimap_counts=*)
            [ -n "$VIASH_PAR_QUALIMAP_COUNTS" ] && ViashError Bad arguments for option \'--qualimap_counts=*\': \'$VIASH_PAR_QUALIMAP_COUNTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUALIMAP_COUNTS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --qualimap_report)
            [ -n "$VIASH_PAR_QUALIMAP_REPORT" ] && ViashError Bad arguments for option \'--qualimap_report\': \'$VIASH_PAR_QUALIMAP_REPORT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUALIMAP_REPORT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --qualimap_report. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --qualimap_report=*)
            [ -n "$VIASH_PAR_QUALIMAP_REPORT" ] && ViashError Bad arguments for option \'--qualimap_report=*\': \'$VIASH_PAR_QUALIMAP_REPORT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUALIMAP_REPORT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --deseq2_output)
            [ -n "$VIASH_PAR_DESEQ2_OUTPUT" ] && ViashError Bad arguments for option \'--deseq2_output\': \'$VIASH_PAR_DESEQ2_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DESEQ2_OUTPUT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --deseq2_output. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --deseq2_output=*)
            [ -n "$VIASH_PAR_DESEQ2_OUTPUT" ] && ViashError Bad arguments for option \'--deseq2_output=*\': \'$VIASH_PAR_DESEQ2_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DESEQ2_OUTPUT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --deseq2_output_pseudo)
            [ -n "$VIASH_PAR_DESEQ2_OUTPUT_PSEUDO" ] && ViashError Bad arguments for option \'--deseq2_output_pseudo\': \'$VIASH_PAR_DESEQ2_OUTPUT_PSEUDO\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DESEQ2_OUTPUT_PSEUDO="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --deseq2_output_pseudo. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --deseq2_output_pseudo=*)
            [ -n "$VIASH_PAR_DESEQ2_OUTPUT_PSEUDO" ] && ViashError Bad arguments for option \'--deseq2_output_pseudo=*\': \'$VIASH_PAR_DESEQ2_OUTPUT_PSEUDO\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_DESEQ2_OUTPUT_PSEUDO=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --multiqc_report)
            [ -n "$VIASH_PAR_MULTIQC_REPORT" ] && ViashError Bad arguments for option \'--multiqc_report\': \'$VIASH_PAR_MULTIQC_REPORT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_REPORT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --multiqc_report. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --multiqc_report=*)
            [ -n "$VIASH_PAR_MULTIQC_REPORT" ] && ViashError Bad arguments for option \'--multiqc_report=*\': \'$VIASH_PAR_MULTIQC_REPORT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_REPORT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --multiqc_data)
            [ -n "$VIASH_PAR_MULTIQC_DATA" ] && ViashError Bad arguments for option \'--multiqc_data\': \'$VIASH_PAR_MULTIQC_DATA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_DATA="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --multiqc_data. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --multiqc_data=*)
            [ -n "$VIASH_PAR_MULTIQC_DATA" ] && ViashError Bad arguments for option \'--multiqc_data=*\': \'$VIASH_PAR_MULTIQC_DATA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_DATA=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --multiqc_plots)
            [ -n "$VIASH_PAR_MULTIQC_PLOTS" ] && ViashError Bad arguments for option \'--multiqc_plots\': \'$VIASH_PAR_MULTIQC_PLOTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_PLOTS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --multiqc_plots. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --multiqc_plots=*)
            [ -n "$VIASH_PAR_MULTIQC_PLOTS" ] && ViashError Bad arguments for option \'--multiqc_plots=*\': \'$VIASH_PAR_MULTIQC_PLOTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_PLOTS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --multiqc_versions)
            [ -n "$VIASH_PAR_MULTIQC_VERSIONS" ] && ViashError Bad arguments for option \'--multiqc_versions\': \'$VIASH_PAR_MULTIQC_VERSIONS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_VERSIONS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --multiqc_versions. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --multiqc_versions=*)
            [ -n "$VIASH_PAR_MULTIQC_VERSIONS" ] && ViashError Bad arguments for option \'--multiqc_versions=*\': \'$VIASH_PAR_MULTIQC_VERSIONS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MULTIQC_VERSIONS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_counts_gene)
            [ -n "$VIASH_PAR_PSEUDO_COUNTS_GENE" ] && ViashError Bad arguments for option \'--pseudo_counts_gene\': \'$VIASH_PAR_PSEUDO_COUNTS_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_COUNTS_GENE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_counts_gene. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_counts_gene=*)
            [ -n "$VIASH_PAR_PSEUDO_COUNTS_GENE" ] && ViashError Bad arguments for option \'--pseudo_counts_gene=*\': \'$VIASH_PAR_PSEUDO_COUNTS_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_COUNTS_GENE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_counts_gene_length_scaled)
            [ -n "$VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED" ] && ViashError Bad arguments for option \'--pseudo_counts_gene_length_scaled\': \'$VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_counts_gene_length_scaled. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_counts_gene_length_scaled=*)
            [ -n "$VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED" ] && ViashError Bad arguments for option \'--pseudo_counts_gene_length_scaled=*\': \'$VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_counts_gene_scaled)
            [ -n "$VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED" ] && ViashError Bad arguments for option \'--pseudo_counts_gene_scaled\': \'$VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_counts_gene_scaled. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_counts_gene_scaled=*)
            [ -n "$VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED" ] && ViashError Bad arguments for option \'--pseudo_counts_gene_scaled=*\': \'$VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_tpm_gene)
            [ -n "$VIASH_PAR_PSEUDO_TPM_GENE" ] && ViashError Bad arguments for option \'--pseudo_tpm_gene\': \'$VIASH_PAR_PSEUDO_TPM_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_TPM_GENE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_tpm_gene. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_tpm_gene=*)
            [ -n "$VIASH_PAR_PSEUDO_TPM_GENE" ] && ViashError Bad arguments for option \'--pseudo_tpm_gene=*\': \'$VIASH_PAR_PSEUDO_TPM_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_TPM_GENE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_tpm_transcript)
            [ -n "$VIASH_PAR_PSEUDO_TPM_TRANSCRIPT" ] && ViashError Bad arguments for option \'--pseudo_tpm_transcript\': \'$VIASH_PAR_PSEUDO_TPM_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_TPM_TRANSCRIPT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_tpm_transcript. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_tpm_transcript=*)
            [ -n "$VIASH_PAR_PSEUDO_TPM_TRANSCRIPT" ] && ViashError Bad arguments for option \'--pseudo_tpm_transcript=*\': \'$VIASH_PAR_PSEUDO_TPM_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_TPM_TRANSCRIPT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_counts_transcript)
            [ -n "$VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT" ] && ViashError Bad arguments for option \'--pseudo_counts_transcript\': \'$VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_counts_transcript. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_counts_transcript=*)
            [ -n "$VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT" ] && ViashError Bad arguments for option \'--pseudo_counts_transcript=*\': \'$VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_quant_merged_summarizedexperiment)
            [ -n "$VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ] && ViashError Bad arguments for option \'--pseudo_quant_merged_summarizedexperiment\': \'$VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_quant_merged_summarizedexperiment. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_quant_merged_summarizedexperiment=*)
            [ -n "$VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ] && ViashError Bad arguments for option \'--pseudo_quant_merged_summarizedexperiment=*\': \'$VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        ---engine)
            VIASH_ENGINE_ID="$2"
            shift 2
            ;;
        ---engine=*)
            VIASH_ENGINE_ID="$(ViashRemoveFlags "$1")"
            shift 1
            ;;
        ---cpus)
            [ -n "$VIASH_META_CPUS" ] && ViashError Bad arguments for option \'---cpus\': \'$VIASH_META_CPUS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_META_CPUS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to ---cpus. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        ---cpus=*)
            [ -n "$VIASH_META_CPUS" ] && ViashError Bad arguments for option \'---cpus=*\': \'$VIASH_META_CPUS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_META_CPUS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        ---memory)
            [ -n "$VIASH_META_MEMORY" ] && ViashError Bad arguments for option \'---memory\': \'$VIASH_META_MEMORY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_META_MEMORY="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to ---memory. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        ---memory=*)
            [ -n "$VIASH_META_MEMORY" ] && ViashError Bad arguments for option \'---memory=*\': \'$VIASH_META_MEMORY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_META_MEMORY=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        *)  # positional arg or unknown option
            # since the positional args will be eval'd, can we always quote, instead of using ViashQuote
            VIASH_POSITIONAL_ARGS="$VIASH_POSITIONAL_ARGS '$1'"
            [[ $1 == -* ]] && ViashWarning $1 looks like a parameter but is not a defined parameter and will instead be treated as a positional argument. Use "--help" to get more information on the parameters.
            shift # past argument
            ;;
    esac
done

# parse positional parameters
eval set -- $VIASH_POSITIONAL_ARGS


if   [ "$VIASH_ENGINE_ID" == "native" ]  ; then
  VIASH_ENGINE_TYPE='native'
else
  ViashError "Engine '$VIASH_ENGINE_ID' is not recognized. Options are: native."
  exit 1
fi

# setting computational defaults

# helper function for parsing memory strings
function ViashMemoryAsBytes {
  local memory=`echo "$1" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]'`
  local memory_regex='^([0-9]+)([kmgtp]i?b?|b)$'
  if [[ $memory =~ $memory_regex ]]; then
    local number=${memory/[^0-9]*/}
    local symbol=${memory/*[0-9]/}
    
    case $symbol in
      b)      memory_b=$number ;;
      kb|k)   memory_b=$(( $number * 1000 )) ;;
      mb|m)   memory_b=$(( $number * 1000 * 1000 )) ;;
      gb|g)   memory_b=$(( $number * 1000 * 1000 * 1000 )) ;;
      tb|t)   memory_b=$(( $number * 1000 * 1000 * 1000 * 1000 )) ;;
      pb|p)   memory_b=$(( $number * 1000 * 1000 * 1000 * 1000 * 1000 )) ;;
      kib|ki)   memory_b=$(( $number * 1024 )) ;;
      mib|mi)   memory_b=$(( $number * 1024 * 1024 )) ;;
      gib|gi)   memory_b=$(( $number * 1024 * 1024 * 1024 )) ;;
      tib|ti)   memory_b=$(( $number * 1024 * 1024 * 1024 * 1024 )) ;;
      pib|pi)   memory_b=$(( $number * 1024 * 1024 * 1024 * 1024 * 1024 )) ;;
    esac
    echo "$memory_b"
  fi
}
# compute memory in different units
if [ ! -z ${VIASH_META_MEMORY+x} ]; then
  VIASH_META_MEMORY_B=`ViashMemoryAsBytes $VIASH_META_MEMORY`
  # do not define other variables if memory_b is an empty string
  if [ ! -z "$VIASH_META_MEMORY_B" ]; then
    VIASH_META_MEMORY_KB=$(( ($VIASH_META_MEMORY_B+999) / 1000 ))
    VIASH_META_MEMORY_MB=$(( ($VIASH_META_MEMORY_KB+999) / 1000 ))
    VIASH_META_MEMORY_GB=$(( ($VIASH_META_MEMORY_MB+999) / 1000 ))
    VIASH_META_MEMORY_TB=$(( ($VIASH_META_MEMORY_GB+999) / 1000 ))
    VIASH_META_MEMORY_PB=$(( ($VIASH_META_MEMORY_TB+999) / 1000 ))
    VIASH_META_MEMORY_KIB=$(( ($VIASH_META_MEMORY_B+1023) / 1024 ))
    VIASH_META_MEMORY_MIB=$(( ($VIASH_META_MEMORY_KIB+1023) / 1024 ))
    VIASH_META_MEMORY_GIB=$(( ($VIASH_META_MEMORY_MIB+1023) / 1024 ))
    VIASH_META_MEMORY_TIB=$(( ($VIASH_META_MEMORY_GIB+1023) / 1024 ))
    VIASH_META_MEMORY_PIB=$(( ($VIASH_META_MEMORY_TIB+1023) / 1024 ))
  else
    # unset memory if string is empty
    unset $VIASH_META_MEMORY_B
  fi
fi
# unset nproc if string is empty
if [ -z "$VIASH_META_CPUS" ]; then
  unset $VIASH_META_CPUS
fi


# check whether required parameters exist
if [ -z ${VIASH_PAR_ID+x} ]; then
  ViashError '--id' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi
if [ -z ${VIASH_PAR_FASTQ_1+x} ]; then
  ViashError '--fastq_1' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi
if [ -z ${VIASH_PAR_FASTA+x} ]; then
  ViashError '--fasta' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi
if [ -z ${VIASH_META_NAME+x} ]; then
  ViashError 'name' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi
if [ -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then
  ViashError 'functionality_name' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi
if [ -z ${VIASH_META_RESOURCES_DIR+x} ]; then
  ViashError 'resources_dir' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi
if [ -z ${VIASH_META_EXECUTABLE+x} ]; then
  ViashError 'executable' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi
if [ -z ${VIASH_META_CONFIG+x} ]; then
  ViashError 'config' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi
if [ -z ${VIASH_META_TEMP_DIR+x} ]; then
  ViashError 'temp_dir' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi

# filling in defaults
if [ -z ${VIASH_PAR_STRANDEDNESS+x} ]; then
  VIASH_PAR_STRANDEDNESS="auto"
fi
if [ -z ${VIASH_PAR_GENCODE+x} ]; then
  VIASH_PAR_GENCODE="false"
fi
if [ -z ${VIASH_PAR_GTF_EXTRA_ATTRIBUTES+x} ]; then
  VIASH_PAR_GTF_EXTRA_ATTRIBUTES="gene_name"
fi
if [ -z ${VIASH_PAR_GTF_GROUP_FEATURES+x} ]; then
  VIASH_PAR_GTF_GROUP_FEATURES="gene_id"
fi
if [ -z ${VIASH_PAR_FEATURECOUNTS_GROUP_TYPE+x} ]; then
  VIASH_PAR_FEATURECOUNTS_GROUP_TYPE="gene_biotype"
fi
if [ -z ${VIASH_PAR_FEATURECOUNTS_FEATURE_TYPE+x} ]; then
  VIASH_PAR_FEATURECOUNTS_FEATURE_TYPE="exon"
fi
if [ -z ${VIASH_PAR_TRIMMER+x} ]; then
  VIASH_PAR_TRIMMER="trimgalore"
fi
if [ -z ${VIASH_PAR_MIN_TRIMMED_READS+x} ]; then
  VIASH_PAR_MIN_TRIMMED_READS="10000"
fi
if [ -z ${VIASH_PAR_REMOVE_RIBO_RNA+x} ]; then
  VIASH_PAR_REMOVE_RIBO_RNA="false"
fi
if [ -z ${VIASH_PAR_RIBO_DATABASE_MANIFEST+x} ]; then
  VIASH_PAR_RIBO_DATABASE_MANIFEST="src/assets/rrna-db-defaults.txt"
fi
if [ -z ${VIASH_PAR_WITH_UMI+x} ]; then
  VIASH_PAR_WITH_UMI="false"
fi
if [ -z ${VIASH_PAR_UMITOOLS_EXTRACT_METHOD+x} ]; then
  VIASH_PAR_UMITOOLS_EXTRACT_METHOD="string"
fi
if [ -z ${VIASH_PAR_UMI_DISCARD_READ+x} ]; then
  VIASH_PAR_UMI_DISCARD_READ="0"
fi
if [ -z ${VIASH_PAR_UMITOOLS_UMI_SEPARATOR+x} ]; then
  VIASH_PAR_UMITOOLS_UMI_SEPARATOR="_"
fi
if [ -z ${VIASH_PAR_UMITOOLS_GROUPING_METHOD+x} ]; then
  VIASH_PAR_UMITOOLS_GROUPING_METHOD="directional"
fi
if [ -z ${VIASH_PAR_UMI_DEDUP_STATS+x} ]; then
  VIASH_PAR_UMI_DEDUP_STATS="false"
fi
if [ -z ${VIASH_PAR_ALIGNER+x} ]; then
  VIASH_PAR_ALIGNER="star_salmon"
fi
if [ -z ${VIASH_PAR_PSEUDO_ALIGNER+x} ]; then
  VIASH_PAR_PSEUDO_ALIGNER="salmon"
fi
if [ -z ${VIASH_PAR_PSEUDO_ALIGNER_KMER_SIZE+x} ]; then
  VIASH_PAR_PSEUDO_ALIGNER_KMER_SIZE="31"
fi
if [ -z ${VIASH_PAR_BAM_CSI_INDEX+x} ]; then
  VIASH_PAR_BAM_CSI_INDEX="false"
fi
if [ -z ${VIASH_PAR_MIN_MAPPED_READS+x} ]; then
  VIASH_PAR_MIN_MAPPED_READS="5"
fi
if [ -z ${VIASH_PAR_STRINGTIE_IGNORE_GTF+x} ]; then
  VIASH_PAR_STRINGTIE_IGNORE_GTF="false"
fi
if [ -z ${VIASH_PAR_EXTRA_STRINGTIE_ARGS+x} ]; then
  VIASH_PAR_EXTRA_STRINGTIE_ARGS="-v"
fi
if [ -z ${VIASH_PAR_SAVE_UNALIGNED+x} ]; then
  VIASH_PAR_SAVE_UNALIGNED="false"
fi
if [ -z ${VIASH_PAR_SAVE_ALIGN_INTERMEDS+x} ]; then
  VIASH_PAR_SAVE_ALIGN_INTERMEDS="false"
fi
if [ -z ${VIASH_PAR_SKIP_ALIGNMENT+x} ]; then
  VIASH_PAR_SKIP_ALIGNMENT="false"
fi
if [ -z ${VIASH_PAR_SKIP_PSEUDO_ALIGNMENT+x} ]; then
  VIASH_PAR_SKIP_PSEUDO_ALIGNMENT="false"
fi
if [ -z ${VIASH_PAR_SKIP_FASTQC+x} ]; then
  VIASH_PAR_SKIP_FASTQC="false"
fi
if [ -z ${VIASH_PAR_SKIP_TRIMMING+x} ]; then
  VIASH_PAR_SKIP_TRIMMING="false"
fi
if [ -z ${VIASH_PAR_SKIP_UMI_EXTRACT+x} ]; then
  VIASH_PAR_SKIP_UMI_EXTRACT="false"
fi
if [ -z ${VIASH_PAR_SKIP_QC+x} ]; then
  VIASH_PAR_SKIP_QC="false"
fi
if [ -z ${VIASH_PAR_SKIP_MARKDUPLICATES+x} ]; then
  VIASH_PAR_SKIP_MARKDUPLICATES="false"
fi
if [ -z ${VIASH_PAR_SKIP_STRINGTIE+x} ]; then
  VIASH_PAR_SKIP_STRINGTIE="false"
fi
if [ -z ${VIASH_PAR_SKIP_BIOTYPE_QC+x} ]; then
  VIASH_PAR_SKIP_BIOTYPE_QC="false"
fi
if [ -z ${VIASH_PAR_SKIP_BIGWIG+x} ]; then
  VIASH_PAR_SKIP_BIGWIG="false"
fi
if [ -z ${VIASH_PAR_SKIP_PRESEQ+x} ]; then
  VIASH_PAR_SKIP_PRESEQ="false"
fi
if [ -z ${VIASH_PAR_SKIP_DUPRADAR+x} ]; then
  VIASH_PAR_SKIP_DUPRADAR="false"
fi
if [ -z ${VIASH_PAR_SKIP_QUALIMAP+x} ]; then
  VIASH_PAR_SKIP_QUALIMAP="false"
fi
if [ -z ${VIASH_PAR_SKIP_RSEQC+x} ]; then
  VIASH_PAR_SKIP_RSEQC="false"
fi
if [ -z ${VIASH_PAR_SKIP_MULTIQC+x} ]; then
  VIASH_PAR_SKIP_MULTIQC="false"
fi
if [ -z ${VIASH_PAR_EXTRA_PICARD_ARGS+x} ]; then
  VIASH_PAR_EXTRA_PICARD_ARGS=" --ASSUME_SORTED true --REMOVE_DUPLICATES false --VALIDATION_STRINGENCY LENIENT --TMP_DIR tmp"
fi
if [ -z ${VIASH_PAR_EXTRA_PRESEQ_ARGS+x} ]; then
  VIASH_PAR_EXTRA_PRESEQ_ARGS="-verbose -seed 1 -seg_len 100000000"
fi
if [ -z ${VIASH_PAR_DESEQ2_VST+x} ]; then
  VIASH_PAR_DESEQ2_VST="true"
fi
if [ -z ${VIASH_PAR_RSEQC_MODULES+x} ]; then
  VIASH_PAR_RSEQC_MODULES="bam_stat;inner_distance;infer_experiment;junction_annotation;junction_saturation;read_distribution;read_duplication"
fi
if [ -z ${VIASH_PAR_OUTPUT_FASTA+x} ]; then
  VIASH_PAR_OUTPUT_FASTA="reference/genome.fasta"
fi
if [ -z ${VIASH_PAR_OUTPUT_GTF+x} ]; then
  VIASH_PAR_OUTPUT_GTF="reference/gene_annotation.gtf"
fi
if [ -z ${VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA+x} ]; then
  VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA="reference/transcriptome.fasta"
fi
if [ -z ${VIASH_PAR_OUTPUT_GENE_BED+x} ]; then
  VIASH_PAR_OUTPUT_GENE_BED="reference/gene_annotation.bed"
fi
if [ -z ${VIASH_PAR_OUTPUT_STAR_INDEX+x} ]; then
  VIASH_PAR_OUTPUT_STAR_INDEX="reference/index/STAR"
fi
if [ -z ${VIASH_PAR_OUTPUT_SALMON_INDEX+x} ]; then
  VIASH_PAR_OUTPUT_SALMON_INDEX="reference/index/Salmon"
fi
if [ -z ${VIASH_PAR_OUTPUT_BBSPLIT_INDEX+x} ]; then
  VIASH_PAR_OUTPUT_BBSPLIT_INDEX="reference/index/BBSplit"
fi
if [ -z ${VIASH_PAR_OUTPUT_KALLISTO_INDEX+x} ]; then
  VIASH_PAR_OUTPUT_KALLISTO_INDEX="reference/index/Kallisto"
fi
if [ -z ${VIASH_PAR_OUTPUT_FASTQ_1+x} ]; then
  VIASH_PAR_OUTPUT_FASTQ_1="fastq/\${id}_r1.fastq.gz"
fi
if [ -z ${VIASH_PAR_OUTPUT_FASTQ_2+x} ]; then
  VIASH_PAR_OUTPUT_FASTQ_2="fastq/\${id}_r2.fastq.gz"
fi
if [ -z ${VIASH_PAR_FASTQC_HTML_1+x} ]; then
  VIASH_PAR_FASTQC_HTML_1="fastqc_raw/\${id}_r1.fastqc.html"
fi
if [ -z ${VIASH_PAR_FASTQC_HTML_2+x} ]; then
  VIASH_PAR_FASTQC_HTML_2="fastqc_raw/\${id}_r2.fastqc.html"
fi
if [ -z ${VIASH_PAR_FASTQC_ZIP_1+x} ]; then
  VIASH_PAR_FASTQC_ZIP_1="fastqc_raw/\${id}_r1.fastqc.zip"
fi
if [ -z ${VIASH_PAR_FASTQC_ZIP_2+x} ]; then
  VIASH_PAR_FASTQC_ZIP_2="fastqc_raw/\${id}_r2.fastqc.zip"
fi
if [ -z ${VIASH_PAR_TRIM_HTML_1+x} ]; then
  VIASH_PAR_TRIM_HTML_1="fastqc_trim/\${id}_r1.trimmed_fastqc.html"
fi
if [ -z ${VIASH_PAR_TRIM_HTML_2+x} ]; then
  VIASH_PAR_TRIM_HTML_2="fastqc_trim/\${id}_r2.trimmed_fastqc.html"
fi
if [ -z ${VIASH_PAR_TRIM_ZIP_1+x} ]; then
  VIASH_PAR_TRIM_ZIP_1="fastqc_trim/\${id}_r1.trimmed_fastqc.zip"
fi
if [ -z ${VIASH_PAR_TRIM_ZIP_2+x} ]; then
  VIASH_PAR_TRIM_ZIP_2="fastqc_trim/\${id}_r2.trimmed_fastqc.zip"
fi
if [ -z ${VIASH_PAR_TRIM_LOG_1+x} ]; then
  VIASH_PAR_TRIM_LOG_1="trimgalore/\${id}_r1.trimming_report.txt"
fi
if [ -z ${VIASH_PAR_TRIM_LOG_2+x} ]; then
  VIASH_PAR_TRIM_LOG_2="trimgalore/\${id}_r2.trimming_report.txt"
fi
if [ -z ${VIASH_PAR_FASTP_TRIM_JSON+x} ]; then
  VIASH_PAR_FASTP_TRIM_JSON="fastp/\$id_out.json"
fi
if [ -z ${VIASH_PAR_FASTP_TRIM_HTML+x} ]; then
  VIASH_PAR_FASTP_TRIM_HTML="fastp/\$id_out.html"
fi
if [ -z ${VIASH_PAR_SORTMERNA_LOG+x} ]; then
  VIASH_PAR_SORTMERNA_LOG="sortmerna/\$id.log"
fi
if [ -z ${VIASH_PAR_STAR_ALIGNMENT+x} ]; then
  VIASH_PAR_STAR_ALIGNMENT="STAR/\$id"
fi
if [ -z ${VIASH_PAR_GENOME_BAM_SORTED+x} ]; then
  VIASH_PAR_GENOME_BAM_SORTED="STAR/genome_processed/\$id.genome.bam"
fi
if [ -z ${VIASH_PAR_GENOME_BAM_INDEX+x} ]; then
  VIASH_PAR_GENOME_BAM_INDEX="STAR/genome_processed/\$id.genome.bam.bai"
fi
if [ -z ${VIASH_PAR_TRANSCRIPTOME_BAM+x} ]; then
  VIASH_PAR_TRANSCRIPTOME_BAM="STAR/transcriptome_processed/\$id.transcriptome.bam"
fi
if [ -z ${VIASH_PAR_TRANSCRIPTOME_BAM_INDEX+x} ]; then
  VIASH_PAR_TRANSCRIPTOME_BAM_INDEX="STAR/transcriptome_processed/\$id.transcriptome.bam.bai"
fi
if [ -z ${VIASH_PAR_STAR_LOG+x} ]; then
  VIASH_PAR_STAR_LOG="STAR/log/\$id.log"
fi
if [ -z ${VIASH_PAR_GENOME_BAM_STATS+x} ]; then
  VIASH_PAR_GENOME_BAM_STATS="samtools_stats/\$id.genome.stats"
fi
if [ -z ${VIASH_PAR_GENOME_BAM_FLAGSTAT+x} ]; then
  VIASH_PAR_GENOME_BAM_FLAGSTAT="samtools_stats/\$id.genome.flagstat"
fi
if [ -z ${VIASH_PAR_GENOME_BAM_IDXSTATS+x} ]; then
  VIASH_PAR_GENOME_BAM_IDXSTATS="samtools_stats/\$id.genome.idxstats"
fi
if [ -z ${VIASH_PAR_TRANSCRIPTOME_BAM_STATS+x} ]; then
  VIASH_PAR_TRANSCRIPTOME_BAM_STATS="samtools_stats/\$id.transcriptome.stats"
fi
if [ -z ${VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT+x} ]; then
  VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT="samtools_stats/\$id.transcriptome.flagstat"
fi
if [ -z ${VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS+x} ]; then
  VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS="samtools_stats/\$id.transcriptome.idxstats"
fi
if [ -z ${VIASH_PAR_SALMON_QUANT_RESULTS+x} ]; then
  VIASH_PAR_SALMON_QUANT_RESULTS="STAR_Salmon/\$id"
fi
if [ -z ${VIASH_PAR_SALMON_QUANT_RESULTS_FILE+x} ]; then
  VIASH_PAR_SALMON_QUANT_RESULTS_FILE="STAR_Salmon/\$id/quant.sf"
fi
if [ -z ${VIASH_PAR_PSEUDO_QUANT_RESULTS+x} ]; then
  VIASH_PAR_PSEUDO_QUANT_RESULTS="Pseudo_align_quant/\$id"
fi
if [ -z ${VIASH_PAR_RSEM_COUNTS_GENE+x} ]; then
  VIASH_PAR_RSEM_COUNTS_GENE="RSEM/\$id.genes.results"
fi
if [ -z ${VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS+x} ]; then
  VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS="RSEM/\$id.isoforms.results"
fi
if [ -z ${VIASH_PAR_BAM_STAR_RSEM+x} ]; then
  VIASH_PAR_BAM_STAR_RSEM="RSEM/\$id.STAR.genome.bam"
fi
if [ -z ${VIASH_PAR_BAM_GENOME_RSEM+x} ]; then
  VIASH_PAR_BAM_GENOME_RSEM="RSEM/\$id.genome.bam"
fi
if [ -z ${VIASH_PAR_BAM_TRANSCRIPT_RSEM+x} ]; then
  VIASH_PAR_BAM_TRANSCRIPT_RSEM="RSEM/\$id.transcript.bam"
fi
if [ -z ${VIASH_PAR_TPM_GENE+x} ]; then
  VIASH_PAR_TPM_GENE="transcript_quantification/gene_tpm.tsv"
fi
if [ -z ${VIASH_PAR_COUNTS_GENE+x} ]; then
  VIASH_PAR_COUNTS_GENE="transcript_quantification/gene_counts.tsv"
fi
if [ -z ${VIASH_PAR_COUNTS_GENE_LENGTH_SCALED+x} ]; then
  VIASH_PAR_COUNTS_GENE_LENGTH_SCALED="transcript_quantification/gene_counts_length_scaled.tsv"
fi
if [ -z ${VIASH_PAR_COUNTS_GENE_SCALED+x} ]; then
  VIASH_PAR_COUNTS_GENE_SCALED="transcript_quantification/gene_counts_scaled.tsv"
fi
if [ -z ${VIASH_PAR_TPM_TRANSCRIPT+x} ]; then
  VIASH_PAR_TPM_TRANSCRIPT="transcript_quantification/transcript_tpm.tsv"
fi
if [ -z ${VIASH_PAR_COUNTS_TRANSCRIPT+x} ]; then
  VIASH_PAR_COUNTS_TRANSCRIPT="transcript_quantification/transcript_counts.tsv"
fi
if [ -z ${VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT+x} ]; then
  VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT="transcript_quantification/summarizedexperiment"
fi
if [ -z ${VIASH_PAR_MARKDUPLICATES_METRICS+x} ]; then
  VIASH_PAR_MARKDUPLICATES_METRICS="picard/\$id.MarkDuplicates.metrics.txt"
fi
if [ -z ${VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF+x} ]; then
  VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF="stringtie/\$id.transcripts.gtf"
fi
if [ -z ${VIASH_PAR_STRINGTIE_COVERAGE_GTF+x} ]; then
  VIASH_PAR_STRINGTIE_COVERAGE_GTF="stringtie/\$id.coverage.gtf"
fi
if [ -z ${VIASH_PAR_STRINGTIE_ABUNDANCE+x} ]; then
  VIASH_PAR_STRINGTIE_ABUNDANCE="stringtie/\$id.gene_abundance.txt"
fi
if [ -z ${VIASH_PAR_STRINGTIE_BALLGOWN+x} ]; then
  VIASH_PAR_STRINGTIE_BALLGOWN="stringtie/\$id.ballgown"
fi
if [ -z ${VIASH_PAR_FEATURECOUNTS+x} ]; then
  VIASH_PAR_FEATURECOUNTS="featurecounts/\$id.featureCounts.txt"
fi
if [ -z ${VIASH_PAR_FEATURECOUNTS_SUMMARY+x} ]; then
  VIASH_PAR_FEATURECOUNTS_SUMMARY="featurecounts/\$id.featureCounts.txt.summary"
fi
if [ -z ${VIASH_PAR_FEATURECOUNTS_MULTIQC+x} ]; then
  VIASH_PAR_FEATURECOUNTS_MULTIQC="featurecounts/\$id.featureCounts_mqc.tsv"
fi
if [ -z ${VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC+x} ]; then
  VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC="featurecounts/\$id.featureCounts_rrna_mqc.tsv"
fi
if [ -z ${VIASH_PAR_BEDGRAPH_FORWARD+x} ]; then
  VIASH_PAR_BEDGRAPH_FORWARD="bedgraph/\$id.forward.bedgraph"
fi
if [ -z ${VIASH_PAR_BEDGRAPH_REVERSE+x} ]; then
  VIASH_PAR_BEDGRAPH_REVERSE="bedgraph/\$id.reverse.bedgraph"
fi
if [ -z ${VIASH_PAR_BIGWIG_FORWARD+x} ]; then
  VIASH_PAR_BIGWIG_FORWARD="bigwig/\$id.forward.bigwig"
fi
if [ -z ${VIASH_PAR_BIGWIG_REVERSE+x} ]; then
  VIASH_PAR_BIGWIG_REVERSE="bigwig/\$id.reverse.bigwig"
fi
if [ -z ${VIASH_PAR_PRESEQ_OUTPUT+x} ]; then
  VIASH_PAR_PRESEQ_OUTPUT="preseq/\$id.lc_extrap.txt"
fi
if [ -z ${VIASH_PAR_BAMSTAT_OUTPUT+x} ]; then
  VIASH_PAR_BAMSTAT_OUTPUT="RSeQC/bamstat/\$id.mapping_quality.txt"
fi
if [ -z ${VIASH_PAR_STRANDEDNESS_OUTPUT+x} ]; then
  VIASH_PAR_STRANDEDNESS_OUTPUT="RSeQC/inferexperiment/\$id.strandedness.txt"
fi
if [ -z ${VIASH_PAR_INNER_DIST_OUTPUT_STATS+x} ]; then
  VIASH_PAR_INNER_DIST_OUTPUT_STATS="RSeQC/innerdistance/\$id.inner_distance.stats"
fi
if [ -z ${VIASH_PAR_INNER_DIST_OUTPUT_DIST+x} ]; then
  VIASH_PAR_INNER_DIST_OUTPUT_DIST="RSeQC/innerdistance/txt/\$id.inner_distance.txt"
fi
if [ -z ${VIASH_PAR_INNER_DIST_OUTPUT_FREQ+x} ]; then
  VIASH_PAR_INNER_DIST_OUTPUT_FREQ="RSeQC/innerdistance/txt/\$id.inner_distance_freq.txt"
fi
if [ -z ${VIASH_PAR_INNER_DIST_OUTPUT_PLOT+x} ]; then
  VIASH_PAR_INNER_DIST_OUTPUT_PLOT="RSeQC/innerdistance/pdf/\$id.inner_distance_plot.pdf"
fi
if [ -z ${VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R+x} ]; then
  VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R="RSeQC/innerdistance/rscript/\$id.inner_distance_plot.r"
fi
if [ -z ${VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG+x} ]; then
  VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG="RSeQC/junctionannotation/log/\$id.junction_annotation.log"
fi
if [ -z ${VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R+x} ]; then
  VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R="RSeQC/junctionannotation/rscript/\$id.junction_annotation_plot.r"
fi
if [ -z ${VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED+x} ]; then
  VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED="RSeQC/junctionannotation/bed/\$id.junction_annotation.bed"
fi
if [ -z ${VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT+x} ]; then
  VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT="RSeQC/junctionannotation/bed/\$id.junction_annotation.Interact.bed"
fi
if [ -z ${VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET+x} ]; then
  VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET="RSeQC/junctionannotation/xls/\$id.junction_annotation.xls"
fi
if [ -z ${VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT+x} ]; then
  VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT="RSeQC/junctionannotation/pdf/\$id.splice_events.pdf"
fi
if [ -z ${VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT+x} ]; then
  VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT="RSeQC/junctionannotation/pdf/\$id.splice_junctions_plot.pdf"
fi
if [ -z ${VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R+x} ]; then
  VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R="RSeQC/junctionsaturation/rscript/\$id.junction_saturation_plot.r"
fi
if [ -z ${VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT+x} ]; then
  VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT="RSeQC/junctionsaturation/pdf/\$id.junction_saturation_plot.pdf"
fi
if [ -z ${VIASH_PAR_READ_DISTRIBUTION_OUTPUT+x} ]; then
  VIASH_PAR_READ_DISTRIBUTION_OUTPUT="RSeQC/readdistribution/\$id.read_distribution.txt"
fi
if [ -z ${VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R+x} ]; then
  VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R="RSeQC/readduplication/rscrpt/\$id.duplication_rate_plot.r"
fi
if [ -z ${VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT+x} ]; then
  VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT="RSeQC/readduplication/pdf/\$id.duplication_rate_plot.pdf"
fi
if [ -z ${VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING+x} ]; then
  VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING="RSeQC/readduplication/xls/\$id.duplication_rate_mapping.xls"
fi
if [ -z ${VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE+x} ]; then
  VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE="RSeQC/readduplication/xls/\$id.duplication_rate_sequencing.xls"
fi
if [ -z ${VIASH_PAR_TIN_OUTPUT_SUMMARY+x} ]; then
  VIASH_PAR_TIN_OUTPUT_SUMMARY="RSeQC/tin/txt/\$id.tin_summary.txt"
fi
if [ -z ${VIASH_PAR_TIN_OUTPUT_METRICS+x} ]; then
  VIASH_PAR_TIN_OUTPUT_METRICS="RSeQC/tin/xls/\$id.tin.xls"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX="dupradar/gene_data/\$id.dup_matrix.txt"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC="dupradar/mqc_intercept/\$id.dup_intercept_mqc.txt"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT="dupradar/box_plot/\$id.duprate_exp_boxplot.pdf"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT="dupradar/scatter_plot/\$id.duprate_exp_densityplot.pdf"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC="dupradar/density_curve/\$id.duprate_exp_density_curve_mqc.pdf"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM="dupradar/histogram/\$id.expression_hist.pdf"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE="dupradar/intercept_slope/\$id.intercept_slope.txt"
fi
if [ -z ${VIASH_PAR_QUALIMAP_QC_REPORT+x} ]; then
  VIASH_PAR_QUALIMAP_QC_REPORT="Qualimap/\$id.rnaseq_qc_results.txt"
fi
if [ -z ${VIASH_PAR_QUALIMAP_COUNTS+x} ]; then
  VIASH_PAR_QUALIMAP_COUNTS="Qualimap/\$id.counts.txt"
fi
if [ -z ${VIASH_PAR_QUALIMAP_REPORT+x} ]; then
  VIASH_PAR_QUALIMAP_REPORT="Qualimap/\$id.report.html"
fi
if [ -z ${VIASH_PAR_DESEQ2_OUTPUT+x} ]; then
  VIASH_PAR_DESEQ2_OUTPUT="deseq2_qc"
fi
if [ -z ${VIASH_PAR_DESEQ2_OUTPUT_PSEUDO+x} ]; then
  VIASH_PAR_DESEQ2_OUTPUT_PSEUDO="deseq2_qc_pseudo"
fi
if [ -z ${VIASH_PAR_MULTIQC_REPORT+x} ]; then
  VIASH_PAR_MULTIQC_REPORT="multiqc/multiqc_report.html"
fi
if [ -z ${VIASH_PAR_MULTIQC_DATA+x} ]; then
  VIASH_PAR_MULTIQC_DATA="multiqc/multiqc_data"
fi
if [ -z ${VIASH_PAR_MULTIQC_PLOTS+x} ]; then
  VIASH_PAR_MULTIQC_PLOTS="multiqc/multiqc_plots"
fi
if [ -z ${VIASH_PAR_PSEUDO_COUNTS_GENE+x} ]; then
  VIASH_PAR_PSEUDO_COUNTS_GENE="pseudo_alignment_quantification/gene_counts.tsv"
fi
if [ -z ${VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED+x} ]; then
  VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED="pseudo_alignment_quantification/gene_counts_length_scaled.tsv"
fi
if [ -z ${VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED+x} ]; then
  VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED="pseudo_alignment_quantification/gene_counts_scaled.tsv"
fi
if [ -z ${VIASH_PAR_PSEUDO_TPM_GENE+x} ]; then
  VIASH_PAR_PSEUDO_TPM_GENE="pseudo_alignment_quantification/gene_tpm.tsv"
fi
if [ -z ${VIASH_PAR_PSEUDO_TPM_TRANSCRIPT+x} ]; then
  VIASH_PAR_PSEUDO_TPM_TRANSCRIPT="pseudo_alignment_quantification/transcript_tpm.tsv"
fi
if [ -z ${VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT+x} ]; then
  VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT="pseudo_alignment_quantification/transcript_counts.tsv"
fi
if [ -z ${VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT+x} ]; then
  VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT="pseudo_alignment_quantification/quant_merged_summarizedexperiment"
fi

# check whether required files exist
if [ ! -z "$VIASH_PAR_FASTQ_1" ]; then
  IFS=';'
  set -f
  for file in $VIASH_PAR_FASTQ_1; do
    unset IFS
    if [ ! -e "$file" ]; then
      ViashError "Input file '$file' does not exist."
      exit 1
    fi
  done
  set +f
fi
if [ ! -z "$VIASH_PAR_FASTA" ] && [ ! -e "$VIASH_PAR_FASTA" ]; then
  ViashError "Input file '$VIASH_PAR_FASTA' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_GTF" ] && [ ! -e "$VIASH_PAR_GTF" ]; then
  ViashError "Input file '$VIASH_PAR_GTF' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_GFF" ] && [ ! -e "$VIASH_PAR_GFF" ]; then
  ViashError "Input file '$VIASH_PAR_GFF' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_ADDITIONAL_FASTA" ] && [ ! -e "$VIASH_PAR_ADDITIONAL_FASTA" ]; then
  ViashError "Input file '$VIASH_PAR_ADDITIONAL_FASTA' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_TRANSCRIPT_FASTA" ] && [ ! -e "$VIASH_PAR_TRANSCRIPT_FASTA" ]; then
  ViashError "Input file '$VIASH_PAR_TRANSCRIPT_FASTA' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_GENE_BED" ] && [ ! -e "$VIASH_PAR_GENE_BED" ]; then
  ViashError "Input file '$VIASH_PAR_GENE_BED' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_SPLICESITES" ] && [ ! -e "$VIASH_PAR_SPLICESITES" ]; then
  ViashError "Input file '$VIASH_PAR_SPLICESITES' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_STAR_INDEX" ] && [ ! -e "$VIASH_PAR_STAR_INDEX" ]; then
  ViashError "Input file '$VIASH_PAR_STAR_INDEX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_RSEM_INDEX" ] && [ ! -e "$VIASH_PAR_RSEM_INDEX" ]; then
  ViashError "Input file '$VIASH_PAR_RSEM_INDEX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_SALMON_INDEX" ] && [ ! -e "$VIASH_PAR_SALMON_INDEX" ]; then
  ViashError "Input file '$VIASH_PAR_SALMON_INDEX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_KALLISTO_INDEX" ] && [ ! -e "$VIASH_PAR_KALLISTO_INDEX" ]; then
  ViashError "Input file '$VIASH_PAR_KALLISTO_INDEX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_BBSPLIT_FASTA_LIST" ]; then
  IFS=';'
  set -f
  for file in $VIASH_PAR_BBSPLIT_FASTA_LIST; do
    unset IFS
    if [ ! -e "$file" ]; then
      ViashError "Input file '$file' does not exist."
      exit 1
    fi
  done
  set +f
fi
if [ ! -z "$VIASH_PAR_BBSPLIT_INDEX" ] && [ ! -e "$VIASH_PAR_BBSPLIT_INDEX" ]; then
  ViashError "Input file '$VIASH_PAR_BBSPLIT_INDEX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_RIBO_DATABASE_MANIFEST" ] && [ ! -e "$VIASH_PAR_RIBO_DATABASE_MANIFEST" ]; then
  ViashError "Input file '$VIASH_PAR_RIBO_DATABASE_MANIFEST' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_MULTIQC_CUSTOM_CONFIG" ] && [ ! -e "$VIASH_PAR_MULTIQC_CUSTOM_CONFIG" ]; then
  ViashError "Input file '$VIASH_PAR_MULTIQC_CUSTOM_CONFIG' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_MULTIQC_METHODS_DESCRIPTION" ] && [ ! -e "$VIASH_PAR_MULTIQC_METHODS_DESCRIPTION" ]; then
  ViashError "Input file '$VIASH_PAR_MULTIQC_METHODS_DESCRIPTION' does not exist."
  exit 1
fi

# check whether parameters values are of the right type
if [[ -n "$VIASH_PAR_GENCODE" ]]; then
  if ! [[ "$VIASH_PAR_GENCODE" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--gencode' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_MIN_TRIMMED_READS" ]]; then
  if ! [[ "$VIASH_PAR_MIN_TRIMMED_READS" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--min_trimmed_reads' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_REMOVE_RIBO_RNA" ]]; then
  if ! [[ "$VIASH_PAR_REMOVE_RIBO_RNA" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--remove_ribo_rna' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_WITH_UMI" ]]; then
  if ! [[ "$VIASH_PAR_WITH_UMI" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--with_umi' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_UMI_DISCARD_READ" ]]; then
  if ! [[ "$VIASH_PAR_UMI_DISCARD_READ" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--umi_discard_read' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_UMI_DEDUP_STATS" ]]; then
  if ! [[ "$VIASH_PAR_UMI_DEDUP_STATS" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--umi_dedup_stats' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_PSEUDO_ALIGNER_KMER_SIZE" ]]; then
  if ! [[ "$VIASH_PAR_PSEUDO_ALIGNER_KMER_SIZE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--pseudo_aligner_kmer_size' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH" ]]; then
  if ! [[ "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--kallisto_quant_fragment_length' has to be a double. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD" ]]; then
  if ! [[ "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--kallisto_quant_fragment_length_sd' has to be a double. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_BAM_CSI_INDEX" ]]; then
  if ! [[ "$VIASH_PAR_BAM_CSI_INDEX" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--bam_csi_index' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_MIN_MAPPED_READS" ]]; then
  if ! [[ "$VIASH_PAR_MIN_MAPPED_READS" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--min_mapped_reads' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_STRINGTIE_IGNORE_GTF" ]]; then
  if ! [[ "$VIASH_PAR_STRINGTIE_IGNORE_GTF" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--stringtie_ignore_gtf' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SAVE_UNALIGNED" ]]; then
  if ! [[ "$VIASH_PAR_SAVE_UNALIGNED" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--save_unaligned' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SAVE_ALIGN_INTERMEDS" ]]; then
  if ! [[ "$VIASH_PAR_SAVE_ALIGN_INTERMEDS" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--save_align_intermeds' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_ALIGNMENT" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_ALIGNMENT" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_alignment' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_PSEUDO_ALIGNMENT" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_PSEUDO_ALIGNMENT" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_pseudo_alignment' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_FASTQC" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_FASTQC" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_fastqc' has to be a boolean. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_TRIMMING" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_TRIMMING" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_trimming' has to be a boolean. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_UMI_EXTRACT" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_UMI_EXTRACT" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_umi_extract' has to be a boolean. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_QC" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_QC" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_qc' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_MARKDUPLICATES" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_MARKDUPLICATES" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_markduplicates' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_STRINGTIE" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_STRINGTIE" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_stringtie' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_BIOTYPE_QC" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_BIOTYPE_QC" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_biotype_qc' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_BIGWIG" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_BIGWIG" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_bigwig' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_PRESEQ" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_PRESEQ" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_preseq' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_DUPRADAR" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_DUPRADAR" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_dupradar' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_QUALIMAP" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_QUALIMAP" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_qualimap' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_RSEQC" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_RSEQC" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_rseqc' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_MULTIQC" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_MULTIQC" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_multiqc' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_DESEQ2_VST" ]]; then
  if ! [[ "$VIASH_PAR_DESEQ2_VST" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--deseq2_vst' has to be a boolean. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_META_CPUS" ]]; then
  if ! [[ "$VIASH_META_CPUS" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError 'cpus' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_META_MEMORY_B" ]]; then
  if ! [[ "$VIASH_META_MEMORY_B" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError 'memory_b' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_META_MEMORY_KB" ]]; then
  if ! [[ "$VIASH_META_MEMORY_KB" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError 'memory_kb' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_META_MEMORY_MB" ]]; then
  if ! [[ "$VIASH_META_MEMORY_MB" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError 'memory_mb' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_META_MEMORY_GB" ]]; then
  if ! [[ "$VIASH_META_MEMORY_GB" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError 'memory_gb' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_META_MEMORY_TB" ]]; then
  if ! [[ "$VIASH_META_MEMORY_TB" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError 'memory_tb' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_META_MEMORY_PB" ]]; then
  if ! [[ "$VIASH_META_MEMORY_PB" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError 'memory_pb' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_META_MEMORY_KIB" ]]; then
  if ! [[ "$VIASH_META_MEMORY_KIB" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError 'memory_kib' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_META_MEMORY_MIB" ]]; then
  if ! [[ "$VIASH_META_MEMORY_MIB" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError 'memory_mib' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_META_MEMORY_GIB" ]]; then
  if ! [[ "$VIASH_META_MEMORY_GIB" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError 'memory_gib' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_META_MEMORY_TIB" ]]; then
  if ! [[ "$VIASH_META_MEMORY_TIB" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError 'memory_tib' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_META_MEMORY_PIB" ]]; then
  if ! [[ "$VIASH_META_MEMORY_PIB" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError 'memory_pib' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi

# check whether value is belongs to a set of choices
if [ ! -z "$VIASH_PAR_STRANDEDNESS" ]; then
  VIASH_PAR_STRANDEDNESS_CHOICES=("unstranded;forward;reverse;auto")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_STRANDEDNESS_CHOICES[*]};" =~ ";$VIASH_PAR_STRANDEDNESS;" ]]; then
    ViashError '--strandedness' specified value of \'$VIASH_PAR_STRANDEDNESS\' is not in the list of allowed values. Use "--help" to get more information on the parameters.
    exit 1
  fi
  set +f
  unset IFS
fi

if [ ! -z "$VIASH_PAR_TRIMMER" ]; then
  VIASH_PAR_TRIMMER_CHOICES=("trimgalore;fastp")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_TRIMMER_CHOICES[*]};" =~ ";$VIASH_PAR_TRIMMER;" ]]; then
    ViashError '--trimmer' specified value of \'$VIASH_PAR_TRIMMER\' is not in the list of allowed values. Use "--help" to get more information on the parameters.
    exit 1
  fi
  set +f
  unset IFS
fi

if [ ! -z "$VIASH_PAR_UMITOOLS_EXTRACT_METHOD" ]; then
  VIASH_PAR_UMITOOLS_EXTRACT_METHOD_CHOICES=("string;regex")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_UMITOOLS_EXTRACT_METHOD_CHOICES[*]};" =~ ";$VIASH_PAR_UMITOOLS_EXTRACT_METHOD;" ]]; then
    ViashError '--umitools_extract_method' specified value of \'$VIASH_PAR_UMITOOLS_EXTRACT_METHOD\' is not in the list of allowed values. Use "--help" to get more information on the parameters.
    exit 1
  fi
  set +f
  unset IFS
fi

if [ ! -z "$VIASH_PAR_UMI_DISCARD_READ" ]; then
  VIASH_PAR_UMI_DISCARD_READ_CHOICES=("0;1;2")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_UMI_DISCARD_READ_CHOICES[*]};" =~ ";$VIASH_PAR_UMI_DISCARD_READ;" ]]; then
    ViashError '--umi_discard_read' specified value of \'$VIASH_PAR_UMI_DISCARD_READ\' is not in the list of allowed values. Use "--help" to get more information on the parameters.
    exit 1
  fi
  set +f
  unset IFS
fi

if [ ! -z "$VIASH_PAR_UMITOOLS_GROUPING_METHOD" ]; then
  VIASH_PAR_UMITOOLS_GROUPING_METHOD_CHOICES=("unique;percentile;cluster;adjacency;directional")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_UMITOOLS_GROUPING_METHOD_CHOICES[*]};" =~ ";$VIASH_PAR_UMITOOLS_GROUPING_METHOD;" ]]; then
    ViashError '--umitools_grouping_method' specified value of \'$VIASH_PAR_UMITOOLS_GROUPING_METHOD\' is not in the list of allowed values. Use "--help" to get more information on the parameters.
    exit 1
  fi
  set +f
  unset IFS
fi

if [ ! -z "$VIASH_PAR_ALIGNER" ]; then
  VIASH_PAR_ALIGNER_CHOICES=("star_salmon;star_rsem;hisat2")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_ALIGNER_CHOICES[*]};" =~ ";$VIASH_PAR_ALIGNER;" ]]; then
    ViashError '--aligner' specified value of \'$VIASH_PAR_ALIGNER\' is not in the list of allowed values. Use "--help" to get more information on the parameters.
    exit 1
  fi
  set +f
  unset IFS
fi

if [ ! -z "$VIASH_PAR_PSEUDO_ALIGNER" ]; then
  VIASH_PAR_PSEUDO_ALIGNER_CHOICES=("salmon;kallisto")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_PSEUDO_ALIGNER_CHOICES[*]};" =~ ";$VIASH_PAR_PSEUDO_ALIGNER;" ]]; then
    ViashError '--pseudo_aligner' specified value of \'$VIASH_PAR_PSEUDO_ALIGNER\' is not in the list of allowed values. Use "--help" to get more information on the parameters.
    exit 1
  fi
  set +f
  unset IFS
fi

if [ ! -z "$VIASH_PAR_RSEQC_MODULES" ]; then
  VIASH_PAR_RSEQC_MODULES_CHOICES=("bam_stat;inner_distance;infer_experiment;junction_annotation;junction_saturation;read_distribution;read_duplication;tin")
  IFS=';'
  set -f
  for val in $VIASH_PAR_RSEQC_MODULES; do
    if ! [[ ";${VIASH_PAR_RSEQC_MODULES_CHOICES[*]};" =~ ";${val};" ]]; then
      ViashError '--rseqc_modules' specified value of \'${val}\' is not in the list of allowed values. Use "--help" to get more information on the parameters.
      exit 1
    fi
  done
  set +f
  unset IFS
fi

# create parent directories of output files, if so desired
if [ ! -z "$VIASH_PAR_OUTPUT_FASTA" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT_FASTA")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_OUTPUT_FASTA")"
fi
if [ ! -z "$VIASH_PAR_OUTPUT_GTF" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT_GTF")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_OUTPUT_GTF")"
fi
if [ ! -z "$VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA")"
fi
if [ ! -z "$VIASH_PAR_OUTPUT_GENE_BED" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT_GENE_BED")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_OUTPUT_GENE_BED")"
fi
if [ ! -z "$VIASH_PAR_OUTPUT_STAR_INDEX" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT_STAR_INDEX")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_OUTPUT_STAR_INDEX")"
fi
if [ ! -z "$VIASH_PAR_OUTPUT_SALMON_INDEX" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT_SALMON_INDEX")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_OUTPUT_SALMON_INDEX")"
fi
if [ ! -z "$VIASH_PAR_OUTPUT_BBSPLIT_INDEX" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT_BBSPLIT_INDEX")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_OUTPUT_BBSPLIT_INDEX")"
fi
if [ ! -z "$VIASH_PAR_OUTPUT_KALLISTO_INDEX" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT_KALLISTO_INDEX")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_OUTPUT_KALLISTO_INDEX")"
fi
if [ ! -z "$VIASH_PAR_OUTPUT_FASTQ_1" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT_FASTQ_1")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_OUTPUT_FASTQ_1")"
fi
if [ ! -z "$VIASH_PAR_OUTPUT_FASTQ_2" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT_FASTQ_2")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_OUTPUT_FASTQ_2")"
fi
if [ ! -z "$VIASH_PAR_FASTQC_HTML_1" ] && [ ! -d "$(dirname "$VIASH_PAR_FASTQC_HTML_1")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_FASTQC_HTML_1")"
fi
if [ ! -z "$VIASH_PAR_FASTQC_HTML_2" ] && [ ! -d "$(dirname "$VIASH_PAR_FASTQC_HTML_2")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_FASTQC_HTML_2")"
fi
if [ ! -z "$VIASH_PAR_FASTQC_ZIP_1" ] && [ ! -d "$(dirname "$VIASH_PAR_FASTQC_ZIP_1")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_FASTQC_ZIP_1")"
fi
if [ ! -z "$VIASH_PAR_FASTQC_ZIP_2" ] && [ ! -d "$(dirname "$VIASH_PAR_FASTQC_ZIP_2")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_FASTQC_ZIP_2")"
fi
if [ ! -z "$VIASH_PAR_TRIM_HTML_1" ] && [ ! -d "$(dirname "$VIASH_PAR_TRIM_HTML_1")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TRIM_HTML_1")"
fi
if [ ! -z "$VIASH_PAR_TRIM_HTML_2" ] && [ ! -d "$(dirname "$VIASH_PAR_TRIM_HTML_2")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TRIM_HTML_2")"
fi
if [ ! -z "$VIASH_PAR_TRIM_ZIP_1" ] && [ ! -d "$(dirname "$VIASH_PAR_TRIM_ZIP_1")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TRIM_ZIP_1")"
fi
if [ ! -z "$VIASH_PAR_TRIM_ZIP_2" ] && [ ! -d "$(dirname "$VIASH_PAR_TRIM_ZIP_2")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TRIM_ZIP_2")"
fi
if [ ! -z "$VIASH_PAR_TRIM_LOG_1" ] && [ ! -d "$(dirname "$VIASH_PAR_TRIM_LOG_1")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TRIM_LOG_1")"
fi
if [ ! -z "$VIASH_PAR_TRIM_LOG_2" ] && [ ! -d "$(dirname "$VIASH_PAR_TRIM_LOG_2")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TRIM_LOG_2")"
fi
if [ ! -z "$VIASH_PAR_FASTP_TRIM_JSON" ] && [ ! -d "$(dirname "$VIASH_PAR_FASTP_TRIM_JSON")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_FASTP_TRIM_JSON")"
fi
if [ ! -z "$VIASH_PAR_FASTP_TRIM_HTML" ] && [ ! -d "$(dirname "$VIASH_PAR_FASTP_TRIM_HTML")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_FASTP_TRIM_HTML")"
fi
if [ ! -z "$VIASH_PAR_SORTMERNA_LOG" ] && [ ! -d "$(dirname "$VIASH_PAR_SORTMERNA_LOG")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_SORTMERNA_LOG")"
fi
if [ ! -z "$VIASH_PAR_STAR_ALIGNMENT" ] && [ ! -d "$(dirname "$VIASH_PAR_STAR_ALIGNMENT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_STAR_ALIGNMENT")"
fi
if [ ! -z "$VIASH_PAR_GENOME_BAM_SORTED" ] && [ ! -d "$(dirname "$VIASH_PAR_GENOME_BAM_SORTED")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_GENOME_BAM_SORTED")"
fi
if [ ! -z "$VIASH_PAR_GENOME_BAM_INDEX" ] && [ ! -d "$(dirname "$VIASH_PAR_GENOME_BAM_INDEX")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_GENOME_BAM_INDEX")"
fi
if [ ! -z "$VIASH_PAR_TRANSCRIPTOME_BAM" ] && [ ! -d "$(dirname "$VIASH_PAR_TRANSCRIPTOME_BAM")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TRANSCRIPTOME_BAM")"
fi
if [ ! -z "$VIASH_PAR_TRANSCRIPTOME_BAM_INDEX" ] && [ ! -d "$(dirname "$VIASH_PAR_TRANSCRIPTOME_BAM_INDEX")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TRANSCRIPTOME_BAM_INDEX")"
fi
if [ ! -z "$VIASH_PAR_STAR_LOG" ] && [ ! -d "$(dirname "$VIASH_PAR_STAR_LOG")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_STAR_LOG")"
fi
if [ ! -z "$VIASH_PAR_GENOME_BAM_STATS" ] && [ ! -d "$(dirname "$VIASH_PAR_GENOME_BAM_STATS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_GENOME_BAM_STATS")"
fi
if [ ! -z "$VIASH_PAR_GENOME_BAM_FLAGSTAT" ] && [ ! -d "$(dirname "$VIASH_PAR_GENOME_BAM_FLAGSTAT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_GENOME_BAM_FLAGSTAT")"
fi
if [ ! -z "$VIASH_PAR_GENOME_BAM_IDXSTATS" ] && [ ! -d "$(dirname "$VIASH_PAR_GENOME_BAM_IDXSTATS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_GENOME_BAM_IDXSTATS")"
fi
if [ ! -z "$VIASH_PAR_TRANSCRIPTOME_BAM_STATS" ] && [ ! -d "$(dirname "$VIASH_PAR_TRANSCRIPTOME_BAM_STATS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TRANSCRIPTOME_BAM_STATS")"
fi
if [ ! -z "$VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT" ] && [ ! -d "$(dirname "$VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT")"
fi
if [ ! -z "$VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS" ] && [ ! -d "$(dirname "$VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS")"
fi
if [ ! -z "$VIASH_PAR_SALMON_QUANT_RESULTS" ] && [ ! -d "$(dirname "$VIASH_PAR_SALMON_QUANT_RESULTS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_SALMON_QUANT_RESULTS")"
fi
if [ ! -z "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE" ] && [ ! -d "$(dirname "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE")"
fi
if [ ! -z "$VIASH_PAR_PSEUDO_QUANT_RESULTS" ] && [ ! -d "$(dirname "$VIASH_PAR_PSEUDO_QUANT_RESULTS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_PSEUDO_QUANT_RESULTS")"
fi
if [ ! -z "$VIASH_PAR_RSEM_COUNTS_GENE" ] && [ ! -d "$(dirname "$VIASH_PAR_RSEM_COUNTS_GENE")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_RSEM_COUNTS_GENE")"
fi
if [ ! -z "$VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS" ] && [ ! -d "$(dirname "$VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS")"
fi
if [ ! -z "$VIASH_PAR_BAM_STAR_RSEM" ] && [ ! -d "$(dirname "$VIASH_PAR_BAM_STAR_RSEM")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_BAM_STAR_RSEM")"
fi
if [ ! -z "$VIASH_PAR_BAM_GENOME_RSEM" ] && [ ! -d "$(dirname "$VIASH_PAR_BAM_GENOME_RSEM")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_BAM_GENOME_RSEM")"
fi
if [ ! -z "$VIASH_PAR_BAM_TRANSCRIPT_RSEM" ] && [ ! -d "$(dirname "$VIASH_PAR_BAM_TRANSCRIPT_RSEM")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_BAM_TRANSCRIPT_RSEM")"
fi
if [ ! -z "$VIASH_PAR_TPM_GENE" ] && [ ! -d "$(dirname "$VIASH_PAR_TPM_GENE")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TPM_GENE")"
fi
if [ ! -z "$VIASH_PAR_COUNTS_GENE" ] && [ ! -d "$(dirname "$VIASH_PAR_COUNTS_GENE")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_COUNTS_GENE")"
fi
if [ ! -z "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED" ] && [ ! -d "$(dirname "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED")"
fi
if [ ! -z "$VIASH_PAR_COUNTS_GENE_SCALED" ] && [ ! -d "$(dirname "$VIASH_PAR_COUNTS_GENE_SCALED")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_COUNTS_GENE_SCALED")"
fi
if [ ! -z "$VIASH_PAR_TPM_TRANSCRIPT" ] && [ ! -d "$(dirname "$VIASH_PAR_TPM_TRANSCRIPT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TPM_TRANSCRIPT")"
fi
if [ ! -z "$VIASH_PAR_COUNTS_TRANSCRIPT" ] && [ ! -d "$(dirname "$VIASH_PAR_COUNTS_TRANSCRIPT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_COUNTS_TRANSCRIPT")"
fi
if [ ! -z "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ] && [ ! -d "$(dirname "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT")"
fi
if [ ! -z "$VIASH_PAR_MARKDUPLICATES_METRICS" ] && [ ! -d "$(dirname "$VIASH_PAR_MARKDUPLICATES_METRICS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_MARKDUPLICATES_METRICS")"
fi
if [ ! -z "$VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF" ] && [ ! -d "$(dirname "$VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF")"
fi
if [ ! -z "$VIASH_PAR_STRINGTIE_COVERAGE_GTF" ] && [ ! -d "$(dirname "$VIASH_PAR_STRINGTIE_COVERAGE_GTF")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_STRINGTIE_COVERAGE_GTF")"
fi
if [ ! -z "$VIASH_PAR_STRINGTIE_ABUNDANCE" ] && [ ! -d "$(dirname "$VIASH_PAR_STRINGTIE_ABUNDANCE")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_STRINGTIE_ABUNDANCE")"
fi
if [ ! -z "$VIASH_PAR_STRINGTIE_BALLGOWN" ] && [ ! -d "$(dirname "$VIASH_PAR_STRINGTIE_BALLGOWN")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_STRINGTIE_BALLGOWN")"
fi
if [ ! -z "$VIASH_PAR_FEATURECOUNTS" ] && [ ! -d "$(dirname "$VIASH_PAR_FEATURECOUNTS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_FEATURECOUNTS")"
fi
if [ ! -z "$VIASH_PAR_FEATURECOUNTS_SUMMARY" ] && [ ! -d "$(dirname "$VIASH_PAR_FEATURECOUNTS_SUMMARY")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_FEATURECOUNTS_SUMMARY")"
fi
if [ ! -z "$VIASH_PAR_FEATURECOUNTS_MULTIQC" ] && [ ! -d "$(dirname "$VIASH_PAR_FEATURECOUNTS_MULTIQC")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_FEATURECOUNTS_MULTIQC")"
fi
if [ ! -z "$VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC" ] && [ ! -d "$(dirname "$VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC")"
fi
if [ ! -z "$VIASH_PAR_BEDGRAPH_FORWARD" ] && [ ! -d "$(dirname "$VIASH_PAR_BEDGRAPH_FORWARD")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_BEDGRAPH_FORWARD")"
fi
if [ ! -z "$VIASH_PAR_BEDGRAPH_REVERSE" ] && [ ! -d "$(dirname "$VIASH_PAR_BEDGRAPH_REVERSE")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_BEDGRAPH_REVERSE")"
fi
if [ ! -z "$VIASH_PAR_BIGWIG_FORWARD" ] && [ ! -d "$(dirname "$VIASH_PAR_BIGWIG_FORWARD")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_BIGWIG_FORWARD")"
fi
if [ ! -z "$VIASH_PAR_BIGWIG_REVERSE" ] && [ ! -d "$(dirname "$VIASH_PAR_BIGWIG_REVERSE")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_BIGWIG_REVERSE")"
fi
if [ ! -z "$VIASH_PAR_PRESEQ_OUTPUT" ] && [ ! -d "$(dirname "$VIASH_PAR_PRESEQ_OUTPUT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_PRESEQ_OUTPUT")"
fi
if [ ! -z "$VIASH_PAR_BAMSTAT_OUTPUT" ] && [ ! -d "$(dirname "$VIASH_PAR_BAMSTAT_OUTPUT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_BAMSTAT_OUTPUT")"
fi
if [ ! -z "$VIASH_PAR_STRANDEDNESS_OUTPUT" ] && [ ! -d "$(dirname "$VIASH_PAR_STRANDEDNESS_OUTPUT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_STRANDEDNESS_OUTPUT")"
fi
if [ ! -z "$VIASH_PAR_INNER_DIST_OUTPUT_STATS" ] && [ ! -d "$(dirname "$VIASH_PAR_INNER_DIST_OUTPUT_STATS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_INNER_DIST_OUTPUT_STATS")"
fi
if [ ! -z "$VIASH_PAR_INNER_DIST_OUTPUT_DIST" ] && [ ! -d "$(dirname "$VIASH_PAR_INNER_DIST_OUTPUT_DIST")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_INNER_DIST_OUTPUT_DIST")"
fi
if [ ! -z "$VIASH_PAR_INNER_DIST_OUTPUT_FREQ" ] && [ ! -d "$(dirname "$VIASH_PAR_INNER_DIST_OUTPUT_FREQ")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_INNER_DIST_OUTPUT_FREQ")"
fi
if [ ! -z "$VIASH_PAR_INNER_DIST_OUTPUT_PLOT" ] && [ ! -d "$(dirname "$VIASH_PAR_INNER_DIST_OUTPUT_PLOT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_INNER_DIST_OUTPUT_PLOT")"
fi
if [ ! -z "$VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R" ] && [ ! -d "$(dirname "$VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R")"
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG" ] && [ ! -d "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG")"
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R" ] && [ ! -d "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R")"
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED" ] && [ ! -d "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED")"
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT" ] && [ ! -d "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT")"
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET" ] && [ ! -d "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET")"
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT" ] && [ ! -d "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT")"
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT" ] && [ ! -d "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT")"
fi
if [ ! -z "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R" ] && [ ! -d "$(dirname "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R")"
fi
if [ ! -z "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT" ] && [ ! -d "$(dirname "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT")"
fi
if [ ! -z "$VIASH_PAR_READ_DISTRIBUTION_OUTPUT" ] && [ ! -d "$(dirname "$VIASH_PAR_READ_DISTRIBUTION_OUTPUT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_READ_DISTRIBUTION_OUTPUT")"
fi
if [ ! -z "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R" ] && [ ! -d "$(dirname "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R")"
fi
if [ ! -z "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT" ] && [ ! -d "$(dirname "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT")"
fi
if [ ! -z "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING" ] && [ ! -d "$(dirname "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING")"
fi
if [ ! -z "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE" ] && [ ! -d "$(dirname "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE")"
fi
if [ ! -z "$VIASH_PAR_TIN_OUTPUT_SUMMARY" ] && [ ! -d "$(dirname "$VIASH_PAR_TIN_OUTPUT_SUMMARY")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TIN_OUTPUT_SUMMARY")"
fi
if [ ! -z "$VIASH_PAR_TIN_OUTPUT_METRICS" ] && [ ! -d "$(dirname "$VIASH_PAR_TIN_OUTPUT_METRICS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_TIN_OUTPUT_METRICS")"
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX" ] && [ ! -d "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX")"
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC" ] && [ ! -d "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC")"
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT" ] && [ ! -d "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT")"
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT" ] && [ ! -d "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT")"
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC" ] && [ ! -d "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC")"
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM" ] && [ ! -d "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM")"
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE" ] && [ ! -d "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE")"
fi
if [ ! -z "$VIASH_PAR_QUALIMAP_QC_REPORT" ] && [ ! -d "$(dirname "$VIASH_PAR_QUALIMAP_QC_REPORT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_QUALIMAP_QC_REPORT")"
fi
if [ ! -z "$VIASH_PAR_QUALIMAP_COUNTS" ] && [ ! -d "$(dirname "$VIASH_PAR_QUALIMAP_COUNTS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_QUALIMAP_COUNTS")"
fi
if [ ! -z "$VIASH_PAR_QUALIMAP_REPORT" ] && [ ! -d "$(dirname "$VIASH_PAR_QUALIMAP_REPORT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_QUALIMAP_REPORT")"
fi
if [ ! -z "$VIASH_PAR_DESEQ2_OUTPUT" ] && [ ! -d "$(dirname "$VIASH_PAR_DESEQ2_OUTPUT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_DESEQ2_OUTPUT")"
fi
if [ ! -z "$VIASH_PAR_DESEQ2_OUTPUT_PSEUDO" ] && [ ! -d "$(dirname "$VIASH_PAR_DESEQ2_OUTPUT_PSEUDO")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_DESEQ2_OUTPUT_PSEUDO")"
fi
if [ ! -z "$VIASH_PAR_MULTIQC_REPORT" ] && [ ! -d "$(dirname "$VIASH_PAR_MULTIQC_REPORT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_MULTIQC_REPORT")"
fi
if [ ! -z "$VIASH_PAR_MULTIQC_DATA" ] && [ ! -d "$(dirname "$VIASH_PAR_MULTIQC_DATA")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_MULTIQC_DATA")"
fi
if [ ! -z "$VIASH_PAR_MULTIQC_PLOTS" ] && [ ! -d "$(dirname "$VIASH_PAR_MULTIQC_PLOTS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_MULTIQC_PLOTS")"
fi
if [ ! -z "$VIASH_PAR_MULTIQC_VERSIONS" ] && [ ! -d "$(dirname "$VIASH_PAR_MULTIQC_VERSIONS")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_MULTIQC_VERSIONS")"
fi
if [ ! -z "$VIASH_PAR_PSEUDO_COUNTS_GENE" ] && [ ! -d "$(dirname "$VIASH_PAR_PSEUDO_COUNTS_GENE")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_PSEUDO_COUNTS_GENE")"
fi
if [ ! -z "$VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED" ] && [ ! -d "$(dirname "$VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED")"
fi
if [ ! -z "$VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED" ] && [ ! -d "$(dirname "$VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED")"
fi
if [ ! -z "$VIASH_PAR_PSEUDO_TPM_GENE" ] && [ ! -d "$(dirname "$VIASH_PAR_PSEUDO_TPM_GENE")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_PSEUDO_TPM_GENE")"
fi
if [ ! -z "$VIASH_PAR_PSEUDO_TPM_TRANSCRIPT" ] && [ ! -d "$(dirname "$VIASH_PAR_PSEUDO_TPM_TRANSCRIPT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_PSEUDO_TPM_TRANSCRIPT")"
fi
if [ ! -z "$VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT" ] && [ ! -d "$(dirname "$VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT")"
fi
if [ ! -z "$VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ] && [ ! -d "$(dirname "$VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT")"
fi

if  [ "$VIASH_ENGINE_ID" == "native" ]  ; then
  if [ "$VIASH_MODE" == "run" ]; then
    VIASH_CMD="bash"
  else
    ViashError "Engine '$VIASH_ENGINE_ID' does not support mode '$VIASH_MODE'."
    exit 1
  fi
fi


# set dependency paths
VIASH_DEP_WORKFLOWS_PREPARE_GENOME="$VIASH_META_RESOURCES_DIR/../../../nextflow/workflows/prepare_genome/main.nf"
VIASH_DEP_CAT_FASTQ="$VIASH_META_RESOURCES_DIR/../../../nextflow/cat_fastq/main.nf"
VIASH_DEP_WORKFLOWS_PRE_PROCESSING="$VIASH_META_RESOURCES_DIR/../../../nextflow/workflows/pre_processing/main.nf"
VIASH_DEP_WORKFLOWS_GENOME_ALIGNMENT_AND_QUANT="$VIASH_META_RESOURCES_DIR/../../../nextflow/workflows/genome_alignment_and_quant/main.nf"
VIASH_DEP_WORKFLOWS_PSEUDO_ALIGNMENT_AND_QUANT="$VIASH_META_RESOURCES_DIR/../../../nextflow/workflows/pseudo_alignment_and_quant/main.nf"
VIASH_DEP_WORKFLOWS_POST_PROCESSING="$VIASH_META_RESOURCES_DIR/../../../nextflow/workflows/post_processing/main.nf"
VIASH_DEP_WORKFLOWS_QUALITY_CONTROL="$VIASH_META_RESOURCES_DIR/../../../nextflow/workflows/quality_control/main.nf"

ViashDebug "Running command: $(echo $VIASH_CMD)"
cat << VIASHEOF | eval $VIASH_CMD
set -e
tempscript=\$(mktemp "$VIASH_META_TEMP_DIR/viash-run-rnaseq-XXXXXX").nf
function clean_up {
  rm "\$tempscript"
}
function interrupt {
  echo -e "\nCTRL-C Pressed..."
  exit 1
}
trap clean_up EXIT
trap interrupt INT SIGINT
cat > "\$tempscript" << 'VIASHMAIN'
//// VIASH START
// The following code has been auto-generated by Viash.

//// VIASH END
workflow run_wf {
  take:
    input_ch

  main:

    reference_ch = input_ch

      | map { id, state ->
        def biotype = state.gencode ? "gene_type" : state.featurecounts_group_type 
        def filter_gtf = 
          (
            ( !state.skip_alignment && state.aligner) // Condition 1: Alignment is required and aligner is set
            || ( !state.skip_pseudo_alignment && state.pseudo_aligner ) // Condition 2: Pseudoalignment is required and pseudoaligner is set 
            || ( !state.transcript_fasta )  // Condition 3: Transcript FASTA file is not provided
          ) 
          &&
          ( !state.skip_gtf_filter )  // Condition 4: --skip_gtf_filter is not provided
        [ id, state + [ biotype: biotype, filter_gtf: filter_gtf ] ]
      } 
      
      | toSortedList
      
      | map { list -> 
        [ "ref", [
          fasta: list.collect { id, state -> state.fasta }.unique()[0],
          gtf: list.collect { id, state -> state.gtf }.unique()[0], 
          gff: list.collect { id, state -> state.gff }.unique()[0], 
          additional_fasta: list.collect { id, state -> state.additional_fasta }.unique()[0],
          transcript_fasta:list.collect { id, state -> state.transcript_fasta }.unique()[0], 
          gene_bed: list.collect { id, state -> state.gene_bed }.unique()[0],
          bbsplit_fasta_list: list.collect { id, state -> state.bbsplit_fasta_list }.unique()[0],
          aligner: list.collect { id, state -> state.aligner }.unique()[0],
          pseudo_aligner: list.collect { id, state -> state.pseudo_aligner }.unique()[0],
          star_index: list.collect { id, state -> state.star_index }.unique()[0],
          rsem_index: list.collect { id, state -> state.rsem_index }.unique()[0],
          salmon_index: list.collect { id, state -> state.salmon_index }.unique()[0],
          kallisto_index: list.collect { id, state -> state.kallisto_index }.unique()[0],
          // splicesites: list.collect { id, state -> state.splicesites }.unique()[0],
          // hisat2_index: list.collect { id, state -> state.hisat2_index }.unique()[0],
          bbsplit_index: list.collect { id, state -> state.bbsplit_index }.unique()[0],
          // See: 
          skip_bbsplit: true, // list.collect { id, state -> state.skip_bbsplit }.unique()[0],
          skip_alignment: list.collect { id, state -> state.skip_alignment }.unique()[0],
          gencode: list.collect { id, state -> state.gencode }.unique()[0],
          biotype: list.collect { id, state -> state.biotype }.unique()[0], 
          star_sjdb_gtf_feature_exon: list.collect { id, state -> state.star_sjdb_gtf_feature_exon }.unique()[0], 
          filter_gtf: list.collect { id, state -> state.filter_gtf }.unique()[0],
          pseudo_aligner_kmer_size: list.collect { id, state -> state.pseudo_aligner_kmer_size }.unique()[0] ]
        ]
      } 

      // prepare all the necessary files for reference genome
      | prepare_genome.run ( 
        fromState: [
          "fasta": "fasta", 
          "gtf": "gtf", 
          "gff": "gff",
          "additional_fasta": "additional_fasta", 
          "transcript_fasta": "transcript_fasta", 
          "gene_bed": "gene_bed",
          "bbsplit_fasta_list": "bbsplit_fasta_list", 
          "star_index": "star_index", 
          "rsem_index": "rsem_index",
          "salmon_index": "salmon_index",
          "kallisto_index": "kallisto_index",
          "pseudo_aligner_kmer_size": "pseudo_aligner_kmer_size",
          // "splicesites": "splicesites",
          // "hisat2_index": "hisat2_index",
          "bbsplit_index": "bbsplit_index",
          "skip_bbsplit": "skip_bbsplit", 
          "gencode": "gencode", 
          "biotype": "biotype",
          "filter_gtf": "filter_gtf",
          "aligner": "aligner",
          "pseudo_aligner": "pseudo_aligner",
          "skip_alignment": "skip_alignment",
          "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon"
        ],
        toState: [
          "fasta": "uncompressed_fasta", 
          "gtf": "gtf_uncompressed", 
          "transcript_fasta": "transcript_fasta_uncompressed", 
          "fai": "fai", 
          "chrom_sizes": "chrom_sizes", 
          "bbsplit_index": "bbsplit_index_uncompressed", 
          "star_index": "star_index_uncompressed", 
          "salmon_index": "salmon_index_uncompressed", 
          "kallisto_index": "kallisto_index_uncompressed",
          "gene_bed": "gene_bed_uncompressed"
        ]
      )

      // Check if contigs in genome fasta file > 512 Mbp
      | map { id, state -> 
        (isBelowMaxContigSize(state.fai)) ? [id, state] : [id, state + [bam_csi_index: true]]
      }

      // Pick out the state
      | map { list -> list[1]}

    analysis_ch = input_ch

      | combine(reference_ch)

      | map { list -> [list[0], list[1] + list[2]] }

      // Concatenate FastQ files from same sample if required
      | cat_fastq.run (
        fromState: [
          "read_1": "fastq_1", 
          "read_2": "fastq_2"
        ], 
        toState: [ 
          "fastq_1": "fastq_1",
          "fastq_2": "fastq_2"
        ],
        directives: [ label: [ "lowmem", "midcpu" ] ]
      )

      // Pre-process fastq files
      | pre_processing.run ( 
        fromState: [
          "id": "id", 
          "fastq_1": "fastq_1",
          "fastq_2": "fastq_2", 
          "umitools_bc_pattern": "umitools_bc_pattern",
          "umitools_bc_pattern2": "umitools_bc_pattern2",
          "strandedness": "strandedness",
          "transcript_fasta": "transcript_fasta", 
          "gtf": "gtf",
          "with_umi": "with_umi", 
          "bbsplit_index": "bbsplit_index", 
          "bbsplit_fasta_list": "bbsplit_fasta_list", 
          "bc_pattern": "bc_pattern", 
          "ribo_database_manifest": "ribo_database_manifest", 
          "salmon_index": "salmon_index",
          "skip_qc": "skip_qc",
          "skip_fastqc": "skip_fastqc",
          "skip_skip_umi_extract": "skip_umi_extract",
          "umi_discard_read": "umi_discard_read",
          "skip_trimming": "skip_trimming",
          "trimmer": "trimmer",
          "skip_bbsplit": "skip_bbsplit",
          "remove_ribo_rna": "remove_ribo_rna"
        ], 
        toState: [ 
          "fastqc_html_1": "fastqc_html_1",
          "fastqc_html_2": "fastqc_html_2",
          "fastqc_zip_1": "fastqc_zip_1",
          "fastqc_zip_2": "fastqc_zip_2",  
          "fastq_1": "qc_output1",
          "fastq_2": "qc_output2", 
          "trim_log_1": "trim_log_1", 
          "trim_log_2": "trim_log_2", 
          "trim_zip_1": "trim_zip_1",
          "trim_zip_2": "trim_zip_2",
          "trim_html_1": "trim_html_1",
          "trim_html_2": "trim_html_2",
          "passed_trimmed_reads": "passed_trimmed_reads",
          "num_trimmed_reads": "num_trimmed_reads",
          "sortmerna_log": "sortmerna_log",
          "salmon_quant_output": "salmon_quant_output",
          "fastp_failed_trim": "failed_trim",
          "fastp_failed_trim_unpaired1": "failed_trim_unpaired1",
          "fastp_failed_trim_unpaired2": "failed_trim_unpaired2",
          "fastp_trim_json": "trim_json",
          "fastp_trim_html": "trim_html",
          "fastp_trim_merged_out": "trim_merged_out"
        ]
      )

      // Infer strandedness from Salmon pseudo-alignment results
      | map { id, state -> 
        (state.strandedness == 'auto') ? 
          [ id, state + [strandedness: getSalmonInferredStrandedness(state.salmon_quant_output)] ] : 
          [id, state] 
      }

      // Filter FastQ files based on minimum trimmed read count after adapter trimming
      | map { id, state -> 
        def input = state.fastq_2 ? [ state.fastq_1, state.fastq_2 ] : [ state.fastq_1 ]
        def num_reads = (state.skip_trimming) ? 
          state.min_trimmed_reads + 1 : 
          (
            (state.trimmer == "fastp") ? 
              getFastpReadsAfterFiltering(state.fastp_trim_json) : 
              (
                (!state.skip_trimming && input.size() == 2) ?
                  getTrimGaloreReadsAfterFiltering(state.trim_log_2) : 
                  getTrimGaloreReadsAfterFiltering(state.trim_log_1)
              )
          )
        def passed_trimmed_reads = 
          (state.skip_trimming || (num_reads >= state.min_trimmed_reads)) ? 
            true : 
            false 
        [ id, state + [num_trimmed_reads: num_reads, passed_trimmed_reads: passed_trimmed_reads] ] 
      }

      // Genome alignment and quantification
      | genome_alignment_and_quant.run (
        runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads },
        fromState: [
          "id": "id", 
          "fastq_1": "fastq_1",
          "fastq_2": "fastq_2", 
          "strandedness": "strandedness", 
          "gtf": "gtf",
          "transcript_fasta": "transcript_fasta",
          "bam_csi_index": "bam_csi_index", 
          "aligner": "aligner",
          "rsem_index": "rsem_index",
          "star_index": "star_index", 
          "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon",
          "star_ignore_sjdbgtf": "star_ignore_sjdbgtf",
          "with_umi": "with_umi", 
          "umi_dedup_stats": "umi_dedup_stats",
          "gtf_group_features": "gtf_group_features",
          "gtf_extra_attributes": "gtf_extra_attributes",
          "salmon_quant_libtype": "salmon_quant_libtype",
          "salmon_index": "salmon_index",
          "extra_rsem_calculate_expression_args": "extra_rsem_calculate_expression_args" 
        ],
        toState: [
          "star_multiqc": "star_multiqc", 
          "rsem_multiqc": "rsem_multiqc",
          "salmon_multiqc": "salmon_multiqc",
          "genome_bam_sorted": "genome_bam_sorted",
          "genome_bam_index": "genome_bam_index", 
          "genome_bam_stats": "genome_bam_stats", 
          "genome_bam_flagstat": "genome_bam_flagstat", 
          "genome_bam_idxstats": "genome_bam_idxstats", 
          "transcriptome_bam": "transcriptome_bam", 
          "transcriptome_bam_index": "transcriptome_bam_index", 
          "transcriptome_bam_stats": "transcriptome_bam_stats", 
          "transcriptome_bam_flagstat": "transcriptome_bam_flagstat", 
          "transcriptome_bam_idxstats": "transcriptome_bam_idxstats",
          "quant_out_dir": "quant_out_dir",
          "quant_results_file": "quant_results_file",
          "rsem_counts_gene": "rsem_counts_gene",
          "rsem_counts_transcripts": "rsem_counts_transcripts",
          "bam_genome_rsem": "bam_genome_rsem",
          "bam_transcript_rsem": "bam_transcript_rsem"
        ]
      )

      // Filter channels to get samples that passed STAR minimum mapping percentage
      | map { id, state -> 
        def percent_mapped = (!state.skip_alignment && state.passed_trimmed_reads) ? getStarPercentMapped(state.star_multiqc) : 0.0
        def passed_mapping = (percent_mapped >= state.min_mapped_reads) ? true : false
        [ id, state + [percent_mapped: percent_mapped, passed_mapping: passed_mapping] ]
      }
      
      // Pseudo-alignment and quantification
      | pseudo_alignment_and_quant.run (
        runIf: { id, state -> !state.skip_pseudo_alignment && state.passed_trimmed_reads },
        fromState: [
          "id": "id", 
          "fastq_1": "fastq_1",
          "fastq_2": "fastq_2", 
          "strandedness": "strandedness", 
          "gtf": "gtf",
          "transcript_fasta": "transcript_fasta",
          "pseudo_aligner": "pseudo_aligner",
          "salmon_index": "salmon_index",
          "kallisto_index": "kallisto_index",
          "extra_star_align_args": "extra_star_align_args", 
          "star_ignore_sjdbgtf": "star_ignore_sjdbgtf",
          "seq_platform": "seq_platform", 
          "seq_center": "seq_center",
          "with_umi": "with_umi", 
          "umi_dedup_stats": "umi_dedup_stats",
          "gtf_group_features": "gtf_group_features",
          "gtf_extra_attributes": "gtf_extra_attributes",
          "lib_type": "salmon_quant_libtype", 
          "kallisto_quant_fragment_length": "kallisto_quant_fragment_length",
          "kallisto_quant_fragment_length_sd": "kallisto_quant_fragment_length_sd"
        ],
        toState: [
          "pseudo_quant_out_dir": "quant_out_dir",
          "pseudo_salmon_quant_results_file": "salmon_quant_results_file",
          "pseudo_kallisto_quant_results_file": "kallisto_quant_results_file",
          "pseudo_multiqc": "pseudo_multiqc"
        ]
      )

      | map { id, state ->
        def input = state.fastq_2 ? [ state.fastq_1, state.fastq_2 ] : [ state.fastq_1 ]
        def paired = input.size() == 2
        [ id, state + [ paired: paired ] ]
      }

      // Post-processing
      | post_processing.run (
        runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads && state.passed_mapping },
        fromState: [
          "id": "id", 
          "paired": "paired", 
          "strandedness": "strandedness", 
          "fasta": "fasta",
          "fai": "fai", 
          "gtf": "gtf", 
          "genome_bam": "genome_bam_sorted", 
          "chrom_sizes": "chrom_sizes", 
          "star_multiqc": "star_multiqc",
          "extra_picard_args": "extra_picard_args", 
          "extra_stringtie_args": "extra_stringtie_args", 
          "stringtie_ignore_gtf": "stringtie_ignore_gtf", 
          "extra_bedtools_args": "extra_bedtools_args", 
          "bam_csi_index": "bam_csi_index", 
          "min_mapped_reads": "min_mapped_reads", 
          "with_umi": "with_umi",
          "skip_qc": "skip_qc",
          "skip_markduplicates": "skip_markduplicates", 
          "skip_stringtie": "skip_stringtie", 
          "skip_bigwig":"gencode"
        ], 
        toState: [
          "genome_bam_sorted": "processed_genome_bam", 
          "genome_bam_index": "genome_bam_index",
          "genome_bam_stats": "genome_bam_stats",
          "genome_bam_flagstat": "genome_bam_flagstat", 
          "genome_bam_idxstats": "genome_bam_idxstats", 
          "markduplicates_metrics": "markduplicates_metrics",
          "stringtie_transcript_gtf": "stringtie_transcript_gtf",
          "stringtie_coverage_gtf": "stringtie_coverage_gtf",
          "stringtie_abundance": "stringtie_abundance",
          "stringtie_ballgown": "stringtie_ballgown", 
          "bedgraph_forward": "bedgraph_forward",
          "bedgraph_reverse": "bedgraph_reverse",
          "bigwig_forward": "bigwig_forward",
          "bigwig_reverse": "bigwig_reverse"
        ]
      )

      // Final QC

      // Temporarily skip DESeq2 QC for now
      // https://github.com/viash-hub/rnaseq/issues/31
      | map{ id, state -> [ id, state + [ skip_deseq2_qc: true ] ] }

      | quality_control.run (
        fromState: [
          "id": "id", 
          "paired": "paired", 
          "strandedness": "strandedness",
          "skip_align": "skip_alignment",
          "skip_pseudo_align": "skip_pseudo_alignment",
          "skip_dupradar": "skip_dupradar",
          "skip_qualimap": "skip_qualimap",
          "skip_rseqc": "skip_rseqc",
          "skip_multiqc": "skip_multiqc",
          "skip_preseq": "skip_preseq",
          "gtf": "gtf",
          "num_trimmed_reads": "num_trimmed_reads",
          "passed_trimmed_reads": "passed_trimmed_reads",
          "passed_mapping": "passed_mapping",
          "percent_mapped": "percent_mapped",
          "genome_bam": "genome_bam_sorted",
          "genome_bam_index": "genome_bam_index",
          "salmon_multiqc": "salmon_multiqc",
          "quant_results_file": "quant_results_file",
          "rsem_multiqc": "rsem_multiqc",
          "rsem_counts_gene": "rsem_counts_gene",
          "rsem_counts_transcripts": "rsem_counts_transcripts",
          "pseudo_multiqc": "pseudo_multiqc",
          "pseudo_quant_out_dir": "pseudo_quant_out_dir",
          "pseudo_salmon_quant_results_file": "pseudo_salmon_quant_results_file",
          "pseudo_kallisto_quant_results_file": "pseudo_kallisto_quant_results_file", 
          "aligner": "aligner",
          "pseudo_aligner": "pseudo_aligner",
          "gene_bed": "gene_bed",
          "extra_preseq_args": "extra_preseq_args",
          "biotype": "biotype",
          "skip_biotype_qc": "skip_biotype_qc",
          "featurecounts_group_type": "featurecounts_group_type",
          "featurecounts_feature_type": "featurecounts_feature_type",
          "gencode": "gencode",
          "skip_deseq2_qc": "skip_deseq2_qc",
          "deseq2_vst": "deseq2_vst",
          "multiqc_custom_config": "multiqc_custom_config",
          "multiqc_title": "multiqc_title", 
          "multiqc_methods_description": "multiqc_methods_description",
          "fastqc_zip_1": "fastqc_zip_1",
          "fastqc_zip_2": "fastqc_zip_2",
          "trim_log_1": "trim_log_1",
          "trim_log_2": "trim_log_2",
          "trim_zip_1": "trim_zip_1",
          "trim_zip_2": "trim_zip_2",
          "sortmerna_multiqc": "sortmerna_log",
          "star_multiqc": "star_multiqc",
          "genome_bam_stats": "genome_bam_stats",
          "genome_bam_flagstat": "genome_bam_flagstat",
          "genome_bam_idxstats": "genome_bam_idxstats",
          "markduplicates_multiqc": "markduplicates_metrics",
          "rseqc_modules": "rseqc_modules"
        ], 
        toState: [
          "preseq_output": "preseq_output",
          "bamstat_output": "bamstat_output",
          "strandedness_output": "strandedness_output",
          "inner_dist_output_stats": "inner_dist_output_stats",
          "inner_dist_output_dist": "inner_dist_output_dist",
          "inner_dist_output_freq": "inner_dist_output_freq",
          "inner_dist_output_plot": "inner_dist_output_plot",
          "inner_dist_output_plot_r": "inner_dist_output_plot_r",
          "junction_annotation_output_log": "junction_annotation_output_log",
          "junction_annotation_output_plot_r": "junction_annotation_output_plot_r",
          "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed",
          "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact",
          "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet",
          "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot",
          "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot",
          "junction_saturation_output_plot_r": "junction_saturation_output_plot_r",
          "junction_saturation_output_plot": "junction_saturation_output_plot",
          "read_distribution_output": "read_distribution_output",
          "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r",
          "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot",
          "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping",
          "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence",
          "tin_output_summary": "tin_output_summary",
          "tin_output_metrics": "tin_output_metrics",
          "dupradar_output_dupmatrix": "dupradar_output_dupmatrix",
          "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc",
          "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot",
          "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot",
          "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc",
          "dupradar_output_expression_histogram": "dupradar_output_expression_histogram",
          "dupradar_output_intercept_slope": "dupradar_output_intercept_slope",
          "qualimap_report": "qualimap_report", 
          "qualimap_qc_report": "qualimap_qc_report",
          "qualimap_counts": "qualimap_counts",
          "featurecounts": "featurecounts",
          "featurecounts_summary": "featurecounts_summary",
          "featurecounts_multiqc": "featurecounts_multiqc", 
          "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc",
          "tpm_gene": "tpm_gene",
          "counts_gene": "counts_gene",
          "counts_gene_length_scaled": "counts_gene_length_scaled",
          "counts_gene_scaled": "counts_gene_scaled", 
          "tpm_transcript": "tpm_transcript", 
          "counts_transcript": "counts_transcript", 
          "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment",
          "deseq2_output": "deseq2_output", 
          "pseudo_tpm_gene": "pseudo_tpm_gene",
          "pseudo_counts_gene": "pseudo_counts_gene",
          "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled",
          "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", 
          "pseudo_tpm_transcript": "pseudo_tpm_transcript", 
          "pseudo_counts_transcript": "pseudo_counts_transcript", 
          "pseudo_lengths_gene": "pseudo_lengths_gene",
          "pseudo_lengths_transcript": "pseudo_lengths_transcript",
          "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment",
          "deseq2_output_pseudo": "deseq2_output_pseudo",  
          "multiqc_report": "multiqc_report", 
          "multiqc_data": "multiqc_data", 
          "multiqc_plots": "multiqc_plots"
        ] 
      )

      | map { id, state -> 
        def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() }
        [ id, mod_state ]
      }

      | setState (
        [
          "output_fasta": "fasta", 
          "output_gtf": "gtf", 
          "output_transcript_fasta": "transcript_fasta", 
          "output_gene_bed": "gene_bed", 
          "output_bbsplit_index": "bbsplit_index", 
          "output_star_index": "star_index", 
          "output_salmon_index": "salmon_index",
          "output_kallisto_index": "kallisto_index",
          "fastqc_html_1": "fastqc_html_1",
          "fastqc_html_2": "fastqc_html_2",
          "fastqc_zip_1": "fastqc_zip_1",
          "fastqc_zip_2": "fastqc_zip_2",  
          "output_fastq_1": "fastq_1",
          "output_fastq_2": "fastq_2", 
          "trim_log_1": "trim_log_1", 
          "trim_log_2": "trim_log_2", 
          "trim_zip_1": "trim_zip_1",
          "trim_zip_2": "trim_zip_2",
          "trim_html_1": "trim_html_1",
          "trim_html_2": "trim_html_2",
          "sortmerna_log": "sortmerna_log",
          "star_log": "star_multiqc", 
          "genome_bam_sorted": "genome_bam_sorted",
          "genome_bam_index": "genome_bam_index", 
          "genome_bam_stats": "genome_bam_stats", 
          "genome_bam_flagstat": "genome_bam_flagstat", 
          "genome_bam_idxstats": "genome_bam_idxstats", 
          "transcriptome_bam": "transcriptome_bam", 
          "transcriptome_bam_index": "transcriptome_bam_index", 
          "transcriptome_bam_stats": "transcriptome_bam_stats", 
          "transcriptome_bam_flagstat": "transcriptome_bam_flagstat", 
          "transcriptome_bam_idxstats": "transcriptome_bam_idxstats",
          "salmon_quant_results": "quant_out_dir",
          "pseudo_quant_results": "pseudo_quant_out_dir",
          "markduplicates_metrics": "markduplicates_metrics",
          "stringtie_transcript_gtf": "stringtie_transcript_gtf",
          "stringtie_coverage_gtf": "stringtie_coverage_gtf",
          "stringtie_abundance": "stringtie_abundance",
          "stringtie_ballgown": "stringtie_ballgown", 
          "featurecounts": "featurecounts",
          "featurecounts_summary": "featurecounts_summary", 
          "featurecounts_multiqc": "featurecounts_multiqc", 
          "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", 
          "bedgraph_forward": "bedgraph_forward",
          "bedgraph_reverse": "bedgraph_reverse",
          "bigwig_forward": "bigwig_forward",
          "bigwig_reverse": "bigwig_reverse",
          "preseq_output": "preseq_output",
          "bamstat_output": "bamstat_output",
          "strandedness_output": "strandedness_output",
          "inner_dist_output_stats": "inner_dist_output_stats",
          "inner_dist_output_dist": "inner_dist_output_dist",
          "inner_dist_output_freq": "inner_dist_output_freq",
          "inner_dist_output_plot": "inner_dist_output_plot",
          "inner_dist_output_plot_r": "inner_dist_output_plot_r",
          "junction_annotation_output_log": "junction_annotation_output_log",
          "junction_annotation_output_plot_r": "junction_annotation_output_plot_r",
          "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed",
          "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact",
          "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet",
          "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot",
          "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot",
          "junction_saturation_output_plot_r": "junction_saturation_output_plot_r",
          "junction_saturation_output_plot": "junction_saturation_output_plot",
          "read_distribution_output": "read_distribution_output",
          "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r",
          "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot",
          "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping",
          "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence",
          "tin_output_summary": "tin_output_summary",
          "tin_output_metrics": "tin_output_metrics",
          "dupradar_output_dupmatrix": "dupradar_output_dupmatrix",
          "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc",
          "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot",
          "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot",
          "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc",
          "dupradar_output_expression_histogram": "dupradar_output_expression_histogram",
          "dupradar_output_intercept_slope": "dupradar_output_intercept_slope",
          "qualimap_report": "qualimap_report", 
          "qualimap_qc_report": "qualimap_qc_report",
          "qualimap_counts": "qualimap_counts",
          "tpm_gene": "tpm_gene",
          "counts_gene": "counts_gene",
          "counts_gene_length_scaled": "counts_gene_length_scaled",
          "counts_gene_scaled": "counts_gene_scaled", 
          "tpm_transcript": "tpm_transcript", 
          "counts_transcript": "counts_transcript", 
          "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment",
          "deseq2_output": "deseq2_output", 
          "pseudo_tpm_gene": "pseudo_tpm_gene",
          "pseudo_counts_gene": "pseudo_counts_gene",
          "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled",
          "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", 
          "pseudo_tpm_transcript": "pseudo_tpm_transcript", 
          "pseudo_counts_transcript": "pseudo_counts_transcript", 
          "pseudo_lengths_gene": "pseudo_lengths_gene",
          "pseudo_lengths_transcript": "pseudo_lengths_transcript",
          "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment",
          "deseq2_output_pseudo": "deseq2_output_pseudo",  
          "multiqc_report": "multiqc_report", 
          "multiqc_data": "multiqc_data", 
          "multiqc_plots": "multiqc_plots"
        ]
      )

  emit:
    analysis_ch
}

import nextflow.Nextflow
//
// Function to generate an error if contigs in genome fasta file > 512 Mbp
//
def isBelowMaxContigSize(fai_file) {
  def max_size = 512000000
  fai_file.eachLine { line ->
    def lspl  = line.split('\\t')
    def chrom = lspl[0]
    def size  = lspl[1]
    if (size.toInteger() > max_size) {
      def error_string = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\\n" +
        "  Contig longer than \${max_size}bp found in reference genome!\\n\\n" +
        "  \${chrom}: \${size}\\n\\n" +
        "  Provide the '--bam_csi_index' parameter to use a CSI instead of BAI index.\\n\\n"
        "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
      Nextflow.error(error_string)
      return false
    }
  }
  return true
}

// Find a file in a directory
import java.nio.file.*
def findFile(Path dir, String fileName) {
  Files.walk(dir)
    .filter { Files.isRegularFile(it) && it.fileName.toString() == fileName }
    .findFirst()
    .orElse(null)
}

import groovy.json.JsonSlurper
//
// Function that parses Salmon quant 'meta_info.json' output file to get inferred strandedness
//
def getSalmonInferredStrandedness(salmon_quant_output) {
  def json_file = findFile(salmon_quant_output, 'meta_info.json')
  def lib_type = new JsonSlurper().parseText(json_file.text).get('library_types')[0]
  def strandedness = 'reverse'
  if (lib_type) {
    if (lib_type in ['U', 'IU']) {
      strandedness = 'unstranded'
    } 
    else if (lib_type in ['SF', 'ISF']) {
      strandedness = 'forward'
    } 
    else if (lib_type in ['SR', 'ISR']) {
      strandedness = 'reverse'
    }
  }
  return strandedness
}

//
// Function that parses TrimGalore log output file to get total number of reads after trimming
//
def getTrimGaloreReadsAfterFiltering(log_file) {
  def total_reads = 0
  def filtered_reads = 0
  log_file.eachLine { line ->
    def total_reads_matcher = line =~ /([\\d\\.]+)\\ssequences processed in total/
    def filtered_reads_matcher = line =~ /shorter than the length cutoff[^:]+:\\s([\\d\\.]+)/
    if (total_reads_matcher) total_reads = total_reads_matcher[0][1].toFloat()
    if (filtered_reads_matcher) filtered_reads = filtered_reads_matcher[0][1].toFloat()
  }
  return total_reads - filtered_reads
}

//
// Function that parses fastp json output file to get total number of reads after trimming
//
def getFastpReadsAfterFiltering(json_file) {
  def Map json = (Map) new JsonSlurper().parseText(json_file.text).get('summary')
  return json['after_filtering']['total_reads'].toLong()
}

//
// Function that parses and returns the alignment rate from the STAR log outputs
//
def getStarPercentMapped(align_log) {
  def percent_aligned = 0
  def pattern = /Uniquely mapped reads %\\s*\\|\\s*([\\d\\.]+)%/
  align_log.eachLine { line ->
    def matcher = line =~ pattern
    if (matcher) {
        percent_aligned = matcher[0][1].toFloat()
    }
  }
  return percent_aligned
}
VIASHMAIN
nextflow run . -main-script "\$tempscript" &
wait "\$!"

VIASHEOF


# check whether required files exist
if [ ! -z "$VIASH_PAR_OUTPUT_FASTA" ] && [ ! -e "$VIASH_PAR_OUTPUT_FASTA" ]; then
  ViashError "Output file '$VIASH_PAR_OUTPUT_FASTA' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_OUTPUT_GTF" ] && [ ! -e "$VIASH_PAR_OUTPUT_GTF" ]; then
  ViashError "Output file '$VIASH_PAR_OUTPUT_GTF' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA" ] && [ ! -e "$VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA" ]; then
  ViashError "Output file '$VIASH_PAR_OUTPUT_TRANSCRIPT_FASTA' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_OUTPUT_GENE_BED" ] && [ ! -e "$VIASH_PAR_OUTPUT_GENE_BED" ]; then
  ViashError "Output file '$VIASH_PAR_OUTPUT_GENE_BED' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_OUTPUT_STAR_INDEX" ] && [ ! -e "$VIASH_PAR_OUTPUT_STAR_INDEX" ]; then
  ViashError "Output file '$VIASH_PAR_OUTPUT_STAR_INDEX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_OUTPUT_SALMON_INDEX" ] && [ ! -e "$VIASH_PAR_OUTPUT_SALMON_INDEX" ]; then
  ViashError "Output file '$VIASH_PAR_OUTPUT_SALMON_INDEX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_OUTPUT_BBSPLIT_INDEX" ] && [ ! -e "$VIASH_PAR_OUTPUT_BBSPLIT_INDEX" ]; then
  ViashError "Output file '$VIASH_PAR_OUTPUT_BBSPLIT_INDEX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_OUTPUT_KALLISTO_INDEX" ] && [ ! -e "$VIASH_PAR_OUTPUT_KALLISTO_INDEX" ]; then
  ViashError "Output file '$VIASH_PAR_OUTPUT_KALLISTO_INDEX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_FASTP_TRIM_JSON" ] && [ ! -e "$VIASH_PAR_FASTP_TRIM_JSON" ]; then
  ViashError "Output file '$VIASH_PAR_FASTP_TRIM_JSON' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_FASTP_TRIM_HTML" ] && [ ! -e "$VIASH_PAR_FASTP_TRIM_HTML" ]; then
  ViashError "Output file '$VIASH_PAR_FASTP_TRIM_HTML' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_STAR_ALIGNMENT" ] && [ ! -e "$VIASH_PAR_STAR_ALIGNMENT" ]; then
  ViashError "Output file '$VIASH_PAR_STAR_ALIGNMENT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_GENOME_BAM_SORTED" ] && [ ! -e "$VIASH_PAR_GENOME_BAM_SORTED" ]; then
  ViashError "Output file '$VIASH_PAR_GENOME_BAM_SORTED' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_GENOME_BAM_INDEX" ] && [ ! -e "$VIASH_PAR_GENOME_BAM_INDEX" ]; then
  ViashError "Output file '$VIASH_PAR_GENOME_BAM_INDEX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_TRANSCRIPTOME_BAM" ] && [ ! -e "$VIASH_PAR_TRANSCRIPTOME_BAM" ]; then
  ViashError "Output file '$VIASH_PAR_TRANSCRIPTOME_BAM' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_TRANSCRIPTOME_BAM_INDEX" ] && [ ! -e "$VIASH_PAR_TRANSCRIPTOME_BAM_INDEX" ]; then
  ViashError "Output file '$VIASH_PAR_TRANSCRIPTOME_BAM_INDEX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_STAR_LOG" ] && [ ! -e "$VIASH_PAR_STAR_LOG" ]; then
  ViashError "Output file '$VIASH_PAR_STAR_LOG' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_GENOME_BAM_STATS" ] && [ ! -e "$VIASH_PAR_GENOME_BAM_STATS" ]; then
  ViashError "Output file '$VIASH_PAR_GENOME_BAM_STATS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_GENOME_BAM_FLAGSTAT" ] && [ ! -e "$VIASH_PAR_GENOME_BAM_FLAGSTAT" ]; then
  ViashError "Output file '$VIASH_PAR_GENOME_BAM_FLAGSTAT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_GENOME_BAM_IDXSTATS" ] && [ ! -e "$VIASH_PAR_GENOME_BAM_IDXSTATS" ]; then
  ViashError "Output file '$VIASH_PAR_GENOME_BAM_IDXSTATS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_TRANSCRIPTOME_BAM_STATS" ] && [ ! -e "$VIASH_PAR_TRANSCRIPTOME_BAM_STATS" ]; then
  ViashError "Output file '$VIASH_PAR_TRANSCRIPTOME_BAM_STATS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT" ] && [ ! -e "$VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT" ]; then
  ViashError "Output file '$VIASH_PAR_TRANSCRIPTOME_BAM_FLAGSTAT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS" ] && [ ! -e "$VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS" ]; then
  ViashError "Output file '$VIASH_PAR_TRANSCRIPTOME_BAM_IDXSTATS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_SALMON_QUANT_RESULTS" ] && [ ! -e "$VIASH_PAR_SALMON_QUANT_RESULTS" ]; then
  ViashError "Output file '$VIASH_PAR_SALMON_QUANT_RESULTS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE" ] && [ ! -e "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE" ]; then
  ViashError "Output file '$VIASH_PAR_SALMON_QUANT_RESULTS_FILE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PSEUDO_QUANT_RESULTS" ] && [ ! -e "$VIASH_PAR_PSEUDO_QUANT_RESULTS" ]; then
  ViashError "Output file '$VIASH_PAR_PSEUDO_QUANT_RESULTS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_RSEM_COUNTS_GENE" ] && [ ! -e "$VIASH_PAR_RSEM_COUNTS_GENE" ]; then
  ViashError "Output file '$VIASH_PAR_RSEM_COUNTS_GENE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS" ] && [ ! -e "$VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS" ]; then
  ViashError "Output file '$VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_BAM_STAR_RSEM" ] && [ ! -e "$VIASH_PAR_BAM_STAR_RSEM" ]; then
  ViashError "Output file '$VIASH_PAR_BAM_STAR_RSEM' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_BAM_GENOME_RSEM" ] && [ ! -e "$VIASH_PAR_BAM_GENOME_RSEM" ]; then
  ViashError "Output file '$VIASH_PAR_BAM_GENOME_RSEM' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_BAM_TRANSCRIPT_RSEM" ] && [ ! -e "$VIASH_PAR_BAM_TRANSCRIPT_RSEM" ]; then
  ViashError "Output file '$VIASH_PAR_BAM_TRANSCRIPT_RSEM' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_TPM_GENE" ] && [ ! -e "$VIASH_PAR_TPM_GENE" ]; then
  ViashError "Output file '$VIASH_PAR_TPM_GENE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_COUNTS_GENE" ] && [ ! -e "$VIASH_PAR_COUNTS_GENE" ]; then
  ViashError "Output file '$VIASH_PAR_COUNTS_GENE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED" ] && [ ! -e "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED" ]; then
  ViashError "Output file '$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_COUNTS_GENE_SCALED" ] && [ ! -e "$VIASH_PAR_COUNTS_GENE_SCALED" ]; then
  ViashError "Output file '$VIASH_PAR_COUNTS_GENE_SCALED' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_TPM_TRANSCRIPT" ] && [ ! -e "$VIASH_PAR_TPM_TRANSCRIPT" ]; then
  ViashError "Output file '$VIASH_PAR_TPM_TRANSCRIPT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_COUNTS_TRANSCRIPT" ] && [ ! -e "$VIASH_PAR_COUNTS_TRANSCRIPT" ]; then
  ViashError "Output file '$VIASH_PAR_COUNTS_TRANSCRIPT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ] && [ ! -e "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ]; then
  ViashError "Output file '$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_MARKDUPLICATES_METRICS" ] && [ ! -e "$VIASH_PAR_MARKDUPLICATES_METRICS" ]; then
  ViashError "Output file '$VIASH_PAR_MARKDUPLICATES_METRICS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF" ] && [ ! -e "$VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF" ]; then
  ViashError "Output file '$VIASH_PAR_STRINGTIE_TRANSCRIPT_GTF' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_STRINGTIE_COVERAGE_GTF" ] && [ ! -e "$VIASH_PAR_STRINGTIE_COVERAGE_GTF" ]; then
  ViashError "Output file '$VIASH_PAR_STRINGTIE_COVERAGE_GTF' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_STRINGTIE_ABUNDANCE" ] && [ ! -e "$VIASH_PAR_STRINGTIE_ABUNDANCE" ]; then
  ViashError "Output file '$VIASH_PAR_STRINGTIE_ABUNDANCE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_STRINGTIE_BALLGOWN" ] && [ ! -e "$VIASH_PAR_STRINGTIE_BALLGOWN" ]; then
  ViashError "Output file '$VIASH_PAR_STRINGTIE_BALLGOWN' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_FEATURECOUNTS" ] && [ ! -e "$VIASH_PAR_FEATURECOUNTS" ]; then
  ViashError "Output file '$VIASH_PAR_FEATURECOUNTS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_FEATURECOUNTS_SUMMARY" ] && [ ! -e "$VIASH_PAR_FEATURECOUNTS_SUMMARY" ]; then
  ViashError "Output file '$VIASH_PAR_FEATURECOUNTS_SUMMARY' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_BEDGRAPH_FORWARD" ] && [ ! -e "$VIASH_PAR_BEDGRAPH_FORWARD" ]; then
  ViashError "Output file '$VIASH_PAR_BEDGRAPH_FORWARD' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_BEDGRAPH_REVERSE" ] && [ ! -e "$VIASH_PAR_BEDGRAPH_REVERSE" ]; then
  ViashError "Output file '$VIASH_PAR_BEDGRAPH_REVERSE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_BIGWIG_FORWARD" ] && [ ! -e "$VIASH_PAR_BIGWIG_FORWARD" ]; then
  ViashError "Output file '$VIASH_PAR_BIGWIG_FORWARD' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_BIGWIG_REVERSE" ] && [ ! -e "$VIASH_PAR_BIGWIG_REVERSE" ]; then
  ViashError "Output file '$VIASH_PAR_BIGWIG_REVERSE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PRESEQ_OUTPUT" ] && [ ! -e "$VIASH_PAR_PRESEQ_OUTPUT" ]; then
  ViashError "Output file '$VIASH_PAR_PRESEQ_OUTPUT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_BAMSTAT_OUTPUT" ] && [ ! -e "$VIASH_PAR_BAMSTAT_OUTPUT" ]; then
  ViashError "Output file '$VIASH_PAR_BAMSTAT_OUTPUT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_STRANDEDNESS_OUTPUT" ] && [ ! -e "$VIASH_PAR_STRANDEDNESS_OUTPUT" ]; then
  ViashError "Output file '$VIASH_PAR_STRANDEDNESS_OUTPUT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG" ] && [ ! -e "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG" ]; then
  ViashError "Output file '$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R" ] && [ ! -e "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R" ]; then
  ViashError "Output file '$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED" ] && [ ! -e "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED" ]; then
  ViashError "Output file '$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT" ] && [ ! -e "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT" ]; then
  ViashError "Output file '$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET" ] && [ ! -e "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET" ]; then
  ViashError "Output file '$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT" ] && [ ! -e "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT" ]; then
  ViashError "Output file '$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_EVENTS_PLOT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT" ] && [ ! -e "$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT" ]; then
  ViashError "Output file '$VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_SPLICE_JUNCTIONS_PLOT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R" ] && [ ! -e "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R" ]; then
  ViashError "Output file '$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT" ] && [ ! -e "$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT" ]; then
  ViashError "Output file '$VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_READ_DISTRIBUTION_OUTPUT" ] && [ ! -e "$VIASH_PAR_READ_DISTRIBUTION_OUTPUT" ]; then
  ViashError "Output file '$VIASH_PAR_READ_DISTRIBUTION_OUTPUT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R" ] && [ ! -e "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R" ]; then
  ViashError "Output file '$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT_R' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT" ] && [ ! -e "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT" ]; then
  ViashError "Output file '$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_PLOT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING" ] && [ ! -e "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING" ]; then
  ViashError "Output file '$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_MAPPING' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE" ] && [ ! -e "$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE" ]; then
  ViashError "Output file '$VIASH_PAR_READ_DUPLICATION_OUTPUT_DUPLICATION_RATE_SEQUENCE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_TIN_OUTPUT_SUMMARY" ] && [ ! -e "$VIASH_PAR_TIN_OUTPUT_SUMMARY" ]; then
  ViashError "Output file '$VIASH_PAR_TIN_OUTPUT_SUMMARY' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_TIN_OUTPUT_METRICS" ] && [ ! -e "$VIASH_PAR_TIN_OUTPUT_METRICS" ]; then
  ViashError "Output file '$VIASH_PAR_TIN_OUTPUT_METRICS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX" ] && [ ! -e "$VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX" ]; then
  ViashError "Output file '$VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC" ] && [ ! -e "$VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC" ]; then
  ViashError "Output file '$VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT" ] && [ ! -e "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT" ]; then
  ViashError "Output file '$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT" ] && [ ! -e "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT" ]; then
  ViashError "Output file '$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC" ] && [ ! -e "$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC" ]; then
  ViashError "Output file '$VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSCURVE_MQC' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM" ] && [ ! -e "$VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM" ]; then
  ViashError "Output file '$VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE" ] && [ ! -e "$VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE" ]; then
  ViashError "Output file '$VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_QUALIMAP_QC_REPORT" ] && [ ! -e "$VIASH_PAR_QUALIMAP_QC_REPORT" ]; then
  ViashError "Output file '$VIASH_PAR_QUALIMAP_QC_REPORT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_QUALIMAP_COUNTS" ] && [ ! -e "$VIASH_PAR_QUALIMAP_COUNTS" ]; then
  ViashError "Output file '$VIASH_PAR_QUALIMAP_COUNTS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_QUALIMAP_REPORT" ] && [ ! -e "$VIASH_PAR_QUALIMAP_REPORT" ]; then
  ViashError "Output file '$VIASH_PAR_QUALIMAP_REPORT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_DESEQ2_OUTPUT" ] && [ ! -e "$VIASH_PAR_DESEQ2_OUTPUT" ]; then
  ViashError "Output file '$VIASH_PAR_DESEQ2_OUTPUT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_DESEQ2_OUTPUT_PSEUDO" ] && [ ! -e "$VIASH_PAR_DESEQ2_OUTPUT_PSEUDO" ]; then
  ViashError "Output file '$VIASH_PAR_DESEQ2_OUTPUT_PSEUDO' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_MULTIQC_REPORT" ] && [ ! -e "$VIASH_PAR_MULTIQC_REPORT" ]; then
  ViashError "Output file '$VIASH_PAR_MULTIQC_REPORT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_MULTIQC_DATA" ] && [ ! -e "$VIASH_PAR_MULTIQC_DATA" ]; then
  ViashError "Output file '$VIASH_PAR_MULTIQC_DATA' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_MULTIQC_PLOTS" ] && [ ! -e "$VIASH_PAR_MULTIQC_PLOTS" ]; then
  ViashError "Output file '$VIASH_PAR_MULTIQC_PLOTS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_MULTIQC_VERSIONS" ] && [ ! -e "$VIASH_PAR_MULTIQC_VERSIONS" ]; then
  ViashError "Output file '$VIASH_PAR_MULTIQC_VERSIONS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PSEUDO_COUNTS_GENE" ] && [ ! -e "$VIASH_PAR_PSEUDO_COUNTS_GENE" ]; then
  ViashError "Output file '$VIASH_PAR_PSEUDO_COUNTS_GENE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED" ] && [ ! -e "$VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED" ]; then
  ViashError "Output file '$VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED" ] && [ ! -e "$VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED" ]; then
  ViashError "Output file '$VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PSEUDO_TPM_GENE" ] && [ ! -e "$VIASH_PAR_PSEUDO_TPM_GENE" ]; then
  ViashError "Output file '$VIASH_PAR_PSEUDO_TPM_GENE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PSEUDO_TPM_TRANSCRIPT" ] && [ ! -e "$VIASH_PAR_PSEUDO_TPM_TRANSCRIPT" ]; then
  ViashError "Output file '$VIASH_PAR_PSEUDO_TPM_TRANSCRIPT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT" ] && [ ! -e "$VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT" ]; then
  ViashError "Output file '$VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ] && [ ! -e "$VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ]; then
  ViashError "Output file '$VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT' does not exist."
  exit 1
fi


exit 0
