#!/usr/bin/env bash

# quality_control 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="quality_control"
VIASH_META_FUNCTIONALITY_NAME="quality_control"
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 "quality_control main"
  echo ""
  echo "A subworkflow for the final quality control stage of the nf-core/rnaseq"
  echo "pipeline."
  echo ""
  echo "Input:"
  echo "    --id"
  echo "        type: string, required parameter"
  echo "        example: test"
  echo "        ID of the sample"
  echo ""
  echo "    --strandedness"
  echo "        type: string"
  echo "        default: unstranded"
  echo "        Sample strand-specificity. Must be one of unstranded, forward, reverse"
  echo ""
  echo "    --paired"
  echo "        type: boolean"
  echo "        Paired-end reads?"
  echo ""
  echo "    --genome_bam"
  echo "        type: file, file must exist"
  echo "        Input genome BAM file"
  echo ""
  echo "    --genome_bam_index"
  echo "        type: file, file must exist"
  echo "        Genome BAM index 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 "    --gtf"
  echo "        type: file, file must exist"
  echo "        GTF file"
  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 "    --gtf_extra_attributes"
  echo "        type: string"
  echo "        default: gene_name"
  echo "        By default, the pipeline uses the gene_name field to obtain additional"
  echo "        gene identifiers from the input GTF file when running Salmon."
  echo ""
  echo "    --quant_out_dir"
  echo "        type: file, file must exist"
  echo "        Directory containing Salmon quantification results."
  echo ""
  echo "    --quant_results_file"
  echo "        type: file, file must exist"
  echo "        Salmon quantification file."
  echo ""
  echo "    --pseudo_quant_out_dir"
  echo "        type: file, file must exist"
  echo "        Directory containing quantification results for pseudo alignment."
  echo ""
  echo "    --pseudo_salmon_quant_results_file"
  echo "        type: file, file must exist"
  echo "        Quantification file from Salmon for pseudo alignment."
  echo ""
  echo "    --pseudo_kallisto_quant_results_file"
  echo "        type: file, file must exist"
  echo "        Quantification file from Kallisto for pseudo alignment."
  echo ""
  echo "    --aligner"
  echo "        type: string"
  echo "        Method used for alognment and qqunatification."
  echo ""
  echo "    --pseudo_aligner"
  echo "        type: string"
  echo "        Method used for pseudo alignment and quantification."
  echo ""
  echo "    --rsem_counts_gene"
  echo "        type: file, file must exist"
  echo "        Expression counts on gene level"
  echo ""
  echo "    --rsem_counts_transcripts"
  echo "        type: file, file must exist"
  echo "        Expression counts on transcript level"
  echo ""
  echo "    --skip_qc"
  echo "        type: boolean"
  echo "        default: false"
  echo ""
  echo "    --skip_biotype_qc"
  echo "        type: boolean"
  echo ""
  echo "    --skip_align"
  echo "        type: boolean"
  echo "        default: false"
  echo ""
  echo "    --skip_pseudo_align"
  echo "        type: boolean"
  echo ""
  echo "    --skip_preseq"
  echo "        type: boolean"
  echo "        default: false"
  echo ""
  echo "    --extra_preseq_args"
  echo "        type: string"
  echo "        default: -verbose -bam -seed 1"
  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 "    --gencode"
  echo "        type: boolean"
  echo "        Specify if the GTF annotation is in GENCODE format."
  echo ""
  echo "    --biotypes_header"
  echo "        type: file, file must exist"
  echo "        default: src/assets/multiqc/biotypes_header.txt"
  echo ""
  echo "    --biotype"
  echo "        type: string"
  echo "        Biotype value to use while appending entries to GTF file when additional"
  echo "        fasta file is provided."
  echo ""
  echo "    --extra_featurecounts_args"
  echo "        type: string"
  echo "        Extra arguments to pass to featureCounts command in addition to defaults"
  echo "        defined by the pipeline"
  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"
  echo ""
  echo "    --sample_size"
  echo "        type: integer"
  echo "        default: 200000"
  echo "        min: 1"
  echo "        Numer of reads sampled from SAM/BAM file to infer experiment and"
  echo "        calculate inner distance, default = 200000."
  echo ""
  echo "    --lower_bound_size"
  echo "        type: integer"
  echo "        default: -250"
  echo "        Lower bound of inner distance (bp). This option is used for ploting"
  echo "        histograme, default = -250."
  echo ""
  echo "    --upper_bound_size"
  echo "        type: integer"
  echo "        default: 250"
  echo "        Upper bound of inner distance (bp). This option is used for ploting"
  echo "        histograme, default = 250."
  echo ""
  echo "    --step_size"
  echo "        type: integer"
  echo "        default: 5"
  echo "        Step size (bp) of histograme of inner distance. This option is used for"
  echo "        plotting histogram, default = 5."
  echo ""
  echo "    --map_qual"
  echo "        type: integer"
  echo "        default: 30"
  echo "        min: 0"
  echo "        Minimum mapping quality (phred scaled) to determine uniquely mapped"
  echo "        reads, default = 30."
  echo ""
  echo "    --min_intron"
  echo "        type: integer"
  echo "        default: 50"
  echo "        min: 1"
  echo "        Minimum intron length (bp) to call a junction, default = 50."
  echo ""
  echo "    --min_splice_read"
  echo "        type: integer"
  echo "        default: 1"
  echo "        min: 1"
  echo "        Minimum number of supporting reads to call a junction, default = 1."
  echo ""
  echo "    --sampling_percentile_lower_bound"
  echo "        type: integer"
  echo "        default: 5"
  echo "        min: 0"
  echo "        max: 100"
  echo "        Read sampling for junction saturation starts from this percentile, must"
  echo "        be an integer between 0 and 100, default = 5."
  echo ""
  echo "    --sampling_percentile_upper_bound"
  echo "        type: integer"
  echo "        default: 100"
  echo "        min: 0"
  echo "        max: 100"
  echo "        Read sampling for junction saturation ends at this percentile, must be"
  echo "        an integer between 0 and 100, default = 5."
  echo ""
  echo "    --sampling_percentile_step"
  echo "        type: integer"
  echo "        default: 5"
  echo "        min: 0"
  echo "        max: 100"
  echo "        Read sampling for junction saturation frequency in %. Smaller value"
  echo "        means more sampling times. Must be an integer between 0 and 100, default"
  echo "        = 5."
  echo ""
  echo "    --read_count_upper_limit"
  echo "        type: integer"
  echo "        default: 500"
  echo "        min: 1"
  echo "        Upper limit of reads' occurence to determine read duplication. Only used"
  echo "        for plotting, default = 500 (times)."
  echo ""
  echo "    --minimum_coverage"
  echo "        type: integer"
  echo "        default: 10"
  echo "        min: 1"
  echo "        Minimum number of reads mapped to a transcript to determin tin, default"
  echo "        = 10."
  echo ""
  echo "    --tin_sample_size"
  echo "        type: integer"
  echo "        default: 100"
  echo "        min: 1"
  echo "        Number of equal-spaced nucleotide positions picked from mRNA. Note, if"
  echo "        this number is larger than the length of mRNA (L), it will be halved"
  echo "        until it's smaller than L (default = 100)"
  echo ""
  echo "    --subtract_background"
  echo "        type: boolean_true"
  echo "        Set flag to subtract background noise (estimated from intronic reads) to"
  echo "        determine tin. Only use this option if there are substantial intronic"
  echo "        reads."
  echo ""
  echo "    --output_format"
  echo "        type: string"
  echo "        default: html"
  echo "        choices: [ html, pdf ]"
  echo "        Format of the qualimap output report (PDF or HTML, default is HTML)"
  echo ""
  echo "    --pr_bases"
  echo "        type: integer"
  echo "        default: 100"
  echo "        min: 1"
  echo "        Number of upstream/downstream nucleotide bases to compute 5'-3' bias for"
  echo "        qualimap (default = 100)."
  echo ""
  echo "    --tr_bias"
  echo "        type: integer"
  echo "        default: 1000"
  echo "        min: 1"
  echo "        Number of top highly expressed transcripts to compute 5'-3' bias for"
  echo "        qualimap (default = 1000)."
  echo ""
  echo "    --algorithm"
  echo "        type: string"
  echo "        default: uniquely-mapped-reads"
  echo "        Counting algorithm for qualimap (uniquely-mapped-reads (default) or"
  echo "        proportional)."
  echo ""
  echo "    --sequencing_protocol"
  echo "        type: string"
  echo "        default: non-strand-specific"
  echo "        choices: [ non-strand-specific, strand-specific-reverse,"
  echo "strand-specific-forward ]"
  echo "        Sequencing library protocol for qualimap (strand-specific-forward,"
  echo "        strand-specific-reverse or non-strand-specific (default))."
  echo ""
  echo "    --sorted"
  echo "        type: boolean_true"
  echo "        Setting this flag indicates that the input file is already sorted by"
  echo "        name. If flag is not set, additional sorting by name will be performed"
  echo "        for qualimap. Only requiredfor paired-end analysis."
  echo ""
  echo "    --java_memory_size"
  echo "        type: string"
  echo "        default: 4G"
  echo "        maximum Java heap memory size for qualimap, default = 4G."
  echo ""
  echo "    --skip_deseq2_qc"
  echo "        type: boolean"
  echo ""
  echo "    --pca_header_multiqc"
  echo "        type: file, file must exist"
  echo "        default: src/assets/multiqc/deseq2_pca_header.txt"
  echo ""
  echo "    --clustering_header_multiqc"
  echo "        type: file, file must exist"
  echo "        default: src/assets/multiqc/deseq2_clustering_header.txt"
  echo ""
  echo "    --deseq2_vst"
  echo "        type: boolean"
  echo "        Use vst transformation instead of rlog with DESeq2"
  echo ""
  echo "    --extra_deseq2_args"
  echo "        type: string"
  echo "        default: --id_col 1 --sample_suffix '' --outprefix deseq2 --count_col 3"
  echo ""
  echo "    --extra_deseq2_args2"
  echo "        type: string"
  echo "        default: star_salmon"
  echo ""
  echo "    --multiqc_custom_config"
  echo "        type: file, file must exist"
  echo ""
  echo "    --multiqc_title"
  echo "        type: string"
  echo ""
  echo "    --multiqc_methods_description"
  echo "        type: file, file must exist"
  echo ""
  echo "    --passed_trimmed_reads"
  echo "        type: boolean"
  echo ""
  echo "    --num_trimmed_reads"
  echo "        type: double"
  echo ""
  echo "    --passed_mapping"
  echo "        type: boolean"
  echo ""
  echo "    --percent_mapped"
  echo "        type: double"
  echo ""
  echo "    --fastqc_zip_1"
  echo "        type: file"
  echo ""
  echo "    --fastqc_zip_2"
  echo "        type: file"
  echo ""
  echo "    --trim_zip_1"
  echo "        type: file"
  echo ""
  echo "    --trim_zip_2"
  echo "        type: file"
  echo ""
  echo "    --trim_log_1"
  echo "        type: file"
  echo ""
  echo "    --trim_log_2"
  echo "        type: file"
  echo ""
  echo "    --sortmerna_multiqc"
  echo "        type: file"
  echo ""
  echo "    --star_multiqc"
  echo "        type: file"
  echo ""
  echo "    --rsem_multiqc"
  echo "        type: file, file must exist"
  echo ""
  echo "    --genome_bam_stats"
  echo "        type: file"
  echo ""
  echo "    --genome_bam_flagstat"
  echo "        type: file"
  echo ""
  echo "    --genome_bam_idxstats"
  echo "        type: file"
  echo ""
  echo "    --markduplicates_multiqc"
  echo "        type: file"
  echo ""
  echo "    --pseudo_multiqc"
  echo "        type: file"
  echo ""
  echo "Output:"
  echo "    --preseq_output"
  echo "        type: file, output, file must exist"
  echo "        default: \$id.lc_extrap.txt"
  echo ""
  echo "    --bamstat_output"
  echo "        type: file, output, file must exist"
  echo "        default: \$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: \$id.strandedness.txt"
  echo "        Path to output report (txt) of inferred strandedness"
  echo ""
  echo "    --inner_dist_output_stats"
  echo "        type: file, output"
  echo "        default: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$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: \$id.tin.xls"
  echo "        file with TIN metrics (xls)"
  echo ""
  echo "    --dupradar_output_dupmatrix"
  echo "        type: file, output, file must exist"
  echo "        default: \$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: \$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: \$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: \$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: \$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: \$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: \$id.intercept_slope.txt"
  echo ""
  echo "    --qualimap_output_pdf"
  echo "        type: file, output"
  echo "        default: \$id.qualimap_output.pdf"
  echo ""
  echo "    --qualimap_output_dir"
  echo "        type: file, output, file must exist"
  echo "        default: \$id.qualimap_output"
  echo ""
  echo "    --deseq2_output"
  echo "        type: file, output, file must exist"
  echo "        default: deseq2"
  echo ""
  echo "    --deseq2_output_pseudo"
  echo "        type: file, output, file must exist"
  echo "        default: deseq2_pseudo"
  echo ""
  echo "    --multiqc_report"
  echo "        type: file, output, file must exist"
  echo "        default: multiqc_report.html"
  echo ""
  echo "    --multiqc_data"
  echo "        type: file, output, file must exist"
  echo "        default: multiqc_data"
  echo ""
  echo "    --multiqc_plots"
  echo "        type: file, output, file must exist"
  echo "        default: multiqc_plots"
  echo ""
  echo "    --featurecounts"
  echo "        type: file, output"
  echo "        default: \$id.featureCounts.txt"
  echo ""
  echo "    --featurecounts_summary"
  echo "        type: file, output"
  echo "        default: \$id.featureCounts.txt.summary"
  echo ""
  echo "    --featurecounts_multiqc"
  echo "        type: file, output"
  echo "        default: \$id.featureCounts_mqc.tsv"
  echo ""
  echo "    --featurecounts_rrna_multiqc"
  echo "        type: file, output"
  echo "        default: \$id.featureCounts_rrna_mqc.tsv"
  echo ""
  echo "    --tpm_gene"
  echo "        type: file, output, file must exist"
  echo "        default: salmon.merged.gene_tpm.tsv"
  echo ""
  echo "    --counts_gene"
  echo "        type: file, output, file must exist"
  echo "        default: salmon.merged.gene_counts.tsv"
  echo ""
  echo "    --counts_gene_length_scaled"
  echo "        type: file, output, file must exist"
  echo "        default: salmon.merged.gene_counts_length_scaled.tsv"
  echo ""
  echo "    --counts_gene_scaled"
  echo "        type: file, output, file must exist"
  echo "        default: salmon.merged.gene_counts_scaled.tsv"
  echo ""
  echo "    --tpm_transcript"
  echo "        type: file, output, file must exist"
  echo "        default: salmon.merged.transcript_tpm.tsv"
  echo ""
  echo "    --counts_transcript"
  echo "        type: file, output, file must exist"
  echo "        default: salmon.merged.transcript_counts.tsv"
  echo ""
  echo "    --quant_merged_summarizedexperiment"
  echo "        type: file, output, file must exist"
  echo "        default: salmon_merged_summarizedexperiment"
  echo ""
  echo "    --pseudo_tpm_gene"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_gene_tpm.tsv"
  echo ""
  echo "    --pseudo_counts_gene"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_gene_counts.tsv"
  echo ""
  echo "    --pseudo_counts_gene_length_scaled"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_gene_counts_length_scaled.tsv"
  echo ""
  echo "    --pseudo_counts_gene_scaled"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_gene_counts_scaled.tsv"
  echo ""
  echo "    --pseudo_tpm_transcript"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_transcript_tpm.tsv"
  echo ""
  echo "    --pseudo_counts_transcript"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_transcript_counts.tsv"
  echo ""
  echo "    --pseudo_quant_merged_summarizedexperiment"
  echo "        type: file, output, file must exist"
  echo "        default: pseudo_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 "quality_control 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
            ;;
        --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
            ;;
        --paired)
            [ -n "$VIASH_PAR_PAIRED" ] && ViashError Bad arguments for option \'--paired\': \'$VIASH_PAR_PAIRED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PAIRED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --paired. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --paired=*)
            [ -n "$VIASH_PAR_PAIRED" ] && ViashError Bad arguments for option \'--paired=*\': \'$VIASH_PAR_PAIRED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PAIRED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --genome_bam)
            [ -n "$VIASH_PAR_GENOME_BAM" ] && ViashError Bad arguments for option \'--genome_bam\': \'$VIASH_PAR_GENOME_BAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENOME_BAM="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --genome_bam. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --genome_bam=*)
            [ -n "$VIASH_PAR_GENOME_BAM" ] && ViashError Bad arguments for option \'--genome_bam=*\': \'$VIASH_PAR_GENOME_BAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_GENOME_BAM=$(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
            ;;
        --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
            ;;
        --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
            ;;
        --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
            ;;
        --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
            ;;
        --quant_out_dir)
            [ -n "$VIASH_PAR_QUANT_OUT_DIR" ] && ViashError Bad arguments for option \'--quant_out_dir\': \'$VIASH_PAR_QUANT_OUT_DIR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUANT_OUT_DIR="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --quant_out_dir. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --quant_out_dir=*)
            [ -n "$VIASH_PAR_QUANT_OUT_DIR" ] && ViashError Bad arguments for option \'--quant_out_dir=*\': \'$VIASH_PAR_QUANT_OUT_DIR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUANT_OUT_DIR=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --quant_results_file)
            [ -n "$VIASH_PAR_QUANT_RESULTS_FILE" ] && ViashError Bad arguments for option \'--quant_results_file\': \'$VIASH_PAR_QUANT_RESULTS_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUANT_RESULTS_FILE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --quant_results_file. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --quant_results_file=*)
            [ -n "$VIASH_PAR_QUANT_RESULTS_FILE" ] && ViashError Bad arguments for option \'--quant_results_file=*\': \'$VIASH_PAR_QUANT_RESULTS_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUANT_RESULTS_FILE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_quant_out_dir)
            [ -n "$VIASH_PAR_PSEUDO_QUANT_OUT_DIR" ] && ViashError Bad arguments for option \'--pseudo_quant_out_dir\': \'$VIASH_PAR_PSEUDO_QUANT_OUT_DIR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_QUANT_OUT_DIR="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_quant_out_dir. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_quant_out_dir=*)
            [ -n "$VIASH_PAR_PSEUDO_QUANT_OUT_DIR" ] && ViashError Bad arguments for option \'--pseudo_quant_out_dir=*\': \'$VIASH_PAR_PSEUDO_QUANT_OUT_DIR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_QUANT_OUT_DIR=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_salmon_quant_results_file)
            [ -n "$VIASH_PAR_PSEUDO_SALMON_QUANT_RESULTS_FILE" ] && ViashError Bad arguments for option \'--pseudo_salmon_quant_results_file\': \'$VIASH_PAR_PSEUDO_SALMON_QUANT_RESULTS_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_SALMON_QUANT_RESULTS_FILE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_salmon_quant_results_file. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_salmon_quant_results_file=*)
            [ -n "$VIASH_PAR_PSEUDO_SALMON_QUANT_RESULTS_FILE" ] && ViashError Bad arguments for option \'--pseudo_salmon_quant_results_file=*\': \'$VIASH_PAR_PSEUDO_SALMON_QUANT_RESULTS_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_SALMON_QUANT_RESULTS_FILE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_kallisto_quant_results_file)
            [ -n "$VIASH_PAR_PSEUDO_KALLISTO_QUANT_RESULTS_FILE" ] && ViashError Bad arguments for option \'--pseudo_kallisto_quant_results_file\': \'$VIASH_PAR_PSEUDO_KALLISTO_QUANT_RESULTS_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_KALLISTO_QUANT_RESULTS_FILE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_kallisto_quant_results_file. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_kallisto_quant_results_file=*)
            [ -n "$VIASH_PAR_PSEUDO_KALLISTO_QUANT_RESULTS_FILE" ] && ViashError Bad arguments for option \'--pseudo_kallisto_quant_results_file=*\': \'$VIASH_PAR_PSEUDO_KALLISTO_QUANT_RESULTS_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_KALLISTO_QUANT_RESULTS_FILE=$(ViashRemoveFlags "$1")
            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
            ;;
        --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
            ;;
        --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="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --skip_qc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --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=$(ViashRemoveFlags "$1")
            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="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --skip_biotype_qc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --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=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --skip_align)
            [ -n "$VIASH_PAR_SKIP_ALIGN" ] && ViashError Bad arguments for option \'--skip_align\': \'$VIASH_PAR_SKIP_ALIGN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_ALIGN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --skip_align. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --skip_align=*)
            [ -n "$VIASH_PAR_SKIP_ALIGN" ] && ViashError Bad arguments for option \'--skip_align=*\': \'$VIASH_PAR_SKIP_ALIGN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_ALIGN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --skip_pseudo_align)
            [ -n "$VIASH_PAR_SKIP_PSEUDO_ALIGN" ] && ViashError Bad arguments for option \'--skip_pseudo_align\': \'$VIASH_PAR_SKIP_PSEUDO_ALIGN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_PSEUDO_ALIGN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --skip_pseudo_align. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --skip_pseudo_align=*)
            [ -n "$VIASH_PAR_SKIP_PSEUDO_ALIGN" ] && ViashError Bad arguments for option \'--skip_pseudo_align=*\': \'$VIASH_PAR_SKIP_PSEUDO_ALIGN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_PSEUDO_ALIGN=$(ViashRemoveFlags "$1")
            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="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --skip_preseq. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --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=$(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
            ;;
        --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
            ;;
        --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="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --gencode. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --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=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --biotypes_header)
            [ -n "$VIASH_PAR_BIOTYPES_HEADER" ] && ViashError Bad arguments for option \'--biotypes_header\': \'$VIASH_PAR_BIOTYPES_HEADER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BIOTYPES_HEADER="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --biotypes_header. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --biotypes_header=*)
            [ -n "$VIASH_PAR_BIOTYPES_HEADER" ] && ViashError Bad arguments for option \'--biotypes_header=*\': \'$VIASH_PAR_BIOTYPES_HEADER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BIOTYPES_HEADER=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --biotype)
            [ -n "$VIASH_PAR_BIOTYPE" ] && ViashError Bad arguments for option \'--biotype\': \'$VIASH_PAR_BIOTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BIOTYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --biotype. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --biotype=*)
            [ -n "$VIASH_PAR_BIOTYPE" ] && ViashError Bad arguments for option \'--biotype=*\': \'$VIASH_PAR_BIOTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BIOTYPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --extra_featurecounts_args)
            [ -n "$VIASH_PAR_EXTRA_FEATURECOUNTS_ARGS" ] && ViashError Bad arguments for option \'--extra_featurecounts_args\': \'$VIASH_PAR_EXTRA_FEATURECOUNTS_ARGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_EXTRA_FEATURECOUNTS_ARGS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --extra_featurecounts_args. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --extra_featurecounts_args=*)
            [ -n "$VIASH_PAR_EXTRA_FEATURECOUNTS_ARGS" ] && ViashError Bad arguments for option \'--extra_featurecounts_args=*\': \'$VIASH_PAR_EXTRA_FEATURECOUNTS_ARGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_EXTRA_FEATURECOUNTS_ARGS=$(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
            ;;
        --sample_size)
            [ -n "$VIASH_PAR_SAMPLE_SIZE" ] && ViashError Bad arguments for option \'--sample_size\': \'$VIASH_PAR_SAMPLE_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SAMPLE_SIZE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sample_size. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sample_size=*)
            [ -n "$VIASH_PAR_SAMPLE_SIZE" ] && ViashError Bad arguments for option \'--sample_size=*\': \'$VIASH_PAR_SAMPLE_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SAMPLE_SIZE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --lower_bound_size)
            [ -n "$VIASH_PAR_LOWER_BOUND_SIZE" ] && ViashError Bad arguments for option \'--lower_bound_size\': \'$VIASH_PAR_LOWER_BOUND_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LOWER_BOUND_SIZE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --lower_bound_size. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --lower_bound_size=*)
            [ -n "$VIASH_PAR_LOWER_BOUND_SIZE" ] && ViashError Bad arguments for option \'--lower_bound_size=*\': \'$VIASH_PAR_LOWER_BOUND_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LOWER_BOUND_SIZE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --upper_bound_size)
            [ -n "$VIASH_PAR_UPPER_BOUND_SIZE" ] && ViashError Bad arguments for option \'--upper_bound_size\': \'$VIASH_PAR_UPPER_BOUND_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UPPER_BOUND_SIZE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --upper_bound_size. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --upper_bound_size=*)
            [ -n "$VIASH_PAR_UPPER_BOUND_SIZE" ] && ViashError Bad arguments for option \'--upper_bound_size=*\': \'$VIASH_PAR_UPPER_BOUND_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_UPPER_BOUND_SIZE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --step_size)
            [ -n "$VIASH_PAR_STEP_SIZE" ] && ViashError Bad arguments for option \'--step_size\': \'$VIASH_PAR_STEP_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STEP_SIZE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --step_size. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --step_size=*)
            [ -n "$VIASH_PAR_STEP_SIZE" ] && ViashError Bad arguments for option \'--step_size=*\': \'$VIASH_PAR_STEP_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STEP_SIZE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --map_qual)
            [ -n "$VIASH_PAR_MAP_QUAL" ] && ViashError Bad arguments for option \'--map_qual\': \'$VIASH_PAR_MAP_QUAL\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MAP_QUAL="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --map_qual. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --map_qual=*)
            [ -n "$VIASH_PAR_MAP_QUAL" ] && ViashError Bad arguments for option \'--map_qual=*\': \'$VIASH_PAR_MAP_QUAL\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MAP_QUAL=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --min_intron)
            [ -n "$VIASH_PAR_MIN_INTRON" ] && ViashError Bad arguments for option \'--min_intron\': \'$VIASH_PAR_MIN_INTRON\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MIN_INTRON="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --min_intron. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --min_intron=*)
            [ -n "$VIASH_PAR_MIN_INTRON" ] && ViashError Bad arguments for option \'--min_intron=*\': \'$VIASH_PAR_MIN_INTRON\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MIN_INTRON=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --min_splice_read)
            [ -n "$VIASH_PAR_MIN_SPLICE_READ" ] && ViashError Bad arguments for option \'--min_splice_read\': \'$VIASH_PAR_MIN_SPLICE_READ\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MIN_SPLICE_READ="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --min_splice_read. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --min_splice_read=*)
            [ -n "$VIASH_PAR_MIN_SPLICE_READ" ] && ViashError Bad arguments for option \'--min_splice_read=*\': \'$VIASH_PAR_MIN_SPLICE_READ\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MIN_SPLICE_READ=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sampling_percentile_lower_bound)
            [ -n "$VIASH_PAR_SAMPLING_PERCENTILE_LOWER_BOUND" ] && ViashError Bad arguments for option \'--sampling_percentile_lower_bound\': \'$VIASH_PAR_SAMPLING_PERCENTILE_LOWER_BOUND\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SAMPLING_PERCENTILE_LOWER_BOUND="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sampling_percentile_lower_bound. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sampling_percentile_lower_bound=*)
            [ -n "$VIASH_PAR_SAMPLING_PERCENTILE_LOWER_BOUND" ] && ViashError Bad arguments for option \'--sampling_percentile_lower_bound=*\': \'$VIASH_PAR_SAMPLING_PERCENTILE_LOWER_BOUND\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SAMPLING_PERCENTILE_LOWER_BOUND=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sampling_percentile_upper_bound)
            [ -n "$VIASH_PAR_SAMPLING_PERCENTILE_UPPER_BOUND" ] && ViashError Bad arguments for option \'--sampling_percentile_upper_bound\': \'$VIASH_PAR_SAMPLING_PERCENTILE_UPPER_BOUND\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SAMPLING_PERCENTILE_UPPER_BOUND="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sampling_percentile_upper_bound. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sampling_percentile_upper_bound=*)
            [ -n "$VIASH_PAR_SAMPLING_PERCENTILE_UPPER_BOUND" ] && ViashError Bad arguments for option \'--sampling_percentile_upper_bound=*\': \'$VIASH_PAR_SAMPLING_PERCENTILE_UPPER_BOUND\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SAMPLING_PERCENTILE_UPPER_BOUND=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sampling_percentile_step)
            [ -n "$VIASH_PAR_SAMPLING_PERCENTILE_STEP" ] && ViashError Bad arguments for option \'--sampling_percentile_step\': \'$VIASH_PAR_SAMPLING_PERCENTILE_STEP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SAMPLING_PERCENTILE_STEP="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sampling_percentile_step. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sampling_percentile_step=*)
            [ -n "$VIASH_PAR_SAMPLING_PERCENTILE_STEP" ] && ViashError Bad arguments for option \'--sampling_percentile_step=*\': \'$VIASH_PAR_SAMPLING_PERCENTILE_STEP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SAMPLING_PERCENTILE_STEP=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --read_count_upper_limit)
            [ -n "$VIASH_PAR_READ_COUNT_UPPER_LIMIT" ] && ViashError Bad arguments for option \'--read_count_upper_limit\': \'$VIASH_PAR_READ_COUNT_UPPER_LIMIT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READ_COUNT_UPPER_LIMIT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --read_count_upper_limit. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --read_count_upper_limit=*)
            [ -n "$VIASH_PAR_READ_COUNT_UPPER_LIMIT" ] && ViashError Bad arguments for option \'--read_count_upper_limit=*\': \'$VIASH_PAR_READ_COUNT_UPPER_LIMIT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READ_COUNT_UPPER_LIMIT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --minimum_coverage)
            [ -n "$VIASH_PAR_MINIMUM_COVERAGE" ] && ViashError Bad arguments for option \'--minimum_coverage\': \'$VIASH_PAR_MINIMUM_COVERAGE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MINIMUM_COVERAGE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --minimum_coverage. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --minimum_coverage=*)
            [ -n "$VIASH_PAR_MINIMUM_COVERAGE" ] && ViashError Bad arguments for option \'--minimum_coverage=*\': \'$VIASH_PAR_MINIMUM_COVERAGE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MINIMUM_COVERAGE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --tin_sample_size)
            [ -n "$VIASH_PAR_TIN_SAMPLE_SIZE" ] && ViashError Bad arguments for option \'--tin_sample_size\': \'$VIASH_PAR_TIN_SAMPLE_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TIN_SAMPLE_SIZE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --tin_sample_size. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --tin_sample_size=*)
            [ -n "$VIASH_PAR_TIN_SAMPLE_SIZE" ] && ViashError Bad arguments for option \'--tin_sample_size=*\': \'$VIASH_PAR_TIN_SAMPLE_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TIN_SAMPLE_SIZE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --subtract_background)
            [ -n "$VIASH_PAR_SUBTRACT_BACKGROUND" ] && ViashError Bad arguments for option \'--subtract_background\': \'$VIASH_PAR_SUBTRACT_BACKGROUND\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SUBTRACT_BACKGROUND=true
            shift 1
            ;;
        --output_format)
            [ -n "$VIASH_PAR_OUTPUT_FORMAT" ] && ViashError Bad arguments for option \'--output_format\': \'$VIASH_PAR_OUTPUT_FORMAT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_FORMAT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --output_format. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --output_format=*)
            [ -n "$VIASH_PAR_OUTPUT_FORMAT" ] && ViashError Bad arguments for option \'--output_format=*\': \'$VIASH_PAR_OUTPUT_FORMAT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT_FORMAT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pr_bases)
            [ -n "$VIASH_PAR_PR_BASES" ] && ViashError Bad arguments for option \'--pr_bases\': \'$VIASH_PAR_PR_BASES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PR_BASES="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pr_bases. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pr_bases=*)
            [ -n "$VIASH_PAR_PR_BASES" ] && ViashError Bad arguments for option \'--pr_bases=*\': \'$VIASH_PAR_PR_BASES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PR_BASES=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --tr_bias)
            [ -n "$VIASH_PAR_TR_BIAS" ] && ViashError Bad arguments for option \'--tr_bias\': \'$VIASH_PAR_TR_BIAS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TR_BIAS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --tr_bias. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --tr_bias=*)
            [ -n "$VIASH_PAR_TR_BIAS" ] && ViashError Bad arguments for option \'--tr_bias=*\': \'$VIASH_PAR_TR_BIAS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TR_BIAS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --algorithm)
            [ -n "$VIASH_PAR_ALGORITHM" ] && ViashError Bad arguments for option \'--algorithm\': \'$VIASH_PAR_ALGORITHM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALGORITHM="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --algorithm. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --algorithm=*)
            [ -n "$VIASH_PAR_ALGORITHM" ] && ViashError Bad arguments for option \'--algorithm=*\': \'$VIASH_PAR_ALGORITHM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALGORITHM=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sequencing_protocol)
            [ -n "$VIASH_PAR_SEQUENCING_PROTOCOL" ] && ViashError Bad arguments for option \'--sequencing_protocol\': \'$VIASH_PAR_SEQUENCING_PROTOCOL\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEQUENCING_PROTOCOL="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sequencing_protocol. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sequencing_protocol=*)
            [ -n "$VIASH_PAR_SEQUENCING_PROTOCOL" ] && ViashError Bad arguments for option \'--sequencing_protocol=*\': \'$VIASH_PAR_SEQUENCING_PROTOCOL\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEQUENCING_PROTOCOL=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sorted)
            [ -n "$VIASH_PAR_SORTED" ] && ViashError Bad arguments for option \'--sorted\': \'$VIASH_PAR_SORTED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SORTED=true
            shift 1
            ;;
        --java_memory_size)
            [ -n "$VIASH_PAR_JAVA_MEMORY_SIZE" ] && ViashError Bad arguments for option \'--java_memory_size\': \'$VIASH_PAR_JAVA_MEMORY_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JAVA_MEMORY_SIZE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --java_memory_size. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --java_memory_size=*)
            [ -n "$VIASH_PAR_JAVA_MEMORY_SIZE" ] && ViashError Bad arguments for option \'--java_memory_size=*\': \'$VIASH_PAR_JAVA_MEMORY_SIZE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_JAVA_MEMORY_SIZE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --skip_deseq2_qc)
            [ -n "$VIASH_PAR_SKIP_DESEQ2_QC" ] && ViashError Bad arguments for option \'--skip_deseq2_qc\': \'$VIASH_PAR_SKIP_DESEQ2_QC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_DESEQ2_QC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --skip_deseq2_qc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --skip_deseq2_qc=*)
            [ -n "$VIASH_PAR_SKIP_DESEQ2_QC" ] && ViashError Bad arguments for option \'--skip_deseq2_qc=*\': \'$VIASH_PAR_SKIP_DESEQ2_QC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SKIP_DESEQ2_QC=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pca_header_multiqc)
            [ -n "$VIASH_PAR_PCA_HEADER_MULTIQC" ] && ViashError Bad arguments for option \'--pca_header_multiqc\': \'$VIASH_PAR_PCA_HEADER_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PCA_HEADER_MULTIQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pca_header_multiqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pca_header_multiqc=*)
            [ -n "$VIASH_PAR_PCA_HEADER_MULTIQC" ] && ViashError Bad arguments for option \'--pca_header_multiqc=*\': \'$VIASH_PAR_PCA_HEADER_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PCA_HEADER_MULTIQC=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --clustering_header_multiqc)
            [ -n "$VIASH_PAR_CLUSTERING_HEADER_MULTIQC" ] && ViashError Bad arguments for option \'--clustering_header_multiqc\': \'$VIASH_PAR_CLUSTERING_HEADER_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CLUSTERING_HEADER_MULTIQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --clustering_header_multiqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --clustering_header_multiqc=*)
            [ -n "$VIASH_PAR_CLUSTERING_HEADER_MULTIQC" ] && ViashError Bad arguments for option \'--clustering_header_multiqc=*\': \'$VIASH_PAR_CLUSTERING_HEADER_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CLUSTERING_HEADER_MULTIQC=$(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
            ;;
        --extra_deseq2_args)
            [ -n "$VIASH_PAR_EXTRA_DESEQ2_ARGS" ] && ViashError Bad arguments for option \'--extra_deseq2_args\': \'$VIASH_PAR_EXTRA_DESEQ2_ARGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_EXTRA_DESEQ2_ARGS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --extra_deseq2_args. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --extra_deseq2_args=*)
            [ -n "$VIASH_PAR_EXTRA_DESEQ2_ARGS" ] && ViashError Bad arguments for option \'--extra_deseq2_args=*\': \'$VIASH_PAR_EXTRA_DESEQ2_ARGS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_EXTRA_DESEQ2_ARGS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --extra_deseq2_args2)
            [ -n "$VIASH_PAR_EXTRA_DESEQ2_ARGS2" ] && ViashError Bad arguments for option \'--extra_deseq2_args2\': \'$VIASH_PAR_EXTRA_DESEQ2_ARGS2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_EXTRA_DESEQ2_ARGS2="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --extra_deseq2_args2. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --extra_deseq2_args2=*)
            [ -n "$VIASH_PAR_EXTRA_DESEQ2_ARGS2" ] && ViashError Bad arguments for option \'--extra_deseq2_args2=*\': \'$VIASH_PAR_EXTRA_DESEQ2_ARGS2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_EXTRA_DESEQ2_ARGS2=$(ViashRemoveFlags "$1")
            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
            ;;
        --passed_trimmed_reads)
            [ -n "$VIASH_PAR_PASSED_TRIMMED_READS" ] && ViashError Bad arguments for option \'--passed_trimmed_reads\': \'$VIASH_PAR_PASSED_TRIMMED_READS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PASSED_TRIMMED_READS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --passed_trimmed_reads. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --passed_trimmed_reads=*)
            [ -n "$VIASH_PAR_PASSED_TRIMMED_READS" ] && ViashError Bad arguments for option \'--passed_trimmed_reads=*\': \'$VIASH_PAR_PASSED_TRIMMED_READS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PASSED_TRIMMED_READS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --num_trimmed_reads)
            [ -n "$VIASH_PAR_NUM_TRIMMED_READS" ] && ViashError Bad arguments for option \'--num_trimmed_reads\': \'$VIASH_PAR_NUM_TRIMMED_READS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_NUM_TRIMMED_READS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --num_trimmed_reads. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --num_trimmed_reads=*)
            [ -n "$VIASH_PAR_NUM_TRIMMED_READS" ] && ViashError Bad arguments for option \'--num_trimmed_reads=*\': \'$VIASH_PAR_NUM_TRIMMED_READS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_NUM_TRIMMED_READS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --passed_mapping)
            [ -n "$VIASH_PAR_PASSED_MAPPING" ] && ViashError Bad arguments for option \'--passed_mapping\': \'$VIASH_PAR_PASSED_MAPPING\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PASSED_MAPPING="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --passed_mapping. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --passed_mapping=*)
            [ -n "$VIASH_PAR_PASSED_MAPPING" ] && ViashError Bad arguments for option \'--passed_mapping=*\': \'$VIASH_PAR_PASSED_MAPPING\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PASSED_MAPPING=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --percent_mapped)
            [ -n "$VIASH_PAR_PERCENT_MAPPED" ] && ViashError Bad arguments for option \'--percent_mapped\': \'$VIASH_PAR_PERCENT_MAPPED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PERCENT_MAPPED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --percent_mapped. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --percent_mapped=*)
            [ -n "$VIASH_PAR_PERCENT_MAPPED" ] && ViashError Bad arguments for option \'--percent_mapped=*\': \'$VIASH_PAR_PERCENT_MAPPED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PERCENT_MAPPED=$(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_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
            ;;
        --sortmerna_multiqc)
            [ -n "$VIASH_PAR_SORTMERNA_MULTIQC" ] && ViashError Bad arguments for option \'--sortmerna_multiqc\': \'$VIASH_PAR_SORTMERNA_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SORTMERNA_MULTIQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sortmerna_multiqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sortmerna_multiqc=*)
            [ -n "$VIASH_PAR_SORTMERNA_MULTIQC" ] && ViashError Bad arguments for option \'--sortmerna_multiqc=*\': \'$VIASH_PAR_SORTMERNA_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SORTMERNA_MULTIQC=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --star_multiqc)
            [ -n "$VIASH_PAR_STAR_MULTIQC" ] && ViashError Bad arguments for option \'--star_multiqc\': \'$VIASH_PAR_STAR_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STAR_MULTIQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --star_multiqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --star_multiqc=*)
            [ -n "$VIASH_PAR_STAR_MULTIQC" ] && ViashError Bad arguments for option \'--star_multiqc=*\': \'$VIASH_PAR_STAR_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STAR_MULTIQC=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --rsem_multiqc)
            [ -n "$VIASH_PAR_RSEM_MULTIQC" ] && ViashError Bad arguments for option \'--rsem_multiqc\': \'$VIASH_PAR_RSEM_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RSEM_MULTIQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --rsem_multiqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --rsem_multiqc=*)
            [ -n "$VIASH_PAR_RSEM_MULTIQC" ] && ViashError Bad arguments for option \'--rsem_multiqc=*\': \'$VIASH_PAR_RSEM_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RSEM_MULTIQC=$(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
            ;;
        --markduplicates_multiqc)
            [ -n "$VIASH_PAR_MARKDUPLICATES_MULTIQC" ] && ViashError Bad arguments for option \'--markduplicates_multiqc\': \'$VIASH_PAR_MARKDUPLICATES_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MARKDUPLICATES_MULTIQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --markduplicates_multiqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --markduplicates_multiqc=*)
            [ -n "$VIASH_PAR_MARKDUPLICATES_MULTIQC" ] && ViashError Bad arguments for option \'--markduplicates_multiqc=*\': \'$VIASH_PAR_MARKDUPLICATES_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MARKDUPLICATES_MULTIQC=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --pseudo_multiqc)
            [ -n "$VIASH_PAR_PSEUDO_MULTIQC" ] && ViashError Bad arguments for option \'--pseudo_multiqc\': \'$VIASH_PAR_PSEUDO_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_MULTIQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_multiqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --pseudo_multiqc=*)
            [ -n "$VIASH_PAR_PSEUDO_MULTIQC" ] && ViashError Bad arguments for option \'--pseudo_multiqc=*\': \'$VIASH_PAR_PSEUDO_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PSEUDO_MULTIQC=$(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_output_pdf)
            [ -n "$VIASH_PAR_QUALIMAP_OUTPUT_PDF" ] && ViashError Bad arguments for option \'--qualimap_output_pdf\': \'$VIASH_PAR_QUALIMAP_OUTPUT_PDF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUALIMAP_OUTPUT_PDF="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --qualimap_output_pdf. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --qualimap_output_pdf=*)
            [ -n "$VIASH_PAR_QUALIMAP_OUTPUT_PDF" ] && ViashError Bad arguments for option \'--qualimap_output_pdf=*\': \'$VIASH_PAR_QUALIMAP_OUTPUT_PDF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUALIMAP_OUTPUT_PDF=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --qualimap_output_dir)
            [ -n "$VIASH_PAR_QUALIMAP_OUTPUT_DIR" ] && ViashError Bad arguments for option \'--qualimap_output_dir\': \'$VIASH_PAR_QUALIMAP_OUTPUT_DIR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUALIMAP_OUTPUT_DIR="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --qualimap_output_dir. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --qualimap_output_dir=*)
            [ -n "$VIASH_PAR_QUALIMAP_OUTPUT_DIR" ] && ViashError Bad arguments for option \'--qualimap_output_dir=*\': \'$VIASH_PAR_QUALIMAP_OUTPUT_DIR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUALIMAP_OUTPUT_DIR=$(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
            ;;
        --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
            ;;
        --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
            ;;
        --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_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_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_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="unstranded"
fi
if [ -z ${VIASH_PAR_GTF_GROUP_FEATURES+x} ]; then
  VIASH_PAR_GTF_GROUP_FEATURES="gene_id"
fi
if [ -z ${VIASH_PAR_GTF_EXTRA_ATTRIBUTES+x} ]; then
  VIASH_PAR_GTF_EXTRA_ATTRIBUTES="gene_name"
fi
if [ -z ${VIASH_PAR_SKIP_QC+x} ]; then
  VIASH_PAR_SKIP_QC="false"
fi
if [ -z ${VIASH_PAR_SKIP_ALIGN+x} ]; then
  VIASH_PAR_SKIP_ALIGN="false"
fi
if [ -z ${VIASH_PAR_SKIP_PRESEQ+x} ]; then
  VIASH_PAR_SKIP_PRESEQ="false"
fi
if [ -z ${VIASH_PAR_EXTRA_PRESEQ_ARGS+x} ]; then
  VIASH_PAR_EXTRA_PRESEQ_ARGS="-verbose -bam -seed 1"
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_BIOTYPES_HEADER+x} ]; then
  VIASH_PAR_BIOTYPES_HEADER="src/assets/multiqc/biotypes_header.txt"
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_SAMPLE_SIZE+x} ]; then
  VIASH_PAR_SAMPLE_SIZE="200000"
fi
if [ -z ${VIASH_PAR_LOWER_BOUND_SIZE+x} ]; then
  VIASH_PAR_LOWER_BOUND_SIZE="-250"
fi
if [ -z ${VIASH_PAR_UPPER_BOUND_SIZE+x} ]; then
  VIASH_PAR_UPPER_BOUND_SIZE="250"
fi
if [ -z ${VIASH_PAR_STEP_SIZE+x} ]; then
  VIASH_PAR_STEP_SIZE="5"
fi
if [ -z ${VIASH_PAR_MAP_QUAL+x} ]; then
  VIASH_PAR_MAP_QUAL="30"
fi
if [ -z ${VIASH_PAR_MIN_INTRON+x} ]; then
  VIASH_PAR_MIN_INTRON="50"
fi
if [ -z ${VIASH_PAR_MIN_SPLICE_READ+x} ]; then
  VIASH_PAR_MIN_SPLICE_READ="1"
fi
if [ -z ${VIASH_PAR_SAMPLING_PERCENTILE_LOWER_BOUND+x} ]; then
  VIASH_PAR_SAMPLING_PERCENTILE_LOWER_BOUND="5"
fi
if [ -z ${VIASH_PAR_SAMPLING_PERCENTILE_UPPER_BOUND+x} ]; then
  VIASH_PAR_SAMPLING_PERCENTILE_UPPER_BOUND="100"
fi
if [ -z ${VIASH_PAR_SAMPLING_PERCENTILE_STEP+x} ]; then
  VIASH_PAR_SAMPLING_PERCENTILE_STEP="5"
fi
if [ -z ${VIASH_PAR_READ_COUNT_UPPER_LIMIT+x} ]; then
  VIASH_PAR_READ_COUNT_UPPER_LIMIT="500"
fi
if [ -z ${VIASH_PAR_MINIMUM_COVERAGE+x} ]; then
  VIASH_PAR_MINIMUM_COVERAGE="10"
fi
if [ -z ${VIASH_PAR_TIN_SAMPLE_SIZE+x} ]; then
  VIASH_PAR_TIN_SAMPLE_SIZE="100"
fi
if [ -z ${VIASH_PAR_SUBTRACT_BACKGROUND+x} ]; then
  VIASH_PAR_SUBTRACT_BACKGROUND="false"
fi
if [ -z ${VIASH_PAR_OUTPUT_FORMAT+x} ]; then
  VIASH_PAR_OUTPUT_FORMAT="html"
fi
if [ -z ${VIASH_PAR_PR_BASES+x} ]; then
  VIASH_PAR_PR_BASES="100"
fi
if [ -z ${VIASH_PAR_TR_BIAS+x} ]; then
  VIASH_PAR_TR_BIAS="1000"
fi
if [ -z ${VIASH_PAR_ALGORITHM+x} ]; then
  VIASH_PAR_ALGORITHM="uniquely-mapped-reads"
fi
if [ -z ${VIASH_PAR_SEQUENCING_PROTOCOL+x} ]; then
  VIASH_PAR_SEQUENCING_PROTOCOL="non-strand-specific"
fi
if [ -z ${VIASH_PAR_SORTED+x} ]; then
  VIASH_PAR_SORTED="false"
fi
if [ -z ${VIASH_PAR_JAVA_MEMORY_SIZE+x} ]; then
  VIASH_PAR_JAVA_MEMORY_SIZE="4G"
fi
if [ -z ${VIASH_PAR_PCA_HEADER_MULTIQC+x} ]; then
  VIASH_PAR_PCA_HEADER_MULTIQC="src/assets/multiqc/deseq2_pca_header.txt"
fi
if [ -z ${VIASH_PAR_CLUSTERING_HEADER_MULTIQC+x} ]; then
  VIASH_PAR_CLUSTERING_HEADER_MULTIQC="src/assets/multiqc/deseq2_clustering_header.txt"
fi
if [ -z ${VIASH_PAR_EXTRA_DESEQ2_ARGS+x} ]; then
  VIASH_PAR_EXTRA_DESEQ2_ARGS="--id_col 1 --sample_suffix '' --outprefix deseq2 --count_col 3"
fi
if [ -z ${VIASH_PAR_EXTRA_DESEQ2_ARGS2+x} ]; then
  VIASH_PAR_EXTRA_DESEQ2_ARGS2="star_salmon"
fi
if [ -z ${VIASH_PAR_PRESEQ_OUTPUT+x} ]; then
  VIASH_PAR_PRESEQ_OUTPUT="\$id.lc_extrap.txt"
fi
if [ -z ${VIASH_PAR_BAMSTAT_OUTPUT+x} ]; then
  VIASH_PAR_BAMSTAT_OUTPUT="\$id.mapping_quality.txt"
fi
if [ -z ${VIASH_PAR_STRANDEDNESS_OUTPUT+x} ]; then
  VIASH_PAR_STRANDEDNESS_OUTPUT="\$id.strandedness.txt"
fi
if [ -z ${VIASH_PAR_INNER_DIST_OUTPUT_STATS+x} ]; then
  VIASH_PAR_INNER_DIST_OUTPUT_STATS="\$id.inner_distance.stats"
fi
if [ -z ${VIASH_PAR_INNER_DIST_OUTPUT_DIST+x} ]; then
  VIASH_PAR_INNER_DIST_OUTPUT_DIST="\$id.inner_distance.txt"
fi
if [ -z ${VIASH_PAR_INNER_DIST_OUTPUT_FREQ+x} ]; then
  VIASH_PAR_INNER_DIST_OUTPUT_FREQ="\$id.inner_distance_freq.txt"
fi
if [ -z ${VIASH_PAR_INNER_DIST_OUTPUT_PLOT+x} ]; then
  VIASH_PAR_INNER_DIST_OUTPUT_PLOT="\$id.inner_distance_plot.pdf"
fi
if [ -z ${VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R+x} ]; then
  VIASH_PAR_INNER_DIST_OUTPUT_PLOT_R="\$id.inner_distance_plot.r"
fi
if [ -z ${VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG+x} ]; then
  VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_LOG="\$id.junction_annotation.log"
fi
if [ -z ${VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R+x} ]; then
  VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_PLOT_R="\$id.junction_annotation_plot.r"
fi
if [ -z ${VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED+x} ]; then
  VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_BED="\$id.junction_annotation.bed"
fi
if [ -z ${VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT+x} ]; then
  VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_INTERACT="\$id.junction_annotation.Interact.bed"
fi
if [ -z ${VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET+x} ]; then
  VIASH_PAR_JUNCTION_ANNOTATION_OUTPUT_JUNCTION_SHEET="\$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="\$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="\$id.splice_junctions_plot.pdf"
fi
if [ -z ${VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R+x} ]; then
  VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT_R="\$id.junction_saturation_plot.r"
fi
if [ -z ${VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT+x} ]; then
  VIASH_PAR_JUNCTION_SATURATION_OUTPUT_PLOT="\$id.junction_saturation_plot.pdf"
fi
if [ -z ${VIASH_PAR_READ_DISTRIBUTION_OUTPUT+x} ]; then
  VIASH_PAR_READ_DISTRIBUTION_OUTPUT="\$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="\$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="\$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="\$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="\$id.duplication_rate_sequencing.xls"
fi
if [ -z ${VIASH_PAR_TIN_OUTPUT_SUMMARY+x} ]; then
  VIASH_PAR_TIN_OUTPUT_SUMMARY="\$id.tin_summary.txt"
fi
if [ -z ${VIASH_PAR_TIN_OUTPUT_METRICS+x} ]; then
  VIASH_PAR_TIN_OUTPUT_METRICS="\$id.tin.xls"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_DUPMATRIX="\$id.dup_matrix.txt"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_DUP_INTERCEPT_MQC="\$id.dup_intercept_mqc.txt"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_BOXPLOT="\$id.duprate_exp_boxplot.pdf"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_DUPRATE_EXP_DENSPLOT="\$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="\$id.duprate_exp_density_curve_mqc.pdf"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_EXPRESSION_HISTOGRAM="\$id.expression_hist.pdf"
fi
if [ -z ${VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE+x} ]; then
  VIASH_PAR_DUPRADAR_OUTPUT_INTERCEPT_SLOPE="\$id.intercept_slope.txt"
fi
if [ -z ${VIASH_PAR_QUALIMAP_OUTPUT_PDF+x} ]; then
  VIASH_PAR_QUALIMAP_OUTPUT_PDF="\$id.qualimap_output.pdf"
fi
if [ -z ${VIASH_PAR_QUALIMAP_OUTPUT_DIR+x} ]; then
  VIASH_PAR_QUALIMAP_OUTPUT_DIR="\$id.qualimap_output"
fi
if [ -z ${VIASH_PAR_DESEQ2_OUTPUT+x} ]; then
  VIASH_PAR_DESEQ2_OUTPUT="deseq2"
fi
if [ -z ${VIASH_PAR_DESEQ2_OUTPUT_PSEUDO+x} ]; then
  VIASH_PAR_DESEQ2_OUTPUT_PSEUDO="deseq2_pseudo"
fi
if [ -z ${VIASH_PAR_MULTIQC_REPORT+x} ]; then
  VIASH_PAR_MULTIQC_REPORT="multiqc_report.html"
fi
if [ -z ${VIASH_PAR_MULTIQC_DATA+x} ]; then
  VIASH_PAR_MULTIQC_DATA="multiqc_data"
fi
if [ -z ${VIASH_PAR_MULTIQC_PLOTS+x} ]; then
  VIASH_PAR_MULTIQC_PLOTS="multiqc_plots"
fi
if [ -z ${VIASH_PAR_FEATURECOUNTS+x} ]; then
  VIASH_PAR_FEATURECOUNTS="\$id.featureCounts.txt"
fi
if [ -z ${VIASH_PAR_FEATURECOUNTS_SUMMARY+x} ]; then
  VIASH_PAR_FEATURECOUNTS_SUMMARY="\$id.featureCounts.txt.summary"
fi
if [ -z ${VIASH_PAR_FEATURECOUNTS_MULTIQC+x} ]; then
  VIASH_PAR_FEATURECOUNTS_MULTIQC="\$id.featureCounts_mqc.tsv"
fi
if [ -z ${VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC+x} ]; then
  VIASH_PAR_FEATURECOUNTS_RRNA_MULTIQC="\$id.featureCounts_rrna_mqc.tsv"
fi
if [ -z ${VIASH_PAR_TPM_GENE+x} ]; then
  VIASH_PAR_TPM_GENE="salmon.merged.gene_tpm.tsv"
fi
if [ -z ${VIASH_PAR_COUNTS_GENE+x} ]; then
  VIASH_PAR_COUNTS_GENE="salmon.merged.gene_counts.tsv"
fi
if [ -z ${VIASH_PAR_COUNTS_GENE_LENGTH_SCALED+x} ]; then
  VIASH_PAR_COUNTS_GENE_LENGTH_SCALED="salmon.merged.gene_counts_length_scaled.tsv"
fi
if [ -z ${VIASH_PAR_COUNTS_GENE_SCALED+x} ]; then
  VIASH_PAR_COUNTS_GENE_SCALED="salmon.merged.gene_counts_scaled.tsv"
fi
if [ -z ${VIASH_PAR_TPM_TRANSCRIPT+x} ]; then
  VIASH_PAR_TPM_TRANSCRIPT="salmon.merged.transcript_tpm.tsv"
fi
if [ -z ${VIASH_PAR_COUNTS_TRANSCRIPT+x} ]; then
  VIASH_PAR_COUNTS_TRANSCRIPT="salmon.merged.transcript_counts.tsv"
fi
if [ -z ${VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT+x} ]; then
  VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT="salmon_merged_summarizedexperiment"
fi
if [ -z ${VIASH_PAR_PSEUDO_TPM_GENE+x} ]; then
  VIASH_PAR_PSEUDO_TPM_GENE="pseudo_gene_tpm.tsv"
fi
if [ -z ${VIASH_PAR_PSEUDO_COUNTS_GENE+x} ]; then
  VIASH_PAR_PSEUDO_COUNTS_GENE="pseudo_gene_counts.tsv"
fi
if [ -z ${VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED+x} ]; then
  VIASH_PAR_PSEUDO_COUNTS_GENE_LENGTH_SCALED="pseudo_gene_counts_length_scaled.tsv"
fi
if [ -z ${VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED+x} ]; then
  VIASH_PAR_PSEUDO_COUNTS_GENE_SCALED="pseudo_gene_counts_scaled.tsv"
fi
if [ -z ${VIASH_PAR_PSEUDO_TPM_TRANSCRIPT+x} ]; then
  VIASH_PAR_PSEUDO_TPM_TRANSCRIPT="pseudo_transcript_tpm.tsv"
fi
if [ -z ${VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT+x} ]; then
  VIASH_PAR_PSEUDO_COUNTS_TRANSCRIPT="pseudo_transcript_counts.tsv"
fi
if [ -z ${VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT+x} ]; then
  VIASH_PAR_PSEUDO_QUANT_MERGED_SUMMARIZEDEXPERIMENT="pseudo_quant_merged_summarizedexperiment"
fi

# check whether required files exist
if [ ! -z "$VIASH_PAR_GENOME_BAM" ] && [ ! -e "$VIASH_PAR_GENOME_BAM" ]; then
  ViashError "Input file '$VIASH_PAR_GENOME_BAM' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_GENOME_BAM_INDEX" ] && [ ! -e "$VIASH_PAR_GENOME_BAM_INDEX" ]; then
  ViashError "Input file '$VIASH_PAR_GENOME_BAM_INDEX' 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_GTF" ] && [ ! -e "$VIASH_PAR_GTF" ]; then
  ViashError "Input file '$VIASH_PAR_GTF' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_QUANT_OUT_DIR" ] && [ ! -e "$VIASH_PAR_QUANT_OUT_DIR" ]; then
  ViashError "Input file '$VIASH_PAR_QUANT_OUT_DIR' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_QUANT_RESULTS_FILE" ] && [ ! -e "$VIASH_PAR_QUANT_RESULTS_FILE" ]; then
  ViashError "Input file '$VIASH_PAR_QUANT_RESULTS_FILE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PSEUDO_QUANT_OUT_DIR" ] && [ ! -e "$VIASH_PAR_PSEUDO_QUANT_OUT_DIR" ]; then
  ViashError "Input file '$VIASH_PAR_PSEUDO_QUANT_OUT_DIR' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PSEUDO_SALMON_QUANT_RESULTS_FILE" ] && [ ! -e "$VIASH_PAR_PSEUDO_SALMON_QUANT_RESULTS_FILE" ]; then
  ViashError "Input file '$VIASH_PAR_PSEUDO_SALMON_QUANT_RESULTS_FILE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PSEUDO_KALLISTO_QUANT_RESULTS_FILE" ] && [ ! -e "$VIASH_PAR_PSEUDO_KALLISTO_QUANT_RESULTS_FILE" ]; then
  ViashError "Input file '$VIASH_PAR_PSEUDO_KALLISTO_QUANT_RESULTS_FILE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_RSEM_COUNTS_GENE" ] && [ ! -e "$VIASH_PAR_RSEM_COUNTS_GENE" ]; then
  ViashError "Input 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 "Input file '$VIASH_PAR_RSEM_COUNTS_TRANSCRIPTS' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_BIOTYPES_HEADER" ] && [ ! -e "$VIASH_PAR_BIOTYPES_HEADER" ]; then
  ViashError "Input file '$VIASH_PAR_BIOTYPES_HEADER' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_PCA_HEADER_MULTIQC" ] && [ ! -e "$VIASH_PAR_PCA_HEADER_MULTIQC" ]; then
  ViashError "Input file '$VIASH_PAR_PCA_HEADER_MULTIQC' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_CLUSTERING_HEADER_MULTIQC" ] && [ ! -e "$VIASH_PAR_CLUSTERING_HEADER_MULTIQC" ]; then
  ViashError "Input file '$VIASH_PAR_CLUSTERING_HEADER_MULTIQC' 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
if [ ! -z "$VIASH_PAR_RSEM_MULTIQC" ] && [ ! -e "$VIASH_PAR_RSEM_MULTIQC" ]; then
  ViashError "Input file '$VIASH_PAR_RSEM_MULTIQC' does not exist."
  exit 1
fi

# check whether parameters values are of the right type
if [[ -n "$VIASH_PAR_PAIRED" ]]; then
  if ! [[ "$VIASH_PAR_PAIRED" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--paired' 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. 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. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_ALIGN" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_ALIGN" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_align' has to be a boolean. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_PSEUDO_ALIGN" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_PSEUDO_ALIGN" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_pseudo_align' has to be a boolean. 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. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
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. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SAMPLE_SIZE" ]]; then
  if ! [[ "$VIASH_PAR_SAMPLE_SIZE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--sample_size' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_SAMPLE_SIZE -lt 1 ]]; then
    ViashError '--sample_size' has be more than or equal to 1. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_LOWER_BOUND_SIZE" ]]; then
  if ! [[ "$VIASH_PAR_LOWER_BOUND_SIZE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--lower_bound_size' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_UPPER_BOUND_SIZE" ]]; then
  if ! [[ "$VIASH_PAR_UPPER_BOUND_SIZE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--upper_bound_size' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_STEP_SIZE" ]]; then
  if ! [[ "$VIASH_PAR_STEP_SIZE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--step_size' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_MAP_QUAL" ]]; then
  if ! [[ "$VIASH_PAR_MAP_QUAL" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--map_qual' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_MAP_QUAL -lt 0 ]]; then
    ViashError '--map_qual' has be more than or equal to 0. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_MIN_INTRON" ]]; then
  if ! [[ "$VIASH_PAR_MIN_INTRON" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--min_intron' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_MIN_INTRON -lt 1 ]]; then
    ViashError '--min_intron' has be more than or equal to 1. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_MIN_SPLICE_READ" ]]; then
  if ! [[ "$VIASH_PAR_MIN_SPLICE_READ" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--min_splice_read' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_MIN_SPLICE_READ -lt 1 ]]; then
    ViashError '--min_splice_read' has be more than or equal to 1. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SAMPLING_PERCENTILE_LOWER_BOUND" ]]; then
  if ! [[ "$VIASH_PAR_SAMPLING_PERCENTILE_LOWER_BOUND" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--sampling_percentile_lower_bound' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_SAMPLING_PERCENTILE_LOWER_BOUND -lt 0 ]]; then
    ViashError '--sampling_percentile_lower_bound' has be more than or equal to 0. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_SAMPLING_PERCENTILE_LOWER_BOUND -gt 100 ]]; then
    ViashError '--sampling_percentile_lower_bound' has be less than or equal to 100. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SAMPLING_PERCENTILE_UPPER_BOUND" ]]; then
  if ! [[ "$VIASH_PAR_SAMPLING_PERCENTILE_UPPER_BOUND" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--sampling_percentile_upper_bound' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_SAMPLING_PERCENTILE_UPPER_BOUND -lt 0 ]]; then
    ViashError '--sampling_percentile_upper_bound' has be more than or equal to 0. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_SAMPLING_PERCENTILE_UPPER_BOUND -gt 100 ]]; then
    ViashError '--sampling_percentile_upper_bound' has be less than or equal to 100. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SAMPLING_PERCENTILE_STEP" ]]; then
  if ! [[ "$VIASH_PAR_SAMPLING_PERCENTILE_STEP" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--sampling_percentile_step' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_SAMPLING_PERCENTILE_STEP -lt 0 ]]; then
    ViashError '--sampling_percentile_step' has be more than or equal to 0. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_SAMPLING_PERCENTILE_STEP -gt 100 ]]; then
    ViashError '--sampling_percentile_step' has be less than or equal to 100. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_READ_COUNT_UPPER_LIMIT" ]]; then
  if ! [[ "$VIASH_PAR_READ_COUNT_UPPER_LIMIT" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--read_count_upper_limit' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_READ_COUNT_UPPER_LIMIT -lt 1 ]]; then
    ViashError '--read_count_upper_limit' has be more than or equal to 1. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_MINIMUM_COVERAGE" ]]; then
  if ! [[ "$VIASH_PAR_MINIMUM_COVERAGE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--minimum_coverage' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_MINIMUM_COVERAGE -lt 1 ]]; then
    ViashError '--minimum_coverage' has be more than or equal to 1. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_TIN_SAMPLE_SIZE" ]]; then
  if ! [[ "$VIASH_PAR_TIN_SAMPLE_SIZE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--tin_sample_size' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_TIN_SAMPLE_SIZE -lt 1 ]]; then
    ViashError '--tin_sample_size' has be more than or equal to 1. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SUBTRACT_BACKGROUND" ]]; then
  if ! [[ "$VIASH_PAR_SUBTRACT_BACKGROUND" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--subtract_background' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_PR_BASES" ]]; then
  if ! [[ "$VIASH_PAR_PR_BASES" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--pr_bases' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_PR_BASES -lt 1 ]]; then
    ViashError '--pr_bases' has be more than or equal to 1. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_TR_BIAS" ]]; then
  if ! [[ "$VIASH_PAR_TR_BIAS" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--tr_bias' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
  if [[ $VIASH_PAR_TR_BIAS -lt 1 ]]; then
    ViashError '--tr_bias' has be more than or equal to 1. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SORTED" ]]; then
  if ! [[ "$VIASH_PAR_SORTED" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--sorted' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SKIP_DESEQ2_QC" ]]; then
  if ! [[ "$VIASH_PAR_SKIP_DESEQ2_QC" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--skip_deseq2_qc' has to be a boolean. 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_PAR_PASSED_TRIMMED_READS" ]]; then
  if ! [[ "$VIASH_PAR_PASSED_TRIMMED_READS" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--passed_trimmed_reads' has to be a boolean. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_NUM_TRIMMED_READS" ]]; then
  if ! [[ "$VIASH_PAR_NUM_TRIMMED_READS" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--num_trimmed_reads' has to be a double. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_PASSED_MAPPING" ]]; then
  if ! [[ "$VIASH_PAR_PASSED_MAPPING" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--passed_mapping' has to be a boolean. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_PERCENT_MAPPED" ]]; then
  if ! [[ "$VIASH_PAR_PERCENT_MAPPED" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--percent_mapped' has to be a double. 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_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

if [ ! -z "$VIASH_PAR_OUTPUT_FORMAT" ]; then
  VIASH_PAR_OUTPUT_FORMAT_CHOICES=("html;pdf")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_OUTPUT_FORMAT_CHOICES[*]};" =~ ";$VIASH_PAR_OUTPUT_FORMAT;" ]]; then
    ViashError '--output_format' specified value of \'$VIASH_PAR_OUTPUT_FORMAT\' 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_SEQUENCING_PROTOCOL" ]; then
  VIASH_PAR_SEQUENCING_PROTOCOL_CHOICES=("non-strand-specific;strand-specific-reverse;strand-specific-forward")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_SEQUENCING_PROTOCOL_CHOICES[*]};" =~ ";$VIASH_PAR_SEQUENCING_PROTOCOL;" ]]; then
    ViashError '--sequencing_protocol' specified value of \'$VIASH_PAR_SEQUENCING_PROTOCOL\' 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

# create parent directories of output files, if so desired
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_OUTPUT_PDF" ] && [ ! -d "$(dirname "$VIASH_PAR_QUALIMAP_OUTPUT_PDF")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_QUALIMAP_OUTPUT_PDF")"
fi
if [ ! -z "$VIASH_PAR_QUALIMAP_OUTPUT_DIR" ] && [ ! -d "$(dirname "$VIASH_PAR_QUALIMAP_OUTPUT_DIR")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_QUALIMAP_OUTPUT_DIR")"
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_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_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_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_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_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_RSEQC_RSEQC_BAMSTAT="$VIASH_META_RESOURCES_DIR/../../../nextflow/rseqc/rseqc_bamstat/main.nf"
VIASH_DEP_RSEQC_RSEQC_INFEREXPERIMENT="$VIASH_META_RESOURCES_DIR/../../../nextflow/rseqc/rseqc_inferexperiment/main.nf"
VIASH_DEP_RSEQC_RSEQC_INNERDISTANCE="$VIASH_META_RESOURCES_DIR/../../../nextflow/rseqc/rseqc_innerdistance/main.nf"
VIASH_DEP_RSEQC_RSEQC_JUNCTIONANNOTATION="$VIASH_META_RESOURCES_DIR/../../../nextflow/rseqc/rseqc_junctionannotation/main.nf"
VIASH_DEP_RSEQC_RSEQC_JUNCTIONSATURATION="$VIASH_META_RESOURCES_DIR/../../../nextflow/rseqc/rseqc_junctionsaturation/main.nf"
VIASH_DEP_RSEQC_RSEQC_READDISTRIBUTION="$VIASH_META_RESOURCES_DIR/../../../nextflow/rseqc/rseqc_readdistribution/main.nf"
VIASH_DEP_RSEQC_RSEQC_READDUPLICATION="$VIASH_META_RESOURCES_DIR/../../../nextflow/rseqc/rseqc_readduplication/main.nf"
VIASH_DEP_RSEQC_RSEQC_TIN="$VIASH_META_RESOURCES_DIR/../../../nextflow/rseqc/rseqc_tin/main.nf"
VIASH_DEP_DUPRADAR="$VIASH_META_RESOURCES_DIR/../../../nextflow/dupradar/main.nf"
VIASH_DEP_QUALIMAP="$VIASH_META_RESOURCES_DIR/../../../nextflow/qualimap/main.nf"
VIASH_DEP_PRESEQ_LCEXTRAP="$VIASH_META_RESOURCES_DIR/../../../nextflow/preseq_lcextrap/main.nf"
VIASH_DEP_MULTIQC_CUSTOM_BIOTYPE="$VIASH_META_RESOURCES_DIR/../../../nextflow/multiqc_custom_biotype/main.nf"
VIASH_DEP_DESEQ2_QC="$VIASH_META_RESOURCES_DIR/../../../nextflow/deseq2_qc/main.nf"
VIASH_DEP_PREPARE_MULTIQC_INPUT="$VIASH_META_RESOURCES_DIR/../../../nextflow/prepare_multiqc_input/main.nf"
VIASH_DEP_RSEM_RSEM_MERGE_COUNTS="$VIASH_META_RESOURCES_DIR/../../../nextflow/rsem/rsem_merge_counts/main.nf"
VIASH_DEP_WORKFLOWS_MERGE_QUANT_RESULTS="$VIASH_META_RESOURCES_DIR/../../../nextflow/workflows/merge_quant_results/main.nf"
VIASH_DEP_FEATURECOUNTS="$VIASH_TARGET_DIR/dependencies/vsh/vsh/biobox/v0.2.0/nextflow/featurecounts/main.nf"
VIASH_DEP_MULTIQC="$VIASH_TARGET_DIR/dependencies/vsh/vsh/biobox/v0.2.0/nextflow/multiqc/main.nf"

ViashDebug "Running command: $(echo $VIASH_CMD)"
cat << VIASHEOF | eval $VIASH_CMD
set -e
tempscript=\$(mktemp "$VIASH_META_TEMP_DIR/viash-run-quality_control-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: 

        qc_ch = input_ch

        // Feature biotype QC using featureCounts
        | map { id, state -> 
            def biotype_in_gtf = biotypeInGtf(state.gtf, state.biotype)
            def attribute_type = state.gencode ? "gene_type" : state.featurecounts_group_type
            def strand = (state.strandedness == "forward") ? 1 : ((state.strandedness == "reverse") ? 2 : 0)
            [ id, state + [biotype_in_gtf: biotype_in_gtf, attribute_type: attribute_type, strand: strand] ]
        }

        | featurecounts.run (
            runIf: { id, state -> !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.biotype_in_gtf },
            fromState: [
                "paired": "paired",
                "strand": "strand", 
                "annotation": "gtf", 
                "input": "genome_bam", 
                "attribute_type": "attribute_type",
                "feature_type": "featurecounts_feature_type"
            ],
            toState: [
                "featurecounts": "counts",
                "featurecounts_summary": "summary"
            ],
            args: [
                both_aligned: true,
                same_strand: true
            ]
        )

        | multiqc_custom_biotype.run (
            runIf: { id, state -> !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.featurecounts },
            fromState: [
                "id": "id",
                "biocounts": "featurecounts", 
                "biotypes_header": "biotypes_header"
            ],
            toState: [ 
                "featurecounts_multiqc": "featurecounts_multiqc", 
                "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc"
            ]
        )
              
        | preseq_lcextrap.run (
            runIf: { id, state -> !state.skip_qc && !state.skip_preseq },
            fromState: [
                "paired": "paired",
                "input": "genome_bam",
                "extra_preseq_args": "extra_preseq_args"
            ],
            toState: [ "preseq_output": "output" ]
        )
   
        | rseqc_bamstat.run (
            runIf: { id, state -> "bam_stat" in state.rseqc_modules },
            fromState: [
                "input": "genome_bam",
                "map_qual": "map_qual"
            ],
            toState: [ "bamstat_output": "output" ]
        )
        | rseqc_inferexperiment.run(
            runIf: { id, state -> "infer_experiment" in state.rseqc_modules },
            fromState: [
                "input": "genome_bam",
                "refgene": "gene_bed",
                "sample_size": "sample_size",
                "map_qual": "map_qual" 
            ],
            toState: [ "strandedness_output": "output" ]
        )
        // Get predicted strandedness from the RSeQC infer_experiment.py output
        | map { id, state -> 
            def inferred_strand = getInferexperimentStrandedness(state.strandedness_output, 30)
            def passed_strand_check = (state.strandedness != inferred_strand[0]) ? false : true
            [ id, state + [ inferred_strand: inferred_strand, passed_strand_check: passed_strand_check ] ]
        }
        | rseqc_innerdistance.run(
            runIf: { id, state -> state.paired && "inner_distance" in state.rseqc_modules },
            key: "inner_distance",
            fromState: [
                "input": "genome_bam",
                "refgene": "gene_bed",
                "sample_size": "sample_size",
                "map_qual": "map_qual",
                "lower_bound_size": "lower_bound_size",
                "upper_bound_size": "upper_bound_size",
                "step_size": "step_size"
            ],
            toState: [ 
                "inner_dist_output_stats": "output_stats",
                "inner_dist_output_dist": "output_dist",
                "inner_dist_output_freq": "output_freq",
                "inner_dist_output_plot": "output_plot",
                "inner_dist_output_plot_r": "output_plot_r"
            ]
        )
        | rseqc_junctionannotation.run(
            runIf: { id, state -> "junction_annotation" in state.rseqc_modules },
            fromState: [
                "input": "genome_bam",
                "refgene": "gene_bed",
                "map_qual": "map_qual",
                "min_intron": "min_intron"
            ],
            toState: [
                "junction_annotation_output_log": "output_log",
                "junction_annotation_output_plot_r": "output_plot_r",
                "junction_annotation_output_junction_bed": "output_junction_bed",
                "junction_annotation_output_junction_interact": "output_junction_interact",
                "junction_annotation_output_junction_sheet": "output_junction_sheet",
                "junction_annotation_output_splice_events_plot": "output_splice_events_plot",
                "junction_annotation_output_splice_junctions_plot": "output_splice_junctions_plot" 
            ]
        )
        | rseqc_junctionsaturation.run(
            runIf: { id, state -> "junction_saturation" in state.rseqc_modules },
            fromState: [
                "input": "genome_bam",
                "refgene": "gene_bed",
                "sampling_percentile_lower_bound": "sampling_percentile_lower_bound",
                "sampling_percentile_upper_bound": "sampling_percentile_upper_bound",
                "sampling_percentile_step": "sampling_percentile_step",
                "min_intron": "min_intron",
                "min_splice_read": "min_splice_read",
                "map_qual": "map_qual"
            ],
            toState: [
                "junction_saturation_output_plot_r": "output_plot_r",
                "junction_saturation_output_plot": "output_plot"
            ]
        )
        | rseqc_readdistribution.run(
            runIf: { id, state -> "read_distribution" in state.rseqc_modules },
            fromState: [
                "input": "genome_bam",
                "refgene": "gene_bed", 
            ],
            toState: [ "read_distribution_output": "output" ]
        )                               
        | rseqc_readduplication.run(
            runIf: { id, state -> "read_duplication" in state.rseqc_modules },
            fromState: [
                "input": "genome_bam",
                "read_count_upper_limit": "read_count_upper_limit",
                "map_qual": "map_qual"
            ],
            toState: [
                "read_duplication_output_duplication_rate_plot_r": "output_duplication_rate_plot_r",
                "read_duplication_output_duplication_rate_plot": "output_duplication_rate_plot",
                "read_duplication_output_duplication_rate_mapping": "output_duplication_rate_mapping",
                "read_duplication_output_duplication_rate_sequence": "output_duplication_rate_sequence"
            ]
        )
        | rseqc_tin.run(
            runIf: { id, state -> "tin" in state.rseqc_modules },
            fromState: [
                "bam_input": "genome_bam",
                "bai_input": "genome_bam_index",
                "refgene": "gene_bed",
                "minimum_coverage": "minimum_coverage",
                "sample_size": "tin_sample_size",
                "subtract_background": "subtract_background"
            ],
            toState: [
                "tin_output_summary": "output_tin_summary",
                "tin_output_metrics": "output_tin"
            ]
        )

        | dupradar.run(
            fromState: [
                "id": "id",
                "input": "genome_bam",
                "gtf_annotation": "gtf",
                "paired": "paired",
                "strandedness": "strandedness"
            ],
            toState: [ 
                "dupradar_output_dupmatrix": "output_dupmatrix",
                "dupradar_output_dup_intercept_mqc": "output_dup_intercept_mqc",
                "dupradar_output_duprate_exp_boxplot": "output_duprate_exp_boxplot",
                "dupradar_output_duprate_exp_densplot": "output_duprate_exp_densplot",
                "dupradar_output_duprate_exp_denscurve_mqc": "output_duprate_exp_denscurve_mqc",
                "dupradar_output_expression_histogram": "output_expression_histogram",
                "dupradar_output_intercept_slope": "output_intercept_slope"
            ]
        )

        | qualimap.run(
            fromState: [
                "input": "genome_bam",
                "gtf": "gtf",
                "pr_bases": "pr_bases",
                "tr_bias": "tr_bias",
                "algorithm": "algorithm",
                "sequencing_protocol": "sequencing_protocol",
                "sorted": "sorted",
                "java_memory_size": "java_memory_size", 
            ],
            toState: [
                "qualimap_output_pdf": "output_pdf",
                "qualimap_output_dir": "output_dir"
            ]
        ) 

        merged_ch = qc_ch
        
        | toSortedList
        | map { list -> 
            def ids = list.collect { id, state -> state.id }
            def strandedness = list.collect { id, state -> state.strandedness }
            def num_trimmed_reads = list.collect { id, state -> state.num_trimmed_reads }
            def passed_trimmed_reads = list.collect { id, state -> state.passed_trimmed_reads }
            def passed_mapping = list.collect { id, state -> state.passed_mapping }
            def percent_mapped = list.collect { id, state -> state.percent_mapped }
            def inferred_strand = list.collect { id, state -> state.inferred_strand }
            def passed_strand_check = list.collect { id, state -> state.passed_strand_check }
            def gtf = list.collect { id, state -> state.gtf }.unique()[0]
            def gtf_extra_attributes = list.collect { id, state -> state.gtf_extra_attributes }.unique()[0]
            def gtf_group_features = list.collect { id, state -> state.gtf_group_features }.unique()[0]
            def pca_header_multiqc = list.collect { id, state -> state.pca_header_multiqc }.unique()[0]
            def clustering_header_multiqc = list.collect { id, state -> state.clustering_header_multiqc }.unique()[0]
            def aligner = list.collect { id, state -> state.aligner }.unique()[0]
            def pseudo_aligner = list.collect { id, state -> state.pseudo_aligner }.unique()[0]
            def deseq2_vst = list.collect { id, state -> state.deseq2_vst }.unique()[0]
            def extra_deseq2_args = list.collect { id, state -> state.extra_deseq2_args }.unique()[0]
            def extra_deseq2_args2 = list.collect { id, state -> state.extra_deseq2_args2 }.unique()[0]
            def skip_deseq2_qc = list.collect { id, state -> state.skip_deseq2_qc }.unique()[0] 
            def skip_qc = list.collect { id, state -> state.skip_qc }.unique()[0] 
            def skip_align = list.collect { id, state -> state.skip_align }.unique()[0] 
            def skip_pseudo_align = list.collect { id, state -> state.skip_pseudo_align }.unique()[0] 
            def quant_results = list.collect { id, state -> 
                (state.quant_results_file instanceof java.nio.file.Path && state.quant_results_file.exists()) ? 
                    state.quant_results_file : 
                    null }
            def rsem_counts_gene = list.collect { id, state -> 
                (state.rsem_counts_gene instanceof java.nio.file.Path && state.rsem_counts_gene.exists()) ? 
                    state.rsem_counts_gene : 
                    null }
            def rsem_counts_transcripts = list.collect { id, state -> 
                (state.rsem_counts_transcripts instanceof java.nio.file.Path && state.rsem_counts_transcripts.exists()) ? 
                    state.rsem_counts_transcripts : 
                    null }
            def pseudo_salmon_quant_results = list.collect { id, state -> 
                (state.pseudo_salmon_quant_results_file instanceof java.nio.file.Path && state.pseudo_salmon_quant_results_file.exists()) ? 
                    state.pseudo_salmon_quant_results_file : 
                    null }
            def pseudo_kallisto_quant_results = list.collect { id, state -> 
                (state.pseudo_kallisto_quant_results_file instanceof java.nio.file.Path && state.pseudo_kallisto_quant_results_file.exists()) ? 
                    state.pseudo_kallisto_quant_results_file : 
                    null }
            def fastqc_zip_1 = list.collect { id, state -> 
                (state.fastqc_zip_1 instanceof java.nio.file.Path && state.fastqc_zip_1.exists()) ? 
                    state.fastqc_zip_1 : 
                    null }
            def fastqc_zip_2 = list.collect { id, state -> 
                (state.fastqc_zip_2 instanceof java.nio.file.Path && state.fastqc_zip_2.exists()) ? 
                    state.fastqc_zip_2 : 
                    null }
            def trim_zip_1 = list.collect { id, state -> 
                (state.trim_zip_1 instanceof java.nio.file.Path && state.trim_zip_1.exists()) ? 
                    state.trim_zip_1 : 
                    null }
            def trim_zip_2 = list.collect { id, state -> 
                (state.trim_zip_2 instanceof java.nio.file.Path && state.trim_zip_2.exists()) ? 
                state.trim_zip_2 : 
                null }
            def trim_log_1 = list.collect { id, state -> 
                (state.trim_log_1 instanceof java.nio.file.Path && state.trim_log_1.exists()) ? 
                state.trim_log_1 : 
                null }
            def trim_log_2 = list.collect { id, state -> 
                (state.trim_log_2 instanceof java.nio.file.Path && state.trim_log_2.exists()) ? 
                    state.trim_log_2 : 
                    null }
            def sortmerna_multiqc = list.collect { id, state -> 
                (state.sortmerna_multiqc instanceof java.nio.file.Path && state.sortmerna_multiqc.exists()) ? 
                    state.sortmerna_multiqc : 
                    null }
            def star_multiqc = list.collect { id, state -> 
                (state.star_multiqc instanceof java.nio.file.Path && state.star_multiqc.exists()) ? 
                    state.star_multiqc : 
                    null }
            def genome_bam_stats = list.collect { id, state -> 
                (state.genome_bam_stats instanceof java.nio.file.Path && state.genome_bam_stats.exists()) ? 
                    state.genome_bam_stats : 
                    null }
            def genome_bam_flagstat = list.collect { id, state -> 
                (state.genome_bam_flagstat instanceof java.nio.file.Path && state.genome_bam_flagstat.exists()) ? 
                state.genome_bam_flagstat : 
                null }
            def genome_bam_idxstats = list.collect { id, state -> 
                (state.genome_bam_idxstats instanceof java.nio.file.Path && state.genome_bam_idxstats.exists()) ? 
                    state.genome_bam_idxstats : 
                    null }
            def markduplicates_multiqc = list.collect { id, state -> 
                (state.markduplicates_multiqc instanceof java.nio.file.Path && state.markduplicates_multiqc.exists()) ? 
                    state.markduplicates_multiqc : 
                    null }
            def salmon_multiqc = list.collect { id, state -> 
                (state.salmon_multiqc instanceof java.nio.file.Path && state.salmon_multiqc.exists()) ? 
                    state.salmon_multiqc : 
                    null }
            def rsem_multiqc = list.collect { id, state -> 
                (state.rsem_multiqc instanceof java.nio.file.Path && state.rsem_multiqc.exists()) ? 
                    state.rsem_multiqc : 
                    null }
            def pseudo_multiqc = list.collect { id, state -> 
                (state.pseudo_multiqc instanceof java.nio.file.Path && state.pseudo_multiqc.exists()) ? 
                    state.pseudo_multiqc : 
                    null }
            def featurecounts_multiqc = list.collect { id, state -> 
                (state.featurecounts_multiqc instanceof java.nio.file.Path && state.featurecounts_multiqc.exists()) ? 
                    state.featurecounts_multiqc : 
                    null }
            def featurecounts_rrna_multiqc = list.collect { id, state -> 
                (state.featurecounts_rrna_multiqc instanceof java.nio.file.Path && state.featurecounts_rrna_multiqc.exists()) ? 
                    state.featurecounts_rrna_multiqc : 
                    null }
            def preseq_output = list.collect { id, state -> 
                (state.preseq_output instanceof java.nio.file.Path && state.preseq_output.exists()) ? 
                    state.preseq_output : 
                    null }
            def qualimap_output_dir = list.collect { id, state -> 
                (state.qualimap_output_dir instanceof java.nio.file.Path && state.qualimap_output_dir.exists()) ? 
                    state.qualimap_output_dir : 
                    null }
            def dupradar_output_dup_intercept_mqc = list.collect { id, state -> 
                (state.dupradar_output_dup_intercept_mqc instanceof java.nio.file.Path && state.dupradar_output_dup_intercept_mqc.exists()) ? 
                    state.dupradar_output_dup_intercept_mqc : 
                        null }
            def dupradar_output_duprate_exp_denscurve_mqc = list.collect { id, state -> 
                (state.dupradar_output_duprate_exp_denscurve_mqc instanceof java.nio.file.Path && state.dupradar_output_duprate_exp_denscurve_mqc.exists()) ? 
                    state.dupradar_output_duprate_exp_denscurve_mqc : 
                        null }
            def bamstat_output = list.collect { id, state -> 
                (state.bamstat_output instanceof java.nio.file.Path && state.bamstat_output.exists()) ? 
                    state.bamstat_output : 
                    null }
            def inferexperiment_multiqc = list.collect { id, state -> 
                (state.strandedness_output instanceof java.nio.file.Path && state.strandedness_output.exists()) ? 
                    state.strandedness_output : 
                    null }
            def inner_dist_output_freq = list.collect { id, state -> 
                (state.inner_dist_output_freq instanceof java.nio.file.Path && state.inner_dist_output_freq.exists()) ? 
                    state.inner_dist_output_freq : 
                    null }
            def junction_annotation_output_log = list.collect { id, state -> 
                (state.junction_annotation_output_log instanceof java.nio.file.Path && state.junction_annotation_output_log.exists()) ? 
                    state.junction_annotation_output_log : 
                    null }
            def junction_saturation_output_plot_r = list.collect { id, state -> 
                (state.junction_saturation_output_plot_r instanceof java.nio.file.Path && state.junction_saturation_output_plot_r.exists()) ? 
                    state.junction_saturation_output_plot_r : 
                    null }
            def read_distribution_output = list.collect { id, state -> 
                (state.read_distribution_output instanceof java.nio.file.Path && state.read_distribution_output.exists()) ? 
                    state.read_distribution_output : 
                    null }
            def read_duplication_output_duplication_rate_mapping = list.collect { id, state -> 
                (state.read_duplication_output_duplication_rate_mapping instanceof java.nio.file.Path && state.read_duplication_output_duplication_rate_mapping.exists()) ? 
                    state.read_duplication_output_duplication_rate_mapping : 
                    null }
            def tin_output_summary = list.collect { id, state -> 
                (state.tin_output_summary instanceof java.nio.file.Path && state.tin_output_summary.exists()) ? 
                    state.tin_output_summary : 
                    null }
            def multiqc_custom_config = list.collect { id, state -> state.multiqc_custom_config }.unique()[0] 
            ["merged", [
                ids: ids, 
                strandedness: strandedness, 
                num_trimmed_reads: num_trimmed_reads,
                passed_trimmed_reads: passed_trimmed_reads,
                passed_mapping: passed_mapping,
                percent_mapped: percent_mapped,
                inferred_strand: inferred_strand, 
                passed_strand_check: passed_strand_check, 
                skip_align: skip_align,
                skip_pseudo_align: skip_pseudo_align,
                quant_results: quant_results, 
                rsem_counts_gene: rsem_counts_gene,
                rsem_counts_transcripts: rsem_counts_transcripts,
                pseudo_salmon_quant_results: pseudo_salmon_quant_results,
                pseudo_kallisto_quant_results: pseudo_kallisto_quant_results,
                gtf: gtf, 
                gtf_extra_attributes: gtf_extra_attributes, 
                gtf_group_features: gtf_group_features,
                pca_header_multiqc: pca_header_multiqc, 
                clustering_header_multiqc: clustering_header_multiqc,
                aligner: aligner,
                pseudo_aligner: pseudo_aligner,
                deseq2_vst: deseq2_vst, 
                extra_deseq2_args: extra_deseq2_args,
                extra_deseq2_args2: extra_deseq2_args2,
                skip_deseq2_qc: skip_deseq2_qc,
                fastqc_zip: fastqc_zip_1 + fastqc_zip_2,
                trim_zip: trim_zip_1 + trim_zip_2, 
                trim_log: trim_log_1 + trim_log_2, 
                sortmerna_multiqc: sortmerna_multiqc,
                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_multiqc,
                salmon_multiqc: salmon_multiqc,
                rsem_multiqc: rsem_multiqc,
                pseudo_multiqc: pseudo_multiqc,
                featurecounts_multiqc: featurecounts_multiqc,
                featurecounts_rrna_multiqc: featurecounts_rrna_multiqc,
                preseq_output: preseq_output,
                qualimap_output_dir: qualimap_output_dir,
                dupradar_output_dup_intercept_mqc: dupradar_output_dup_intercept_mqc,
                dupradar_output_duprate_exp_denscurve_mqc: dupradar_output_duprate_exp_denscurve_mqc,
                bamstat_output: bamstat_output,
                inner_dist_output_freq: inner_dist_output_freq,
                inferexperiment_multiqc: inferexperiment_multiqc,
                junction_annotation_output_log: junction_annotation_output_log,
                junction_saturation_output_plot_r: junction_saturation_output_plot_r,
                read_distribution_output: read_distribution_output,
                read_duplication_output_duplication_rate_mapping: read_duplication_output_duplication_rate_mapping,
                tin_output_summary: tin_output_summary, 
                multiqc_custom_config: multiqc_custom_config
            ] ]
        } 

        // | map { list -> 
        //     def ids = list.collect { id, state -> state.id }
        //     def strandedness = list.collect { id, state -> state.strandedness }
        //     def num_trimmed_reads = list.collect { id, state -> state.num_trimmed_reads }
        //     def passed_trimmed_reads = list.collect { id, state -> state.passed_trimmed_reads }
        //     def passed_mapping = list.collect { id, state -> state.passed_mapping }
        //     def percent_mapped = list.collect { id, state -> state.percent_mapped }
        //     def inferred_strand = list.collect { id, state -> state.inferred_strand }
        //     def passed_strand_check = list.collect { id, state -> state.passed_strand_check }
        //     def gtf = list.collect { id, state -> state.gtf }.unique()[0]
        //     def gtf_extra_attributes = list.collect { id, state -> state.gtf_extra_attributes }.unique()[0]
        //     def gtf_group_features = list.collect { id, state -> state.gtf_group_features }.unique()[0]
        //     def pca_header_multiqc = list.collect { id, state -> state.pca_header_multiqc }.unique()[0]
        //     def clustering_header_multiqc = list.collect { id, state -> state.clustering_header_multiqc }.unique()[0]
        //     def aligner = list.collect { id, state -> state.aligner }.unique()[0]
        //     def pseudo_aligner = list.collect { id, state -> state.pseudo_aligner }.unique()[0]
        //     def deseq2_vst = list.collect { id, state -> state.deseq2_vst }.unique()[0]
        //     def extra_deseq2_args = list.collect { id, state -> state.extra_deseq2_args }.unique()[0]
        //     def extra_deseq2_args2 = list.collect { id, state -> state.extra_deseq2_args2 }.unique()[0]
        //     def skip_deseq2_qc = list.collect { id, state -> state.skip_deseq2_qc }.unique()[0] 
        //     def skip_qc = list.collect { id, state -> state.skip_qc }.unique()[0] 
        //     def skip_align = list.collect { id, state -> state.skip_align }.unique()[0] 
        //     def skip_pseudo_align = list.collect { id, state -> state.skip_pseudo_align }.unique()[0] 
        //     def quant_results = list.collect { id, state -> 
        //         (state.quant_results_file instanceof java.nio.file.Path && state.quant_results_file.exists()) ? 
        //             state.quant_results_file : 
        //             null }
        //     def rsem_counts_gene = list.collect { id, state -> 
        //         (state.rsem_counts_gene instanceof java.nio.file.Path && state.rsem_counts_gene.exists()) ? 
        //             state.rsem_counts_gene : 
        //             null }
        //     def rsem_counts_transcripts = list.collect { id, state -> 
        //         (state.rsem_counts_transcripts instanceof java.nio.file.Path && state.rsem_counts_transcripts.exists()) ? 
        //             state.rsem_counts_transcripts : 
        //             null }
        //     def pseudo_salmon_quant_results = list.collect { id, state -> 
        //         (state.pseudo_salmon_quant_results_file instanceof java.nio.file.Path && state.pseudo_salmon_quant_results_file.exists()) ? 
        //             state.pseudo_salmon_quant_results_file : 
        //             null }
        //     def pseudo_kallisto_quant_results = list.collect { id, state -> 
        //         (state.pseudo_kallisto_quant_results_file instanceof java.nio.file.Path && state.pseudo_kallisto_quant_results_file.exists()) ? 
        //             state.pseudo_kallisto_quant_results_file : 
        //             null }
        //     def fastqc_zip_1_dirs = list.collect{it[1].fastqc_zip_1.getParent()}
        //     def fastqc_zip_2_dirs = list.collect{it[1].fastqc_zip_2.getParent()}
        //     def trim_zip_1_dirs = list.collect{it[1].trim_zip_1.getParent()}
        //     def trim_zip_2_dirs = list.collect{it[1].trim_zip_2.getParent()}
        //     def trim_log_1_dirs = list.collect{it[1].trim_log_1.getParent()}
        //     def trim_log_2_dirs = list.collect{it[1].trim_log_2.getParent()}
        //     def sortmerna_multiqc_dirs = list.collect{it[1].sortmerna_multiqc.getParent()}
        //     def star_multiqc_dirs = list.collect{it[1].star_multiqc.getParent()}
        //     def genome_bam_stats_dirs = list.collect{it[1].genome_bam_stats.getParent()}
        //     def genome_bam_flagstat_dirs = list.collect{it[1].genome_bam_flagstat.getParent()}
        //     def genome_bam_idxstats_dirs = list.collect{it[1].genome_bam_idxstats}
        //     def markduplicates_multiqc_dirs = list.collect{it[1].markduplicates_multiqc.getParent()}
        //     def salmon_multiqc_dirs = list.collect{it[1].salmon_multiqc}
        //     def rsem_multiqc_dirs = list.collect{it[1].rsem_multiqc.getParent()}
        //     def pseudo_multiqc_dirs = list.collect{it[1].pseudo_multiqc.getParent()}
        //     def featurecounts_multiqc_dirs = list.collect{it[1].featurecounts_multiqc.getParent()}
        //     def featurecounts_rrna_multiqc_dirs = list.collect{it[1].featurecounts_rrna_multiqc.getParent()}
        //     def preseq_output_dirs = list.collect{it[1].preseq_output.getParent()}
        //     def qualimap_output_dirs = list.collect{it[1].qualimap_output_dir}
        //     def dupradar_output_dup_intercept_mqc_dirs = list.collect{it[1].dupradar_output_dup_intercept_mqc.getParent()}
        //     def dupradar_output_duprate_exp_denscurve_mqc_dirs = list.collect{it[1].dupradar_output_duprate_exp_denscurve_mqc.getParent()}
        //     def bamstat_output_dirs = list.collect{it[1].bamstat_output.getParent()}
        //     def strandedness_output_dirs = list.collect{it[1].strandedness_output.getParent()}
        //     def inner_dist_output_freq_dirs = list.collect{it[1].inner_dist_output_freq.getParent()}
        //     def junction_annotation_output_log_dirs = list.collect{it[1].junction_annotation_output_log.getParent()}
        //     def junction_saturation_output_plot_r_dirs = list.collect{it[1].junction_saturation_output_plot_r.getParent()}
        //     def read_distribution_output_dirs = list.collect{it[1].read_distribution_output.getParent()}
        //     def read_duplication_output_duplication_rate_mapping_dirs = list.collect{it[1].read_duplication_output_duplication_rate_mapping.getParent()}
        //     def tin_output_summary_dirs = list.collect{it[1].tin_output_summary.getParent()}
        //     def multiqc_custom_config_dirs = list.collect{it[1].multiqc_custom_config.getParent()}
        //     ["merged", [
        //         ids: ids, 
        //         strandedness: strandedness, 
        //         num_trimmed_reads: num_trimmed_reads,
        //         passed_trimmed_reads: passed_trimmed_reads,
        //         passed_mapping: passed_mapping,
        //         percent_mapped: percent_mapped,
        //         inferred_strand: inferred_strand, 
        //         passed_strand_check: passed_strand_check, 
        //         skip_align: skip_align,
        //         skip_pseudo_align: skip_pseudo_align,
        //         quant_results: quant_results, 
        //         rsem_counts_gene: rsem_counts_gene,
        //         rsem_counts_transcripts: rsem_counts_transcripts,
        //         pseudo_salmon_quant_results: pseudo_salmon_quant_results,
        //         pseudo_kallisto_quant_results: pseudo_kallisto_quant_results,
        //         gtf: gtf, 
        //         gtf_extra_attributes: gtf_extra_attributes, 
        //         gtf_group_features: gtf_group_features,
        //         pca_header_multiqc: pca_header_multiqc, 
        //         clustering_header_multiqc: clustering_header_multiqc,
        //         aligner: aligner,
        //         pseudo_aligner: pseudo_aligner,
        //         deseq2_vst: deseq2_vst, 
        //         extra_deseq2_args: extra_deseq2_args,
        //         extra_deseq2_args2: extra_deseq2_args2,
        //         skip_deseq2_qc: skip_deseq2_qc,
        //         multiqc_input: fastqc_zip_1_dirs + fastqc_zip_2_dirs + trim_zip_1_dirs + trim_zip_2_dirs + trim_log_1_dirs + trim_log_2_dirs + sortmerna_multiqc_dirs + star_multiqc_dirs + genome_bam_stats_dirs + genome_bam_flagstat_dirs + genome_bam_idxstats_dirs + markduplicates_multiqc_dirs + salmon_multiqc_dirs + rsem_multiqc_dirs + pseudo_multiqc_dirs + featurecounts_multiqc_dirs + featurecounts_rrna_multiqc_dirs + preseq_output_dirs + qualimap_output_dirs + dupradar_output_dup_intercept_mqc_dirs + dupradar_output_duprate_exp_denscurve_mqc_dirs + bamstat_output_dirs + strandedness_output_dirs + inner_dist_output_freq_dirs + junction_annotation_output_log_dirs + junction_saturation_output_plot_r_dirs + read_distribution_output_dirs + read_duplication_output_duplication_rate_mapping_dirs + tin_output_summary_dirs + multiqc_custom_config_dirs
        //     ] ]
        // } 

        // Merge quantification results of alignment
        | merge_quant_results.run (
            runIf: { id, state -> !state.skip_align && state.aligner == 'star_salmon' },
            fromState: [ 
                "salmon_quant_results": "quant_results", 
                "gtf": "gtf", 
                "gtf_extra_attributes": "gtf_extra_attributes", 
                "gtf_group_features": "gtf_group_features"
            ],
            args: [ quant_type: "salmon"],
            toState: [
                "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", 
                "lengths_gene": "lengths_gene",
                "lengths_transcript": "lengths_transcript",
                "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment"
            ], 
            key: "merge_quant_results"
        )

        | rsem_merge_counts.run (
            runIf: { id, state -> state.aligner == 'star_rsem' }, 
            fromState: [
                "counts_gene": "rsem_counts_gene",
                "counts_transcripts": "rsem_counts_transcripts"
            ],
            toState: [
                "tpm_gene": "merged_gene_tpm",
                "counts_gene": "merged_gene_counts",
                "tpm_transcript": "merged_transcript_tpm", 
                "counts_transcript": "merged_transcript_counts"
            ]
        )

        | deseq2_qc.run (
            runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_align },
            fromState: { id, state ->
                def counts = (state.aligner == "star_rsem") ? state.counts_gene : state.counts_gene_length_scaled
                [
                    counts: counts,
                    pca_header_multiqc: state.pca_header_multiqc, 
                    clustering_header_multiqc: state.clustering_header_multiqc,
                    deseq2_vst: state.deseq2_vst, 
                    extra_deseq2_args: state.extra_deseq2_args,
                    extra_deseq2_args2: state.extra_deseq2_args2 
                ]
            }, 
            toState: [
                "deseq2_output": "deseq2_output", 
                "deseq2_pca_multiqc": "pca_multiqc", 
                "deseq2_dists_multiqc": "dists_multiqc" 
            ], 
            key: "deseq2_qc_align_quant"
        )

        // Merge quantification results of pseudo alignment
        | merge_quant_results.run (
            runIf: { id, state -> !state.skip_pseudo_align },
            fromState: [ 
                "salmon_quant_results": "pseudo_salmon_quant_results",
                "kallisto_quant_results": "pseudo_kallisto_quant_results",
                "gtf": "gtf", 
                "gtf_extra_attributes": "gtf_extra_attributes", 
                "gtf_group_features": "gtf_group_features",
                "quant_type": "pseudo_aligner"
            ],
            toState: [
                "pseudo_tpm_gene": "tpm_gene",
                "pseudo_counts_gene": "counts_gene",
                "pseudo_counts_gene_length_scaled": "counts_gene_length_scaled",
                "pseudo_counts_gene_scaled": "counts_gene_scaled", 
                "pseudo_tpm_transcript": "tpm_transcript", 
                "pseudo_counts_transcript": "counts_transcript", 
                "pseudo_lengths_gene": "lengths_gene",
                "pseudo_lengths_transcript": "lengths_transcript",
                "pseudo_quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment"
            ], 
            key: "merge_pseudo_quant_results"
        )

        | deseq2_qc.run (
            runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_pseudo_align },
            fromState: [
                "counts": "pseudo_counts_gene_length_scaled",
                "pca_header_multiqc": "pca_header_multiqc", 
                "clustering_header_multiqc": "clustering_header_multiqc",
                "deseq2_vst": "deseq2_vst", 
                "extra_deseq2_args": "extra_deseq2_args",
                "extra_deseq2_args2": "extra_deseq2_args2" 
            ], 
            toState: [
                "deseq2_output_pseudo": "deseq2_output", 
                "deseq2_pca_multiqc_pseudo": "pca_multiqc", 
                "deseq2_dists_multiqc_pseudo_": "dists_multiqc" 
            ], 
            key: "deseq2_qc_pseuso_align_quant"
        )

        // Get list of samples that failed trimming, mapping, and strand check for MultiQC report
        | map { id, state -> 
            def fail_trimming_header = ["Sample", "Reads after trimming"]
            def fail_trimming_multiqc = ""
            def star_mapping_header = ["Sample", "STAR uniquely mapped reads (%)"] 
            def fail_mapping_multiqc = ""
            def strand_check_header = ["Sample", "Provided strandedness", "Inferred strandedness", "Sense (%)", "Antisense (%)", "Undetermined (%)"]
            def fail_strand_multiqc = ""
            if (state.ids.size() > 0) {
                fail_trimming_multiqc += "\${fail_trimming_header.join('\\t')}\\n"
                fail_mapping_multiqc += "\${star_mapping_header.join('\\t')}\\n"
                fail_strand_multiqc += "\${strand_check_header.join('\\t')}\\n"
                for (i=0; i<state.ids.size(); i++) {
                    if (!state.passed_trimmed_reads[i]) {
                        tsv_data = [state.ids[i], state.num_trimmed_reads[i]].join('\\t')
                        fail_trimming_multiqc += tsv_data.join('\\n')
                    }
                    if (!state.passed_mapping[i]) {
                        tsv_data = [state.ids[i], state.percent_mapped[i]].join('\\t')
                        fail_mapping_multiqc += tsv_data.join('\\n')
                    }
                    if (!state.passed_strand_check[i]) {
                        tsv_data = ([ids[i], state.strandedness[i]] + state.inferred_strand[i]).join('\\t')
                        fail_strand_multiqc += tsv_data.join('\\n')
                    }
                }
            }
            
            [ id, state + [fail_trimming_multiqc: fail_trimming_multiqc, fail_mapping_multiqc: fail_mapping_multiqc, fail_strand_multiqc: fail_strand_multiqc] ]
        }

        | map { id, state -> 
            state.each { key, value ->
                if (value instanceof ArrayList) {
                    value.removeAll { it == null }
                }
            }
            mod_state = state.findAll { key, value -> value != null }
            [ id, mod_state ]
        }

        | prepare_multiqc_input.run(
            fromState: [
                "fail_trimming_multiqc": "fail_trimming_multiqc", 
                "fail_mapping_multiqc": "fail_mapping_multiqc", 
                "fail_strand_multiqc": "fail_strand_multiqc", 
                "fastqc_raw_multiqc": "fastqc_zip",
                "fastqc_trim_multiqc": "trim_zip",
                "trim_log_multiqc": "trim_log",
                "sortmerna_multiqc": "sortmerna_multiqc", 
                "star_multiqc": "star_multiqc", 
                "salmon_multiqc": "salmon_multiqc", 
                "rsem_multiqc": "rsem_multiqc", 
                "pseudo_multiqc": "pseudo_multiqc",
                "samtools_stats": "genome_bam_stats", 
                "samtools_flagstat": "genome_bam_flagstat", 
                "samtools_idxstats": "genome_bam_idxstats", 
                "markduplicates_multiqc": "markduplicates_multiqc",
                "featurecounts_multiqc": "featurecounts_multiqc",
                "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", 
                "aligner_pca_multiqc": "deseq2_pca_multiqc", 
                "aligner_clustering_multiqc": "deseq2_dists_multiqc", 
                "pseudo_aligner_pca_multiqc": "deseq2_pca_multiqc_pseudo", 
                "pseudo_aligner_clustering_multiqc": "deseq2_dists_multiqc_pseudo", 
                "preseq_multiqc": "preseq_output", 
                "qualimap_multiqc": "qualimap_output_dir", 
                "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", 
                "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc",
                "bamstat_multiqc": "bamstat_output", 
                "inferexperiment_multiqc": "inferexperiment_multiqc", 
                "innerdistance_multiqc": "inner_dist_output_freq", 
                "junctionannotation_multiqc": "junction_annotation_output_log", 
                "junctionsaturation_multiqc": "junction_saturation_output_plot_r",
                "readdistribution_multiqc": "read_distribution_output",
                "readduplication_multiqc": "read_duplication_output_duplication_rate_mapping", 
                "tin_multiqc": "tin_output_summary",
                "multiqc_config": "multiqc_custom_config"
            ], 
            toState: [ "multiqc_input": "output" ]
        )

        | multiqc.run (
            fromState: [
                "title": "multiqc_title", 
                "input": "multiqc_input", 
            ], 
            args: [exclude_modules: "general_stats"],
            toState: [
                "multiqc_report": "output_report", 
                "multiqc_data": "output_data",
                "multiqc_plots": "output_plots"
            ]
        )

        | map { id, state -> 
            [ id, [ 
                tpm_gene: state.tpm_gene,
                counts_gene: state.counts_gene,
                counts_gene_length_scaled: state.counts_gene_length_scaled,
                counts_gene_scaled: state.counts_gene_scaled, 
                tpm_transcript: state.tpm_transcript, 
                counts_transcript: state.counts_transcript, 
                quant_merged_summarizedexperiment: state.quant_merged_summarizedexperiment,
                deseq2_output: state.deseq2_output, 
                pseudo_tpm_gene: state.pseudo_tpm_gene,
                pseudo_counts_gene: state.pseudo_counts_gene,
                pseudo_counts_gene_length_scaled: state.pseudo_counts_gene_length_scaled,
                pseudo_counts_gene_scaled: state.pseudo_counts_gene_scaled, 
                pseudo_tpm_transcript: state.pseudo_tpm_transcript, 
                pseudo_counts_transcript: state.pseudo_counts_transcript, 
                pseudo_quant_merged_summarizedexperiment: state.pseudo_quant_merged_summarizedexperiment,
                deseq2_output_pseudo: state.deseq2_output_pseudo,
                multiqc_report: state.multiqc_report, 
                multiqc_data: state.multiqc_data, 
                multiqc_plots: state.multiqc_plots
            ] ] 
        }

        | map { list -> list[1]}

        output_ch = qc_ch
        
        | combine(merged_ch)

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

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

        | setState (
            [
                "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_output_dir": "qualimap_output_dir",
                "qualimap_output_pdf": "qualimap_output_pdf", 
                "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", 
                "lengths_gene": "lengths_gene",
                "lengths_transcript": "lengths_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:
        output_ch
}

//
// Function to check whether biotype field exists in GTF file
//
def biotypeInGtf(gtf_file, biotype) {
    def hits = 0
    gtf_file.eachLine { line ->
        def attributes = line.split('\\t')[-1].split()
        if (attributes.contains(biotype)) {
            hits += 1
        }
    }
    if (hits) {
        return true
    } else {
        log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\\n" +
            "  Biotype attribute '\${biotype}' not found in the last column of the GTF file!\\n\\n" +
            "  Biotype QC will be skipped to circumvent the issue below:\\n" +
            "  https://github.com/nf-core/rnaseq/issues/460\\n\\n" +
            "  Amend '--featurecounts_group_type' to change this behaviour.\\n" +
            "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
        return false
    }
}

//
// Function that parses and returns the predicted strandedness from the RSeQC infer_experiment.py output
//
def getInferexperimentStrandedness(inferexperiment_file, cutoff=30) {
    def sense        = 0
    def antisense    = 0
    def undetermined = 0
    inferexperiment_file.eachLine { line ->
        def undetermined_matcher = line =~ /Fraction of reads failed to determine:\\s([\\d\\.]+)/
        def se_sense_matcher     = line =~ /Fraction of reads explained by "\\++,--":\\s([\\d\\.]+)/
        def se_antisense_matcher = line =~ /Fraction of reads explained by "\\+-,-\\+":\\s([\\d\\.]+)/
        def pe_sense_matcher     = line =~ /Fraction of reads explained by "1\\++,1--,2\\+-,2-\\+":\\s([\\d\\.]+)/
        def pe_antisense_matcher = line =~ /Fraction of reads explained by "1\\+-,1-\\+,2\\+\\+,2--":\\s([\\d\\.]+)/
        if (undetermined_matcher) undetermined = undetermined_matcher[0][1].toFloat() * 100
        if (se_sense_matcher)     sense        = se_sense_matcher[0][1].toFloat() * 100
        if (se_antisense_matcher) antisense    = se_antisense_matcher[0][1].toFloat() * 100
        if (pe_sense_matcher)     sense        = pe_sense_matcher[0][1].toFloat() * 100
        if (pe_antisense_matcher) antisense    = pe_antisense_matcher[0][1].toFloat() * 100
    }
    def strandedness = 'unstranded'
    if (sense >= 100-cutoff) {
        strandedness = 'forward'
    } else if (antisense >= 100-cutoff) {
        strandedness = 'reverse'
    }
    return [ strandedness, sense, antisense, undetermined ]
}
VIASHMAIN
nextflow run . -main-script "\$tempscript" &
wait "\$!"

VIASHEOF


# check whether required files exist
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_OUTPUT_DIR" ] && [ ! -e "$VIASH_PAR_QUALIMAP_OUTPUT_DIR" ]; then
  ViashError "Output file '$VIASH_PAR_QUALIMAP_OUTPUT_DIR' 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_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_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_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_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
