#!/usr/bin/env bash

# multi_star v4.0.2
# 
# This wrapper script is auto-generated by viash 0.9.4 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.
# 
# Component authors:
#  * Angela Oliveira Pisco (author)
#  * Robrecht Cannoodt (author, maintainer)

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="multi_star"
VIASH_META_FUNCTIONALITY_NAME="multi_star"
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"



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

######## Helper functions for setting up Docker images for viash ########
# expects: ViashDockerBuild

# ViashDockerInstallationCheck: check whether Docker is installed correctly
#
# examples:
#   ViashDockerInstallationCheck
function ViashDockerInstallationCheck {
  ViashDebug "Checking whether Docker is installed"
  if [ ! command -v docker &> /dev/null ]; then
    ViashCritical "Docker doesn't seem to be installed. See 'https://docs.docker.com/get-docker/' for instructions."
    exit 1
  fi

  ViashDebug "Checking whether the Docker daemon is running"
  local save=$-; set +e
  local docker_version=$(docker version --format '{{.Client.APIVersion}}' 2> /dev/null)
  local out=$?
  [[ $save =~ e ]] && set -e
  if [ $out -ne 0 ]; then
    ViashCritical "Docker daemon does not seem to be running. Try one of the following:"
    ViashCritical "- Try running 'dockerd' in the command line"
    ViashCritical "- See https://docs.docker.com/config/daemon/"
    exit 1
  fi
}

# ViashDockerRemoteTagCheck: check whether a Docker image is available 
# on a remote. Assumes `docker login` has been performed, if relevant.
#
# $1                  : image identifier with format `[registry/]image[:tag]`
# exit code $?        : whether or not the image was found
# examples:
#   ViashDockerRemoteTagCheck python:latest
#   echo $?                                     # returns '0'
#   ViashDockerRemoteTagCheck sdaizudceahifu
#   echo $?                                     # returns '1'
function ViashDockerRemoteTagCheck {
  docker manifest inspect $1 > /dev/null 2> /dev/null
}

# ViashDockerLocalTagCheck: check whether a Docker image is available locally
#
# $1                  : image identifier with format `[registry/]image[:tag]`
# exit code $?        : whether or not the image was found
# examples:
#   docker pull python:latest
#   ViashDockerLocalTagCheck python:latest
#   echo $?                                     # returns '0'
#   ViashDockerLocalTagCheck sdaizudceahifu
#   echo $?                                     # returns '1'
function ViashDockerLocalTagCheck {
  [ -n "$(docker images -q $1)" ]
}

# ViashDockerPull: pull a Docker image
#
# $1                  : image identifier with format `[registry/]image[:tag]`
# exit code $?        : whether or not the image was found
# examples:
#   ViashDockerPull python:latest
#   echo $?                                     # returns '0'
#   ViashDockerPull sdaizudceahifu
#   echo $?                                     # returns '1'
function ViashDockerPull {
  ViashNotice "Checking if Docker image is available at '$1'"
  if [ $VIASH_VERBOSITY -ge $VIASH_LOGCODE_INFO ]; then
    docker pull $1 && return 0 || return 1
  else
    local save=$-; set +e
    docker pull $1 2> /dev/null > /dev/null
    local out=$?
    [[ $save =~ e ]] && set -e
    if [ $out -ne 0 ]; then
      ViashWarning "Could not pull from '$1'. Docker image doesn't exist or is not accessible."
    fi
    return $out
  fi
}

# ViashDockerPush: push a Docker image
#
# $1                  : image identifier with format `[registry/]image[:tag]`
# exit code $?        : whether or not the image was found
# examples:
#   ViashDockerPush python:latest
#   echo $?                                     # returns '0'
#   ViashDockerPush sdaizudceahifu
#   echo $?                                     # returns '1'
function ViashDockerPush {
  ViashNotice "Pushing image to '$1'"
  local save=$-; set +e
  local out
  if [ $VIASH_VERBOSITY -ge $VIASH_LOGCODE_INFO ]; then
    docker push $1
    out=$?
  else
    docker push $1 2> /dev/null > /dev/null
    out=$?
  fi
  [[ $save =~ e ]] && set -e
  if [ $out -eq 0 ]; then
    ViashNotice "Container '$1' push succeeded."
  else
    ViashError "Container '$1' push errored. You might not be logged in or have the necessary permissions."
  fi
  return $out
}

# ViashDockerPullElseBuild: pull a Docker image, else build it
#
# $1                  : image identifier with format `[registry/]image[:tag]`
# ViashDockerBuild    : a Bash function which builds a docker image, takes image identifier as argument.
# examples:
#   ViashDockerPullElseBuild mynewcomponent
function ViashDockerPullElseBuild {
  local save=$-; set +e
  ViashDockerPull $1
  local out=$?
  [[ $save =~ e ]] && set -e
  if [ $out -ne 0 ]; then
    ViashDockerBuild $@
  fi
}

# ViashDockerSetup: create a Docker image, according to specified docker setup strategy
#
# $1          : image identifier with format `[registry/]image[:tag]`
# $2          : docker setup strategy, see DockerSetupStrategy.scala
# examples:
#   ViashDockerSetup mynewcomponent alwaysbuild
function ViashDockerSetup {
  local image_id="$1"
  local setup_strategy="$2"
  if [ "$setup_strategy" == "alwaysbuild" -o "$setup_strategy" == "build" -o "$setup_strategy" == "b" ]; then
    ViashDockerBuild $image_id --no-cache $(ViashDockerBuildArgs "$engine_id")
  elif [ "$setup_strategy" == "alwayspull" -o "$setup_strategy" == "pull" -o "$setup_strategy" == "p" ]; then
    ViashDockerPull $image_id
  elif [ "$setup_strategy" == "alwayspullelsebuild" -o "$setup_strategy" == "pullelsebuild" ]; then
    ViashDockerPullElseBuild $image_id --no-cache $(ViashDockerBuildArgs "$engine_id")
  elif [ "$setup_strategy" == "alwayspullelsecachedbuild" -o "$setup_strategy" == "pullelsecachedbuild" ]; then
    ViashDockerPullElseBuild $image_id $(ViashDockerBuildArgs "$engine_id")
  elif [ "$setup_strategy" == "alwayscachedbuild" -o "$setup_strategy" == "cachedbuild" -o "$setup_strategy" == "cb" ]; then
    ViashDockerBuild $image_id $(ViashDockerBuildArgs "$engine_id")
  elif [[ "$setup_strategy" =~ ^ifneedbe ]]; then
    local save=$-; set +e
    ViashDockerLocalTagCheck $image_id
    local outCheck=$?
    [[ $save =~ e ]] && set -e
    if [ $outCheck -eq 0 ]; then
      ViashInfo "Image $image_id already exists"
    elif [ "$setup_strategy" == "ifneedbebuild" ]; then
      ViashDockerBuild $image_id --no-cache $(ViashDockerBuildArgs "$engine_id")
    elif [ "$setup_strategy" == "ifneedbecachedbuild" ]; then
      ViashDockerBuild $image_id $(ViashDockerBuildArgs "$engine_id")
    elif [ "$setup_strategy" == "ifneedbepull" ]; then
      ViashDockerPull $image_id
    elif [ "$setup_strategy" == "ifneedbepullelsebuild" ]; then
      ViashDockerPullElseBuild $image_id --no-cache $(ViashDockerBuildArgs "$engine_id")
    elif [ "$setup_strategy" == "ifneedbepullelsecachedbuild" ]; then
      ViashDockerPullElseBuild $image_id $(ViashDockerBuildArgs "$engine_id")
    else
      ViashError "Unrecognised Docker strategy: $setup_strategy"
      exit 1
    fi
  elif [ "$setup_strategy" == "push" -o "$setup_strategy" == "forcepush" -o "$setup_strategy" == "alwayspush" ]; then
    ViashDockerPush "$image_id"
  elif [ "$setup_strategy" == "pushifnotpresent" -o "$setup_strategy" == "gentlepush" -o "$setup_strategy" == "maybepush" ]; then
    local save=$-; set +e
    ViashDockerRemoteTagCheck $image_id
    local outCheck=$?
    [[ $save =~ e ]] && set -e
    if [ $outCheck -eq 0 ]; then
      ViashNotice "Container '$image_id' exists, doing nothing."
    else
      ViashNotice "Container '$image_id' does not yet exist."
      ViashDockerPush "$image_id"
    fi
  elif [ "$setup_strategy" == "donothing" -o "$setup_strategy" == "meh" ]; then
    ViashNotice "Skipping setup."
  else
    ViashError "Unrecognised Docker strategy: $setup_strategy"
    exit 1
  fi
}

# ViashDockerCheckCommands: Check whether a docker container has the required commands
#
# $1                  : image identifier with format `[registry/]image[:tag]`
# $@                  : commands to verify being present
# examples:
#   ViashDockerCheckCommands bash:4.0 bash ps foo
function ViashDockerCheckCommands {
  local image_id="$1"
  shift 1
  local commands="$@"
  local save=$-; set +e
  local missing # mark 'missing' as local in advance, otherwise the exit code of the command will be missing and always be '0'
  missing=$(docker run --rm --entrypoint=sh "$image_id" -c "for command in $commands; do command -v \$command >/dev/null 2>&1; if [ \$? -ne 0 ]; then echo \$command; exit 1; fi; done")
  local outCheck=$?
  [[ $save =~ e ]] && set -e
  if [ $outCheck -ne 0 ]; then
  	ViashError "Docker container '$image_id' does not contain command '$missing'."
  	exit 1
  fi
}

# ViashDockerBuild: build a docker image
# $1                               : image identifier with format `[registry/]image[:tag]`
# $...                             : additional arguments to pass to docker build
# $VIASH_META_TEMP_DIR             : temporary directory to store dockerfile & optional resources in
# $VIASH_META_NAME                 : name of the component
# $VIASH_META_RESOURCES_DIR        : directory containing the resources
# $VIASH_VERBOSITY                 : verbosity level
# exit code $?                     : whether or not the image was built successfully
function ViashDockerBuild {
  local image_id="$1"
  shift 1

  # create temporary directory to store dockerfile & optional resources in
  local tmpdir=$(mktemp -d "$VIASH_META_TEMP_DIR/dockerbuild-$VIASH_META_NAME-XXXXXX")
  local dockerfile="$tmpdir/Dockerfile"
  function clean_up {
    rm -rf "$tmpdir"
  }
  trap clean_up EXIT

  # store dockerfile and resources
  ViashDockerfile "$VIASH_ENGINE_ID" > "$dockerfile"

  # generate the build command
  local docker_build_cmd="docker build -t '$image_id' $@ '$VIASH_META_RESOURCES_DIR' -f '$dockerfile'"

  # build the container
  ViashNotice "Building container '$image_id' with Dockerfile"
  ViashInfo "$docker_build_cmd"
  local save=$-; set +e
  if [ $VIASH_VERBOSITY -ge $VIASH_LOGCODE_INFO ]; then
    eval $docker_build_cmd
  else
    eval $docker_build_cmd &> "$tmpdir/docker_build.log"
  fi

  # check exit code
  local out=$?
  [[ $save =~ e ]] && set -e
  if [ $out -ne 0 ]; then
    ViashError "Error occurred while building container '$image_id'"
    if [ $VIASH_VERBOSITY -lt $VIASH_LOGCODE_INFO ]; then
      ViashError "Transcript: --------------------------------"
      cat "$tmpdir/docker_build.log"
      ViashError "End of transcript --------------------------"
    fi
    exit 1
  fi
}

######## End of helper functions for setting up Docker images for viash ########

# ViashDockerFile: print the dockerfile to stdout
# $1    : engine identifier
# return : dockerfile required to run this component
# examples:
#   ViashDockerFile
function ViashDockerfile {
  local engine_id="$1"

  if [[ "$engine_id" == "docker" ]]; then
    cat << 'VIASHDOCKER'
FROM python:3.12-slim
ENTRYPOINT []
ENV STAR_VERSION=2.7.10b
ENV PACKAGES="gcc g++ make wget zlib1g-dev unzip"
RUN apt-get update && \
  apt-get install -y --no-install-recommends ${PACKAGES} && \
  cd /tmp && \
  wget --no-check-certificate https://github.com/alexdobin/STAR/archive/refs/tags/${STAR_VERSION}.zip && \
  unzip ${STAR_VERSION}.zip && \
  cd STAR-${STAR_VERSION}/source && \
  make STARstatic CXXFLAGS_SIMD=-std=c++11 && \
  cp STAR /usr/local/bin && \
  cd / && \
  rm -rf /tmp/STAR-${STAR_VERSION} /tmp/${STAR_VERSION}.zip && \
  apt-get --purge autoremove -y ${PACKAGES} && \
  apt-get clean

RUN apt-get update && \
  DEBIAN_FRONTEND=noninteractive apt-get install -y samtools procps && \
  rm -rf /var/lib/apt/lists/*

RUN pip install --upgrade pip && \
  pip install --upgrade --no-cache-dir "pyyaml" "HTSeq" "multiprocess" "pandas" "numpy>2" "gffutils" "multiqc"

LABEL org.opencontainers.image.authors="Angela Oliveira Pisco, Robrecht Cannoodt"
LABEL org.opencontainers.image.description="Companion container for running component mapping multi_star"
LABEL org.opencontainers.image.created="2026-02-11T14:34:06Z"
LABEL org.opencontainers.image.source="https://github.com/openpipelines-bio/openpipeline"
LABEL org.opencontainers.image.revision="cd7beddfa85b60b543399a9e2554b8e7b8eaaf62"
LABEL org.opencontainers.image.version="v4.0.2"

VIASHDOCKER
  fi
}

# ViashDockerBuildArgs: return the arguments to pass to docker build
# $1    : engine identifier
# return : arguments to pass to docker build
function ViashDockerBuildArgs {
  local engine_id="$1"

  if [[ "$engine_id" == "docker" ]]; then
    echo ""
  fi
}

# ViashAbsolutePath: generate absolute path from relative path
# borrowed from https://stackoverflow.com/a/21951256
# $1     : relative filename
# return : absolute path
# examples:
#   ViashAbsolutePath some_file.txt   # returns /path/to/some_file.txt
#   ViashAbsolutePath /foo/bar/..     # returns /foo
function ViashAbsolutePath {
  local thePath
  local parr
  local outp
  local len
  if [[ ! "$1" =~ ^/ ]]; then
    thePath="$PWD/$1"
  else
    thePath="$1"
  fi
  echo "$thePath" | (
    IFS=/
    read -a parr
    declare -a outp
    for i in "${parr[@]}"; do
      case "$i" in
      ''|.) continue ;;
      ..)
        len=${#outp[@]}
        if ((len==0)); then
          continue
        else
          unset outp[$((len-1))]
        fi
        ;;
      *)
        len=${#outp[@]}
        outp[$len]="$i"
      ;;
      esac
    done
    echo /"${outp[*]}"
  )
}
# ViashDockerAutodetectMount: auto configuring docker mounts from parameters
# $1                             : The parameter value
# returns                        : New parameter
# $VIASH_DIRECTORY_MOUNTS        : Added another parameter to be passed to docker
# $VIASH_DOCKER_AUTOMOUNT_PREFIX : The prefix to be used for the automounts
# examples:
#   ViashDockerAutodetectMount /path/to/bar      # returns '/viash_automount/path/to/bar'
#   ViashDockerAutodetectMountArg /path/to/bar   # returns '--volume="/path/to:/viash_automount/path/to"'
function ViashDockerAutodetectMount {
  local abs_path=$(ViashAbsolutePath "$1")
  local mount_source
  local base_name
  if [ -d "$abs_path" ]; then
    mount_source="$abs_path"
    base_name=""
  else
    mount_source=`dirname "$abs_path"`
    base_name=`basename "$abs_path"`
  fi
  local mount_target="$VIASH_DOCKER_AUTOMOUNT_PREFIX$mount_source"
  if [ -z "$base_name" ]; then
    echo "$mount_target"
  else
    echo "$mount_target/$base_name"
  fi
}
function ViashDockerAutodetectMountArg {
  local abs_path=$(ViashAbsolutePath "$1")
  local mount_source
  local base_name
  if [ -d "$abs_path" ]; then
    mount_source="$abs_path"
    base_name=""
  else
    mount_source=`dirname "$abs_path"`
    base_name=`basename "$abs_path"`
  fi
  local mount_target="$VIASH_DOCKER_AUTOMOUNT_PREFIX$mount_source"
  ViashDebug "ViashDockerAutodetectMountArg $1 -> $mount_source -> $mount_target"
  echo "--volume=\"$mount_source:$mount_target\""
}
function ViashDockerStripAutomount {
  local abs_path=$(ViashAbsolutePath "$1")
  echo "${abs_path#$VIASH_DOCKER_AUTOMOUNT_PREFIX}"
}
# initialise variables
VIASH_DIRECTORY_MOUNTS=()

# configure default docker automount prefix if it is unset
if [ -z "${VIASH_DOCKER_AUTOMOUNT_PREFIX+x}" ]; then
  VIASH_DOCKER_AUTOMOUNT_PREFIX="/viash_automount"
fi

# initialise docker variables
VIASH_DOCKER_RUN_ARGS=(-i --rm)


# ViashHelp: Display helpful explanation about this executable
function ViashHelp {
  echo "multi_star v4.0.2"
  echo ""
  echo "Align fastq files using STAR."
  echo ""
  echo "Input/Output:"
  echo "    --input_id"
  echo "        type: string, required parameter, multiple values allowed"
  echo "        example: mysample;mysample"
  echo "        The ID of the sample being processed. This vector should have the same"
  echo "        length as the \`--input_r1\` argument."
  echo ""
  echo "    --input_r1"
  echo "        type: file, required parameter, multiple values allowed, file must exist"
  echo "        example:"
  echo "mysample_S1_L001_R1_001.fastq.gz;mysample_S1_L002_R1_001.fastq.gz"
  echo "        Paths to the sequences to be mapped. If using Illumina paired-end reads,"
  echo "        only the R1 files should be passed."
  echo ""
  echo "    --input_r2"
  echo "        type: file, multiple values allowed, file must exist"
  echo "        example:"
  echo "mysample_S1_L001_R2_001.fastq.gz;mysample_S1_L002_R2_001.fastq.gz"
  echo "        Paths to the sequences to be mapped. If using Illumina paired-end reads,"
  echo "        only the R2 files should be passed."
  echo ""
  echo "    --genomeDir, --reference_index"
  echo "        type: file, required parameter, file must exist"
  echo "        example: /path/to/reference"
  echo "        Path to the reference built by star_build_reference. Corresponds to the"
  echo "        --genomeDir argument in the STAR command."
  echo ""
  echo "    --reference_gtf"
  echo "        type: file, required parameter, file must exist"
  echo "        example: genes.gtf"
  echo "        Path to the gtf reference file."
  echo ""
  echo "    --outFileNamePrefix, --output"
  echo "        type: file, required parameter, output, file must exist"
  echo "        example: /path/to/foo"
  echo "        Path to output directory. Corresponds to the --outFileNamePrefix"
  echo "        argument in the STAR command."
  echo ""
  echo "Processing arguments:"
  echo "    --run_htseq_count"
  echo "        type: boolean"
  echo "        default: true"
  echo "        Whether or not to also run htseq-count after STAR."
  echo ""
  echo "    --run_multiqc"
  echo "        type: boolean"
  echo "        default: true"
  echo "        Whether or not to also run MultiQC at the end."
  echo ""
  echo "    --min_success_rate"
  echo "        type: double"
  echo "        default: 0.5"
  echo "        Fail when the success rate is below this threshold."
  echo ""
  echo "Run Parameters:"
  echo "    --runRNGseed"
  echo "        type: integer"
  echo "        example: 777"
  echo "        random number generator seed."
  echo ""
  echo "Genome Parameters:"
  echo "    --genomeFastaFiles"
  echo "        type: file, multiple values allowed, file must exist"
  echo "        path(s) to the fasta files with the genome sequences, separated by"
  echo "        spaces. These files should be plain text FASTA files, they *cannot* be"
  echo "        zipped."
  echo "        Required for the genome generation (--runMode genomeGenerate). Can also"
  echo "        be used in the mapping (--runMode alignReads) to add extra (new)"
  echo "        sequences to the genome (e.g. spike-ins)."
  echo ""
  echo "Splice Junctions Database:"
  echo "    --sjdbFileChrStartEnd"
  echo "        type: string, multiple values allowed"
  echo "        path to the files with genomic coordinates (chr <tab> start <tab> end"
  echo "        <tab> strand) for the splice junction introns. Multiple files can be"
  echo "        supplied and will be concatenated."
  echo ""
  echo "    --sjdbGTFfile"
  echo "        type: file, file must exist"
  echo "        path to the GTF file with annotations"
  echo ""
  echo "    --sjdbGTFchrPrefix"
  echo "        type: string"
  echo "        prefix for chromosome names in a GTF file (e.g. 'chr' for using ENSMEBL"
  echo "        annotations with UCSC genomes)"
  echo ""
  echo "    --sjdbGTFfeatureExon"
  echo "        type: string"
  echo "        example: exon"
  echo "        feature type in GTF file to be used as exons for building transcripts"
  echo ""
  echo "    --sjdbGTFtagExonParentTranscript"
  echo "        type: string"
  echo "        example: transcript_id"
  echo "        GTF attribute name for parent transcript ID (default \"transcript_id\""
  echo "        works for GTF files)"
  echo ""
  echo "    --sjdbGTFtagExonParentGene"
  echo "        type: string"
  echo "        example: gene_id"
  echo "        GTF attribute name for parent gene ID (default \"gene_id\" works for GTF"
  echo "        files)"
  echo ""
  echo "    --sjdbGTFtagExonParentGeneName"
  echo "        type: string, multiple values allowed"
  echo "        example: gene_name"
  echo "        GTF attribute name for parent gene name"
  echo ""
  echo "    --sjdbGTFtagExonParentGeneType"
  echo "        type: string, multiple values allowed"
  echo "        example: gene_type;gene_biotype"
  echo "        GTF attribute name for parent gene type"
  echo ""
  echo "    --sjdbOverhang"
  echo "        type: integer"
  echo "        example: 100"
  echo "        length of the donor/acceptor sequence on each side of the junctions,"
  echo "        ideally = (mate_length - 1)"
  echo ""
  echo "    --sjdbScore"
  echo "        type: integer"
  echo "        example: 2"
  echo "        extra alignment score for alignments that cross database junctions"
  echo ""
  echo "    --sjdbInsertSave"
  echo "        type: string"
  echo "        example: Basic"
  echo "        which files to save when sjdb junctions are inserted on the fly at the"
  echo "        mapping step"
  echo "        - Basic ... only small junction / transcript files"
  echo "        - All   ... all files including big Genome, SA and SAindex - this will"
  echo "        create a complete genome directory"
  echo ""
  echo "Variation parameters:"
  echo "    --varVCFfile"
  echo "        type: string"
  echo "        path to the VCF file that contains variation data. The 10th column"
  echo "        should contain the genotype information, e.g. 0/1"
  echo ""
  echo "Read Parameters:"
  echo "    --readFilesType"
  echo "        type: string"
  echo "        example: Fastx"
  echo "        format of input read files"
  echo "        - Fastx       ... FASTA or FASTQ"
  echo "        - SAM SE      ... SAM or BAM single-end reads; for BAM use"
  echo "        --readFilesCommand samtools view"
  echo "        - SAM PE      ... SAM or BAM paired-end reads; for BAM use"
  echo "        --readFilesCommand samtools view"
  echo ""
  echo "    --readFilesSAMattrKeep"
  echo "        type: string, multiple values allowed"
  echo "        example: All"
  echo "        for --readFilesType SAM SE/PE, which SAM tags to keep in the output BAM,"
  echo "        e.g.: --readFilesSAMtagsKeep RG PL"
  echo "        - All     ... keep all tags"
  echo "        - None    ... do not keep any tags"
  echo ""
  echo "    --readFilesManifest"
  echo "        type: file, file must exist"
  echo "        path to the \"manifest\" file with the names of read files. The manifest"
  echo "        file should contain 3 tab-separated columns:"
  echo "        paired-end reads: read1_file_name \$tab\$ read2_file_name \$tab\$"
  echo "        read_group_line."
  echo "        single-end reads: read1_file_name \$tab\$ -               \$tab\$"
  echo "        read_group_line."
  echo "        Spaces, but not tabs are allowed in file names."
  echo "        If read_group_line does not start with ID:, it can only contain one ID"
  echo "        field, and ID: will be added to it."
  echo "        If read_group_line starts with ID:, it can contain several fields"
  echo "        separated by \$tab\$, and all fields will be be copied verbatim into SAM"
  echo "        @RG header line."
  echo ""
  echo "    --readFilesPrefix"
  echo "        type: string"
  echo "        prefix for the read files names, i.e. it will be added in front of the"
  echo "        strings in --readFilesIn"
  echo ""
  echo "    --readFilesCommand"
  echo "        type: string, multiple values allowed"
  echo "        command line to execute for each of the input file. This command should"
  echo "        generate FASTA or FASTQ text and send it to stdout"
  echo "        For example: zcat - to uncompress .gz files, bzcat - to uncompress .bz2"
  echo "        files, etc."
  echo ""
  echo "    --readMapNumber"
  echo "        type: integer"
  echo "        example: -1"
  echo "        number of reads to map from the beginning of the file"
  echo "        -1: map all reads"
  echo ""
  echo "    --readMatesLengthsIn"
  echo "        type: string"
  echo "        example: NotEqual"
  echo "        Equal/NotEqual - lengths of names,sequences,qualities for both mates are"
  echo "        the same  / not the same. NotEqual is safe in all situations."
  echo ""
  echo "    --readNameSeparator"
  echo "        type: string, multiple values allowed"
  echo "        example: /"
  echo "        character(s) separating the part of the read names that will be trimmed"
  echo "        in output (read name after space is always trimmed)"
  echo ""
  echo "    --readQualityScoreBase"
  echo "        type: integer"
  echo "        example: 33"
  echo "        number to be subtracted from the ASCII code to get Phred quality score"
  echo ""
  echo "Read Clipping:"
  echo "    --clipAdapterType"
  echo "        type: string"
  echo "        example: Hamming"
  echo "        adapter clipping type"
  echo "        - Hamming ... adapter clipping based on Hamming distance, with the"
  echo "        number of mismatches controlled by --clip5pAdapterMMp"
  echo "        - CellRanger4 ... 5p and 3p adapter clipping similar to CellRanger4."
  echo "        Utilizes Opal package by Martin Sosic: https://github.com/Martinsos/opal"
  echo "        - None ... no adapter clipping, all other clip* parameters are"
  echo "        disregarded"
  echo ""
  echo "    --clip3pNbases"
  echo "        type: integer, multiple values allowed"
  echo "        example: 0"
  echo "        number(s) of bases to clip from 3p of each mate. If one value is given,"
  echo "        it will be assumed the same for both mates."
  echo ""
  echo "    --clip3pAdapterSeq"
  echo "        type: string, multiple values allowed"
  echo "        adapter sequences to clip from 3p of each mate.  If one value is given,"
  echo "        it will be assumed the same for both mates."
  echo "        - polyA ... polyA sequence with the length equal to read length"
  echo ""
  echo "    --clip3pAdapterMMp"
  echo "        type: double, multiple values allowed"
  echo "        example: 0.1"
  echo "        max proportion of mismatches for 3p adapter clipping for each mate.  If"
  echo "        one value is given, it will be assumed the same for both mates."
  echo ""
  echo "    --clip3pAfterAdapterNbases"
  echo "        type: integer, multiple values allowed"
  echo "        example: 0"
  echo "        number of bases to clip from 3p of each mate after the adapter clipping."
  echo "        If one value is given, it will be assumed the same for both mates."
  echo ""
  echo "    --clip5pNbases"
  echo "        type: integer, multiple values allowed"
  echo "        example: 0"
  echo "        number(s) of bases to clip from 5p of each mate. If one value is given,"
  echo "        it will be assumed the same for both mates."
  echo ""
  echo "Limits:"
  echo "    --limitGenomeGenerateRAM"
  echo "        type: long"
  echo "        example: 31000000000"
  echo "        maximum available RAM (bytes) for genome generation"
  echo ""
  echo "    --limitIObufferSize"
  echo "        type: long, multiple values allowed"
  echo "        example: 30000000;50000000"
  echo "        max available buffers size (bytes) for input/output, per thread"
  echo ""
  echo "    --limitOutSAMoneReadBytes"
  echo "        type: long"
  echo "        example: 100000"
  echo "        max size of the SAM record (bytes) for one read. Recommended value:"
  echo "        >(2*(LengthMate1+LengthMate2+100)*outFilterMultimapNmax"
  echo ""
  echo "    --limitOutSJoneRead"
  echo "        type: integer"
  echo "        example: 1000"
  echo "        max number of junctions for one read (including all multi-mappers)"
  echo ""
  echo "    --limitOutSJcollapsed"
  echo "        type: integer"
  echo "        example: 1000000"
  echo "        max number of collapsed junctions"
  echo ""
  echo "    --limitBAMsortRAM"
  echo "        type: long"
  echo "        example: 0"
  echo "        maximum available RAM (bytes) for sorting BAM. If =0, it will be set to"
  echo "        the genome index size. 0 value can only be used with --genomeLoad"
  echo "        NoSharedMemory option."
  echo ""
  echo "    --limitSjdbInsertNsj"
  echo "        type: integer"
  echo "        example: 1000000"
  echo "        maximum number of junctions to be inserted to the genome on the fly at"
  echo "        the mapping stage, including those from annotations and those detected"
  echo "        in the 1st step of the 2-pass run"
  echo ""
  echo "    --limitNreadsSoft"
  echo "        type: integer"
  echo "        example: -1"
  echo "        soft limit on the number of reads"
  echo ""
  echo "Output: general:"
  echo "    --outTmpKeep"
  echo "        type: string"
  echo "        whether to keep the temporary files after STAR runs is finished"
  echo "        - None ... remove all temporary files"
  echo "        - All ... keep all files"
  echo ""
  echo "    --outStd"
  echo "        type: string"
  echo "        example: Log"
  echo "        which output will be directed to stdout (standard out)"
  echo "        - Log                    ... log messages"
  echo "        - SAM                    ... alignments in SAM format (which normally"
  echo "        are output to Aligned.out.sam file), normal standard output will go into"
  echo "        Log.std.out"
  echo "        - BAM_Unsorted           ... alignments in BAM format, unsorted."
  echo "        Requires --outSAMtype BAM Unsorted"
  echo "        - BAM_SortedByCoordinate ... alignments in BAM format, sorted by"
  echo "        coordinate. Requires --outSAMtype BAM SortedByCoordinate"
  echo "        - BAM_Quant              ... alignments to transcriptome in BAM format,"
  echo "        unsorted. Requires --quantMode TranscriptomeSAM"
  echo ""
  echo "    --outReadsUnmapped"
  echo "        type: string"
  echo "        output of unmapped and partially mapped (i.e. mapped only one mate of a"
  echo "        paired end read) reads in separate file(s)."
  echo "        - None    ... no output"
  echo "        - Fastx   ... output in separate fasta/fastq files, Unmapped.out.mate1/2"
  echo ""
  echo "    --outQSconversionAdd"
  echo "        type: integer"
  echo "        example: 0"
  echo "        add this number to the quality score (e.g. to convert from Illumina to"
  echo "        Sanger, use -31)"
  echo ""
  echo "    --outMultimapperOrder"
  echo "        type: string"
  echo "        example: Old_2.4"
  echo "        order of multimapping alignments in the output files"
  echo "        - Old_2.4             ... quasi-random order used before 2.5.0"
  echo "        - Random              ... random order of alignments for each"
  echo "        multi-mapper. Read mates (pairs) are always adjacent, all alignment for"
  echo "        each read stay together. This option will become default in the future"
  echo "        releases."
  echo ""
  echo "Output: SAM and BAM:"
  echo "    --outSAMmode"
  echo "        type: string"
  echo "        example: Full"
  echo "        mode of SAM output"
  echo "        - None ... no SAM output"
  echo "        - Full ... full SAM output"
  echo "        - NoQS ... full SAM but without quality scores"
  echo ""
  echo "    --outSAMstrandField"
  echo "        type: string"
  echo "        Cufflinks-like strand field flag"
  echo "        - None        ... not used"
  echo "        - intronMotif ... strand derived from the intron motif. This option"
  echo "        changes the output alignments: reads with inconsistent and/or"
  echo "        non-canonical introns are filtered out."
  echo ""
  echo "    --outSAMattributes"
  echo "        type: string, multiple values allowed"
  echo "        example: Standard"
  echo "        a string of desired SAM attributes, in the order desired for the output"
  echo "        SAM. Tags can be listed in any combination/order."
  echo "        ***Presets:"
  echo "        - None        ... no attributes"
  echo "        - Standard    ... NH HI AS nM"
  echo "        - All         ... NH HI AS nM NM MD jM jI MC ch"
  echo "        ***Alignment:"
  echo "        - NH          ... number of loci the reads maps to: =1 for unique"
  echo "        mappers, >1 for multimappers. Standard SAM tag."
  echo "        - HI          ... multiple alignment index, starts with"
  echo "        --outSAMattrIHstart (=1 by default). Standard SAM tag."
  echo "        - AS          ... local alignment score, +1/-1 for matches/mismateches,"
  echo "        score* penalties for indels and gaps. For PE reads, total score for two"
  echo "        mates. Stadnard SAM tag."
  echo "        - nM          ... number of mismatches. For PE reads, sum over two"
  echo "        mates."
  echo "        - NM          ... edit distance to the reference (number of mismatched +"
  echo "        inserted + deleted bases) for each mate. Standard SAM tag."
  echo "        - MD          ... string encoding mismatched and deleted reference bases"
  echo "        (see standard SAM specifications). Standard SAM tag."
  echo "        - jM          ... intron motifs for all junctions (i.e. N in CIGAR): 0:"
  echo "        non-canonical; 1: GT/AG, 2: CT/AC, 3: GC/AG, 4: CT/GC, 5: AT/AC, 6:"
  echo "        GT/AT. If splice junctions database is used, and a junction is"
  echo "        annotated, 20 is added to its motif value."
  echo "        - jI          ... start and end of introns for all junctions (1-based)."
  echo "        - XS          ... alignment strand according to --outSAMstrandField."
  echo "        - MC          ... mate's CIGAR string. Standard SAM tag."
  echo "        - ch          ... marks all segment of all chimeric alingments for"
  echo "        --chimOutType WithinBAM output."
  echo "        - cN          ... number of bases clipped from the read ends: 5' and 3'"
  echo "        ***Variation:"
  echo "        - vA          ... variant allele"
  echo "        - vG          ... genomic coordinate of the variant overlapped by the"
  echo "        read."
  echo "        - vW          ... 1 - alignment passes WASP filtering; 2,3,4,5,6,7 -"
  echo "        alignment does not pass WASP filtering. Requires --waspOutputMode"
  echo "        SAMtag."
  echo "        ***STARsolo:"
  echo "        - CR CY UR UY ... sequences and quality scores of cell barcodes and UMIs"
  echo "        for the solo* demultiplexing."
  echo "        - GX GN       ... gene ID and gene name for unique-gene reads."
  echo "        - gx gn       ... gene IDs and gene names for unique- and multi-gene"
  echo "        reads."
  echo "        - CB UB       ... error-corrected cell barcodes and UMIs for solo*"
  echo "        demultiplexing. Requires --outSAMtype BAM SortedByCoordinate."
  echo "        - sM          ... assessment of CB and UMI."
  echo "        - sS          ... sequence of the entire barcode (CB,UMI,adapter)."
  echo "        - sQ          ... quality of the entire barcode."
  echo "        ***Unsupported/undocumented:"
  echo "        - ha          ... haplotype (1/2) when mapping to the diploid genome."
  echo "        Requires genome generated with --genomeTransformType Diploid ."
  echo "        - rB          ... alignment block read/genomic coordinates."
  echo "        - vR          ... read coordinate of the variant."
  echo ""
  echo "    --outSAMattrIHstart"
  echo "        type: integer"
  echo "        example: 1"
  echo "        start value for the IH attribute. 0 may be required by some downstream"
  echo "        software, such as Cufflinks or StringTie."
  echo ""
  echo "    --outSAMunmapped"
  echo "        type: string, multiple values allowed"
  echo "        output of unmapped reads in the SAM format"
  echo "        1st word:"
  echo "        - None   ... no output"
  echo "        - Within ... output unmapped reads within the main SAM file (i.e."
  echo "        Aligned.out.sam)"
  echo "        2nd word:"
  echo "        - KeepPairs ... record unmapped mate for each alignment, and, in case of"
  echo "        unsorted output, keep it adjacent to its mapped mate. Only affects"
  echo "        multi-mapping reads."
  echo ""
  echo "    --outSAMorder"
  echo "        type: string"
  echo "        example: Paired"
  echo "        type of sorting for the SAM output"
  echo "        Paired: one mate after the other for all paired alignments"
  echo "        PairedKeepInputOrder: one mate after the other for all paired"
  echo "        alignments, the order is kept the same as in the input FASTQ files"
  echo ""
  echo "    --outSAMprimaryFlag"
  echo "        type: string"
  echo "        example: OneBestScore"
  echo "        which alignments are considered primary - all others will be marked with"
  echo "        0x100 bit in the FLAG"
  echo "        - OneBestScore ... only one alignment with the best score is primary"
  echo "        - AllBestScore ... all alignments with the best score are primary"
  echo ""
  echo "    --outSAMreadID"
  echo "        type: string"
  echo "        example: Standard"
  echo "        read ID record type"
  echo "        - Standard ... first word (until space) from the FASTx read ID line,"
  echo "        removing /1,/2 from the end"
  echo "        - Number   ... read number (index) in the FASTx file"
  echo ""
  echo "    --outSAMmapqUnique"
  echo "        type: integer"
  echo "        example: 255"
  echo "        0 to 255: the MAPQ value for unique mappers"
  echo ""
  echo "    --outSAMflagOR"
  echo "        type: integer"
  echo "        example: 0"
  echo "        0 to 65535: sam FLAG will be bitwise OR'd with this value, i.e."
  echo "        FLAG=FLAG | outSAMflagOR. This is applied after all flags have been set"
  echo "        by STAR, and after outSAMflagAND. Can be used to set specific bits that"
  echo "        are not set otherwise."
  echo ""
  echo "    --outSAMflagAND"
  echo "        type: integer"
  echo "        example: 65535"
  echo "        0 to 65535: sam FLAG will be bitwise AND'd with this value, i.e."
  echo "        FLAG=FLAG & outSAMflagOR. This is applied after all flags have been set"
  echo "        by STAR, but before outSAMflagOR. Can be used to unset specific bits"
  echo "        that are not set otherwise."
  echo ""
  echo "    --outSAMattrRGline"
  echo "        type: string, multiple values allowed"
  echo "        SAM/BAM read group line. The first word contains the read group"
  echo "        identifier and must start with \"ID:\", e.g. --outSAMattrRGline ID:xxx"
  echo "        CN:yy \"DS:z z z\"."
  echo "        xxx will be added as RG tag to each output alignment. Any spaces in the"
  echo "        tag values have to be double quoted."
  echo "        Comma separated RG lines correspons to different (comma separated) input"
  echo "        files in --readFilesIn. Commas have to be surrounded by spaces, e.g."
  echo "        --outSAMattrRGline ID:xxx , ID:zzz \"DS:z z\" , ID:yyy DS:yyyy"
  echo ""
  echo "    --outSAMheaderHD"
  echo "        type: string, multiple values allowed"
  echo "        @HD (header) line of the SAM header"
  echo ""
  echo "    --outSAMheaderPG"
  echo "        type: string, multiple values allowed"
  echo "        extra @PG (software) line of the SAM header (in addition to STAR)"
  echo ""
  echo "    --outSAMheaderCommentFile"
  echo "        type: string"
  echo "        path to the file with @CO (comment) lines of the SAM header"
  echo ""
  echo "    --outSAMfilter"
  echo "        type: string, multiple values allowed"
  echo "        filter the output into main SAM/BAM files"
  echo "        - KeepOnlyAddedReferences ... only keep the reads for which all"
  echo "        alignments are to the extra reference sequences added with"
  echo "        --genomeFastaFiles at the mapping stage."
  echo "        - KeepAllAddedReferences ...  keep all alignments to the extra reference"
  echo "        sequences added with --genomeFastaFiles at the mapping stage."
  echo ""
  echo "    --outSAMmultNmax"
  echo "        type: integer"
  echo "        example: -1"
  echo "        max number of multiple alignments for a read that will be output to the"
  echo "        SAM/BAM files. Note that if this value is not equal to -1, the top"
  echo "        scoring alignment will be output first"
  echo "        - -1 ... all alignments (up to --outFilterMultimapNmax) will be output"
  echo ""
  echo "    --outSAMtlen"
  echo "        type: integer"
  echo "        example: 1"
  echo "        calculation method for the TLEN field in the SAM/BAM files"
  echo "        - 1 ... leftmost base of the (+)strand mate to rightmost base of the"
  echo "        (-)mate. (+)sign for the (+)strand mate"
  echo "        - 2 ... leftmost base of any mate to rightmost base of any mate. (+)sign"
  echo "        for the mate with the leftmost base. This is different from 1 for"
  echo "        overlapping mates with protruding ends"
  echo ""
  echo "    --outBAMcompression"
  echo "        type: integer"
  echo "        example: 1"
  echo "        -1 to 10  BAM compression level, -1=default compression (6?), 0=no"
  echo "        compression, 10=maximum compression"
  echo ""
  echo "    --outBAMsortingThreadN"
  echo "        type: integer"
  echo "        example: 0"
  echo "        >=0: number of threads for BAM sorting. 0 will default to"
  echo "        min(6,--runThreadN)."
  echo ""
  echo "    --outBAMsortingBinsN"
  echo "        type: integer"
  echo "        example: 50"
  echo "        >0:  number of genome bins for coordinate-sorting"
  echo ""
  echo "BAM processing:"
  echo "    --bamRemoveDuplicatesType"
  echo "        type: string"
  echo "        mark duplicates in the BAM file, for now only works with (i) sorted BAM"
  echo "        fed with inputBAMfile, and (ii) for paired-end alignments only"
  echo "        - -                       ... no duplicate removal/marking"
  echo "        - UniqueIdentical         ... mark all multimappers, and duplicate"
  echo "        unique mappers. The coordinates, FLAG, CIGAR must be identical"
  echo "        - UniqueIdenticalNotMulti  ... mark duplicate unique mappers but not"
  echo "        multimappers."
  echo ""
  echo "    --bamRemoveDuplicatesMate2basesN"
  echo "        type: integer"
  echo "        example: 0"
  echo "        number of bases from the 5' of mate 2 to use in collapsing (e.g. for"
  echo "        RAMPAGE)"
  echo ""
  echo "Output Wiggle:"
  echo "    --outWigType"
  echo "        type: string, multiple values allowed"
  echo "        type of signal output, e.g. \"bedGraph\" OR \"bedGraph read1_5p\". Requires"
  echo "        sorted BAM: --outSAMtype BAM SortedByCoordinate ."
  echo "        1st word:"
  echo "        - None       ... no signal output"
  echo "        - bedGraph   ... bedGraph format"
  echo "        - wiggle     ... wiggle format"
  echo "        2nd word:"
  echo "        - read1_5p   ... signal from only 5' of the 1st read, useful for"
  echo "        CAGE/RAMPAGE etc"
  echo "        - read2      ... signal from only 2nd read"
  echo ""
  echo "    --outWigStrand"
  echo "        type: string"
  echo "        example: Stranded"
  echo "        strandedness of wiggle/bedGraph output"
  echo "        - Stranded   ...  separate strands, str1 and str2"
  echo "        - Unstranded ...  collapsed strands"
  echo ""
  echo "    --outWigReferencesPrefix"
  echo "        type: string"
  echo "        prefix matching reference names to include in the output wiggle file,"
  echo "        e.g. \"chr\", default \"-\" - include all references"
  echo ""
  echo "    --outWigNorm"
  echo "        type: string"
  echo "        example: RPM"
  echo "        type of normalization for the signal"
  echo "        - RPM    ... reads per million of mapped reads"
  echo "        - None   ... no normalization, \"raw\" counts"
  echo ""
  echo "Output Filtering:"
  echo "    --outFilterType"
  echo "        type: string"
  echo "        example: Normal"
  echo "        type of filtering"
  echo "        - Normal  ... standard filtering using only current alignment"
  echo "        - BySJout ... keep only those reads that contain junctions that passed"
  echo "        filtering into SJ.out.tab"
  echo ""
  echo "    --outFilterMultimapScoreRange"
  echo "        type: integer"
  echo "        example: 1"
  echo "        the score range below the maximum score for multimapping alignments"
  echo ""
  echo "    --outFilterMultimapNmax"
  echo "        type: integer"
  echo "        example: 10"
  echo "        maximum number of loci the read is allowed to map to. Alignments (all of"
  echo "        them) will be output only if the read maps to no more loci than this"
  echo "        value."
  echo "        Otherwise no alignments will be output, and the read will be counted as"
  echo "        \"mapped to too many loci\" in the Log.final.out ."
  echo ""
  echo "    --outFilterMismatchNmax"
  echo "        type: integer"
  echo "        example: 10"
  echo "        alignment will be output only if it has no more mismatches than this"
  echo "        value."
  echo ""
  echo "    --outFilterMismatchNoverLmax"
  echo "        type: double"
  echo "        example: 0.3"
  echo "        alignment will be output only if its ratio of mismatches to *mapped*"
  echo "        length is less than or equal to this value."
  echo ""
  echo "    --outFilterMismatchNoverReadLmax"
  echo "        type: double"
  echo "        example: 1.0"
  echo "        alignment will be output only if its ratio of mismatches to *read*"
  echo "        length is less than or equal to this value."
  echo ""
  echo "    --outFilterScoreMin"
  echo "        type: integer"
  echo "        example: 0"
  echo "        alignment will be output only if its score is higher than or equal to"
  echo "        this value."
  echo ""
  echo "    --outFilterScoreMinOverLread"
  echo "        type: double"
  echo "        example: 0.66"
  echo "        same as outFilterScoreMin, but normalized to read length (sum of mates'"
  echo "        lengths for paired-end reads)"
  echo ""
  echo "    --outFilterMatchNmin"
  echo "        type: integer"
  echo "        example: 0"
  echo "        alignment will be output only if the number of matched bases is higher"
  echo "        than or equal to this value."
  echo ""
  echo "    --outFilterMatchNminOverLread"
  echo "        type: double"
  echo "        example: 0.66"
  echo "        sam as outFilterMatchNmin, but normalized to the read length (sum of"
  echo "        mates' lengths for paired-end reads)."
  echo ""
  echo "    --outFilterIntronMotifs"
  echo "        type: string"
  echo "        filter alignment using their motifs"
  echo "        - None                           ... no filtering"
  echo "        - RemoveNoncanonical             ... filter out alignments that contain"
  echo "        non-canonical junctions"
  echo "        - RemoveNoncanonicalUnannotated  ... filter out alignments that contain"
  echo "        non-canonical unannotated junctions when using annotated splice"
  echo "        junctions database. The annotated non-canonical junctions will be kept."
  echo ""
  echo "    --outFilterIntronStrands"
  echo "        type: string"
  echo "        example: RemoveInconsistentStrands"
  echo "        filter alignments"
  echo "        - RemoveInconsistentStrands      ... remove alignments that have"
  echo "        junctions with inconsistent strands"
  echo "        - None                           ... no filtering"
  echo ""
  echo "Output splice junctions (SJ.out.tab):"
  echo "    --outSJtype"
  echo "        type: string"
  echo "        example: Standard"
  echo "        type of splice junction output"
  echo "        - Standard    ... standard SJ.out.tab output"
  echo "        - None        ... no splice junction output"
  echo ""
  echo "Output Filtering: Splice Junctions:"
  echo "    --outSJfilterReads"
  echo "        type: string"
  echo "        example: All"
  echo "        which reads to consider for collapsed splice junctions output"
  echo "        - All     ... all reads, unique- and multi-mappers"
  echo "        - Unique  ... uniquely mapping reads only"
  echo ""
  echo "    --outSJfilterOverhangMin"
  echo "        type: integer, multiple values allowed"
  echo "        example: 30;12;12;12"
  echo "        minimum overhang length for splice junctions on both sides for: (1)"
  echo "        non-canonical motifs, (2) GT/AG and CT/AC motif, (3) GC/AG and CT/GC"
  echo "        motif, (4) AT/AC and GT/AT motif. -1 means no output for that motif"
  echo "        does not apply to annotated junctions"
  echo ""
  echo "    --outSJfilterCountUniqueMin"
  echo "        type: integer, multiple values allowed"
  echo "        example: 3;1;1;1"
  echo "        minimum uniquely mapping read count per junction for: (1) non-canonical"
  echo "        motifs, (2) GT/AG and CT/AC motif, (3) GC/AG and CT/GC motif, (4) AT/AC"
  echo "        and GT/AT motif. -1 means no output for that motif"
  echo "        Junctions are output if one of outSJfilterCountUniqueMin OR"
  echo "        outSJfilterCountTotalMin conditions are satisfied"
  echo "        does not apply to annotated junctions"
  echo ""
  echo "    --outSJfilterCountTotalMin"
  echo "        type: integer, multiple values allowed"
  echo "        example: 3;1;1;1"
  echo "        minimum total (multi-mapping+unique) read count per junction for: (1)"
  echo "        non-canonical motifs, (2) GT/AG and CT/AC motif, (3) GC/AG and CT/GC"
  echo "        motif, (4) AT/AC and GT/AT motif. -1 means no output for that motif"
  echo "        Junctions are output if one of outSJfilterCountUniqueMin OR"
  echo "        outSJfilterCountTotalMin conditions are satisfied"
  echo "        does not apply to annotated junctions"
  echo ""
  echo "    --outSJfilterDistToOtherSJmin"
  echo "        type: integer, multiple values allowed"
  echo "        example: 10;0;5;10"
  echo "        minimum allowed distance to other junctions' donor/acceptor"
  echo "        does not apply to annotated junctions"
  echo ""
  echo "    --outSJfilterIntronMaxVsReadN"
  echo "        type: integer, multiple values allowed"
  echo "        example: 50000;100000;200000"
  echo "        maximum gap allowed for junctions supported by 1,2,3,,,N reads"
  echo "        i.e. by default junctions supported by 1 read can have gaps <=50000b, by"
  echo "        2 reads: <=100000b, by 3 reads: <=200000. by >=4 reads any gap"
  echo "        <=alignIntronMax"
  echo "        does not apply to annotated junctions"
  echo ""
  echo "Scoring:"
  echo "    --scoreGap"
  echo "        type: integer"
  echo "        example: 0"
  echo "        splice junction penalty (independent on intron motif)"
  echo ""
  echo "    --scoreGapNoncan"
  echo "        type: integer"
  echo "        example: -8"
  echo "        non-canonical junction penalty (in addition to scoreGap)"
  echo ""
  echo "    --scoreGapGCAG"
  echo "        type: integer"
  echo "        example: -4"
  echo "        GC/AG and CT/GC junction penalty (in addition to scoreGap)"
  echo ""
  echo "    --scoreGapATAC"
  echo "        type: integer"
  echo "        example: -8"
  echo "        AT/AC  and GT/AT junction penalty  (in addition to scoreGap)"
  echo ""
  echo "    --scoreGenomicLengthLog2scale"
  echo "        type: integer"
  echo "        example: 0"
  echo "        extra score logarithmically scaled with genomic length of the alignment:"
  echo "        scoreGenomicLengthLog2scale*log2(genomicLength)"
  echo ""
  echo "    --scoreDelOpen"
  echo "        type: integer"
  echo "        example: -2"
  echo "        deletion open penalty"
  echo ""
  echo "    --scoreDelBase"
  echo "        type: integer"
  echo "        example: -2"
  echo "        deletion extension penalty per base (in addition to scoreDelOpen)"
  echo ""
  echo "    --scoreInsOpen"
  echo "        type: integer"
  echo "        example: -2"
  echo "        insertion open penalty"
  echo ""
  echo "    --scoreInsBase"
  echo "        type: integer"
  echo "        example: -2"
  echo "        insertion extension penalty per base (in addition to scoreInsOpen)"
  echo ""
  echo "    --scoreStitchSJshift"
  echo "        type: integer"
  echo "        example: 1"
  echo "        maximum score reduction while searching for SJ boundaries in the"
  echo "        stitching step"
  echo ""
  echo "Alignments and Seeding:"
  echo "    --seedSearchStartLmax"
  echo "        type: integer"
  echo "        example: 50"
  echo "        defines the search start point through the read - the read is split into"
  echo "        pieces no longer than this value"
  echo ""
  echo "    --seedSearchStartLmaxOverLread"
  echo "        type: double"
  echo "        example: 1.0"
  echo "        seedSearchStartLmax normalized to read length (sum of mates' lengths for"
  echo "        paired-end reads)"
  echo ""
  echo "    --seedSearchLmax"
  echo "        type: integer"
  echo "        example: 0"
  echo "        defines the maximum length of the seeds, if =0 seed length is not"
  echo "        limited"
  echo ""
  echo "    --seedMultimapNmax"
  echo "        type: integer"
  echo "        example: 10000"
  echo "        only pieces that map fewer than this value are utilized in the stitching"
  echo "        procedure"
  echo ""
  echo "    --seedPerReadNmax"
  echo "        type: integer"
  echo "        example: 1000"
  echo "        max number of seeds per read"
  echo ""
  echo "    --seedPerWindowNmax"
  echo "        type: integer"
  echo "        example: 50"
  echo "        max number of seeds per window"
  echo ""
  echo "    --seedNoneLociPerWindow"
  echo "        type: integer"
  echo "        example: 10"
  echo "        max number of one seed loci per window"
  echo ""
  echo "    --seedSplitMin"
  echo "        type: integer"
  echo "        example: 12"
  echo "        min length of the seed sequences split by Ns or mate gap"
  echo ""
  echo "    --seedMapMin"
  echo "        type: integer"
  echo "        example: 5"
  echo "        min length of seeds to be mapped"
  echo ""
  echo "    --alignIntronMin"
  echo "        type: integer"
  echo "        example: 21"
  echo "        minimum intron size, genomic gap is considered intron if its"
  echo "        length>=alignIntronMin, otherwise it is considered Deletion"
  echo ""
  echo "    --alignIntronMax"
  echo "        type: integer"
  echo "        example: 0"
  echo "        maximum intron size, if 0, max intron size will be determined by"
  echo "        (2^winBinNbits)*winAnchorDistNbins"
  echo ""
  echo "    --alignMatesGapMax"
  echo "        type: integer"
  echo "        example: 0"
  echo "        maximum gap between two mates, if 0, max intron gap will be determined"
  echo "        by (2^winBinNbits)*winAnchorDistNbins"
  echo ""
  echo "    --alignSJoverhangMin"
  echo "        type: integer"
  echo "        example: 5"
  echo "        minimum overhang (i.e. block size) for spliced alignments"
  echo ""
  echo "    --alignSJstitchMismatchNmax"
  echo "        type: integer, multiple values allowed"
  echo "        example: 0;-1;0;0"
  echo "        maximum number of mismatches for stitching of the splice junctions (-1:"
  echo "        no limit)."
  echo "        (1) non-canonical motifs, (2) GT/AG and CT/AC motif, (3) GC/AG and CT/GC"
  echo "        motif, (4) AT/AC and GT/AT motif."
  echo ""
  echo "    --alignSJDBoverhangMin"
  echo "        type: integer"
  echo "        example: 3"
  echo "        minimum overhang (i.e. block size) for annotated (sjdb) spliced"
  echo "        alignments"
  echo ""
  echo "    --alignSplicedMateMapLmin"
  echo "        type: integer"
  echo "        example: 0"
  echo "        minimum mapped length for a read mate that is spliced"
  echo ""
  echo "    --alignSplicedMateMapLminOverLmate"
  echo "        type: double"
  echo "        example: 0.66"
  echo "        alignSplicedMateMapLmin normalized to mate length"
  echo ""
  echo "    --alignWindowsPerReadNmax"
  echo "        type: integer"
  echo "        example: 10000"
  echo "        max number of windows per read"
  echo ""
  echo "    --alignTranscriptsPerWindowNmax"
  echo "        type: integer"
  echo "        example: 100"
  echo "        max number of transcripts per window"
  echo ""
  echo "    --alignTranscriptsPerReadNmax"
  echo "        type: integer"
  echo "        example: 10000"
  echo "        max number of different alignments per read to consider"
  echo ""
  echo "    --alignEndsType"
  echo "        type: string"
  echo "        example: Local"
  echo "        type of read ends alignment"
  echo "        - Local             ... standard local alignment with soft-clipping"
  echo "        allowed"
  echo "        - EndToEnd          ... force end-to-end read alignment, do not"
  echo "        soft-clip"
  echo "        - Extend5pOfRead1   ... fully extend only the 5p of the read1, all other"
  echo "        ends: local alignment"
  echo "        - Extend5pOfReads12 ... fully extend only the 5p of the both read1 and"
  echo "        read2, all other ends: local alignment"
  echo ""
  echo "    --alignEndsProtrude"
  echo "        type: string"
  echo "        example: 0    ConcordantPair"
  echo "        allow protrusion of alignment ends, i.e. start (end) of the +strand mate"
  echo "        downstream of the start (end) of the -strand mate"
  echo "        1st word: int: maximum number of protrusion bases allowed"
  echo "        2nd word: string:"
  echo "        -                     ConcordantPair ... report alignments with non-zero"
  echo "        protrusion as concordant pairs"
  echo "        -                     DiscordantPair ... report alignments with non-zero"
  echo "        protrusion as discordant pairs"
  echo ""
  echo "    --alignSoftClipAtReferenceEnds"
  echo "        type: string"
  echo "        example: Yes"
  echo "        allow the soft-clipping of the alignments past the end of the"
  echo "        chromosomes"
  echo "        - Yes ... allow"
  echo "        - No  ... prohibit, useful for compatibility with Cufflinks"
  echo ""
  echo "    --alignInsertionFlush"
  echo "        type: string"
  echo "        how to flush ambiguous insertion positions"
  echo "        - None    ... insertions are not flushed"
  echo "        - Right   ... insertions are flushed to the right"
  echo ""
  echo "Paired-End reads:"
  echo "    --peOverlapNbasesMin"
  echo "        type: integer"
  echo "        example: 0"
  echo "        minimum number of overlapping bases to trigger mates merging and"
  echo "        realignment. Specify >0 value to switch on the \"merginf of overlapping"
  echo "        mates\" algorithm."
  echo ""
  echo "    --peOverlapMMp"
  echo "        type: double"
  echo "        example: 0.01"
  echo "        maximum proportion of mismatched bases in the overlap area"
  echo ""
  echo "Windows, Anchors, Binning:"
  echo "    --winAnchorMultimapNmax"
  echo "        type: integer"
  echo "        example: 50"
  echo "        max number of loci anchors are allowed to map to"
  echo ""
  echo "    --winBinNbits"
  echo "        type: integer"
  echo "        example: 16"
  echo "        =log2(winBin), where winBin is the size of the bin for the"
  echo "        windows/clustering, each window will occupy an integer number of bins."
  echo ""
  echo "    --winAnchorDistNbins"
  echo "        type: integer"
  echo "        example: 9"
  echo "        max number of bins between two anchors that allows aggregation of"
  echo "        anchors into one window"
  echo ""
  echo "    --winFlankNbins"
  echo "        type: integer"
  echo "        example: 4"
  echo "        log2(winFlank), where win Flank is the size of the left and right"
  echo "        flanking regions for each window"
  echo ""
  echo "    --winReadCoverageRelativeMin"
  echo "        type: double"
  echo "        example: 0.5"
  echo "        minimum relative coverage of the read sequence by the seeds in a window,"
  echo "        for STARlong algorithm only."
  echo ""
  echo "    --winReadCoverageBasesMin"
  echo "        type: integer"
  echo "        example: 0"
  echo "        minimum number of bases covered by the seeds in a window , for STARlong"
  echo "        algorithm only."
  echo ""
  echo "Chimeric Alignments:"
  echo "    --chimOutType"
  echo "        type: string, multiple values allowed"
  echo "        example: Junctions"
  echo "        type of chimeric output"
  echo "        - Junctions       ... Chimeric.out.junction"
  echo "        - SeparateSAMold  ... output old SAM into separate Chimeric.out.sam file"
  echo "        - WithinBAM       ... output into main aligned BAM files (Aligned.*.bam)"
  echo "        - WithinBAM HardClip  ... (default) hard-clipping in the CIGAR for"
  echo "        supplemental chimeric alignments (default if no 2nd word is present)"
  echo "        - WithinBAM SoftClip  ... soft-clipping in the CIGAR for supplemental"
  echo "        chimeric alignments"
  echo ""
  echo "    --chimSegmentMin"
  echo "        type: integer"
  echo "        example: 0"
  echo "        minimum length of chimeric segment length, if ==0, no chimeric output"
  echo ""
  echo "    --chimScoreMin"
  echo "        type: integer"
  echo "        example: 0"
  echo "        minimum total (summed) score of the chimeric segments"
  echo ""
  echo "    --chimScoreDropMax"
  echo "        type: integer"
  echo "        example: 20"
  echo "        max drop (difference) of chimeric score (the sum of scores of all"
  echo "        chimeric segments) from the read length"
  echo ""
  echo "    --chimScoreSeparation"
  echo "        type: integer"
  echo "        example: 10"
  echo "        minimum difference (separation) between the best chimeric score and the"
  echo "        next one"
  echo ""
  echo "    --chimScoreJunctionNonGTAG"
  echo "        type: integer"
  echo "        example: -1"
  echo "        penalty for a non-GT/AG chimeric junction"
  echo ""
  echo "    --chimJunctionOverhangMin"
  echo "        type: integer"
  echo "        example: 20"
  echo "        minimum overhang for a chimeric junction"
  echo ""
  echo "    --chimSegmentReadGapMax"
  echo "        type: integer"
  echo "        example: 0"
  echo "        maximum gap in the read sequence between chimeric segments"
  echo ""
  echo "    --chimFilter"
  echo "        type: string, multiple values allowed"
  echo "        example: banGenomicN"
  echo "        different filters for chimeric alignments"
  echo "        - None ... no filtering"
  echo "        - banGenomicN ... Ns are not allowed in the genome sequence around the"
  echo "        chimeric junction"
  echo ""
  echo "    --chimMainSegmentMultNmax"
  echo "        type: integer"
  echo "        example: 10"
  echo "        maximum number of multi-alignments for the main chimeric segment. =1"
  echo "        will prohibit multimapping main segments."
  echo ""
  echo "    --chimMultimapNmax"
  echo "        type: integer"
  echo "        example: 0"
  echo "        maximum number of chimeric multi-alignments"
  echo "        - 0 ... use the old scheme for chimeric detection which only considered"
  echo "        unique alignments"
  echo ""
  echo "    --chimMultimapScoreRange"
  echo "        type: integer"
  echo "        example: 1"
  echo "        the score range for multi-mapping chimeras below the best chimeric"
  echo "        score. Only works with --chimMultimapNmax > 1"
  echo ""
  echo "    --chimNonchimScoreDropMin"
  echo "        type: integer"
  echo "        example: 20"
  echo "        to trigger chimeric detection, the drop in the best non-chimeric"
  echo "        alignment score with respect to the read length has to be greater than"
  echo "        this value"
  echo ""
  echo "    --chimOutJunctionFormat"
  echo "        type: integer"
  echo "        example: 0"
  echo "        formatting type for the Chimeric.out.junction file"
  echo "        - 0 ... no comment lines/headers"
  echo "        - 1 ... comment lines at the end of the file: command line and Nreads:"
  echo "        total, unique/multi-mapping"
  echo ""
  echo "Quantification of Annotations:"
  echo "    --quantMode"
  echo "        type: string, multiple values allowed"
  echo "        types of quantification requested"
  echo "        - -                ... none"
  echo "        - TranscriptomeSAM ... output SAM/BAM alignments to transcriptome into a"
  echo "        separate file"
  echo "        - GeneCounts       ... count reads per gene"
  echo ""
  echo "    --quantTranscriptomeBAMcompression"
  echo "        type: integer"
  echo "        example: 1"
  echo "        -2 to 10  transcriptome BAM compression level"
  echo "        - -2  ... no BAM output"
  echo "        - -1  ... default compression (6?)"
  echo "        -  0  ... no compression"
  echo "        -  10 ... maximum compression"
  echo ""
  echo "    --quantTranscriptomeBan"
  echo "        type: string"
  echo "        example: IndelSoftclipSingleend"
  echo "        prohibit various alignment type"
  echo "        - IndelSoftclipSingleend  ... prohibit indels, soft clipping and"
  echo "        single-end alignments - compatible with RSEM"
  echo "        - Singleend               ... prohibit single-end alignments"
  echo ""
  echo "2-pass Mapping:"
  echo "    --twopassMode"
  echo "        type: string"
  echo "        2-pass mapping mode."
  echo "        - None        ... 1-pass mapping"
  echo "        - Basic       ... basic 2-pass mapping, with all 1st pass junctions"
  echo "        inserted into the genome indices on the fly"
  echo ""
  echo "    --twopass1readsN"
  echo "        type: integer"
  echo "        example: -1"
  echo "        number of reads to process for the 1st step. Use very large number (or"
  echo "        default -1) to map all reads in the first step."
  echo ""
  echo "WASP parameters:"
  echo "    --waspOutputMode"
  echo "        type: string"
  echo "        WASP allele-specific output type. This is re-implementation of the"
  echo "        original WASP mappability filtering by Bryce van de Geijn, Graham"
  echo "        McVicker, Yoav Gilad & Jonathan K Pritchard. Please cite the original"
  echo "        WASP paper: Nature Methods 12, 1061-1063 (2015),"
  echo "        https://www.nature.com/articles/nmeth.3582 ."
  echo "        - SAMtag      ... add WASP tags to the alignments that pass WASP"
  echo "        filtering"
  echo ""
  echo "STARsolo (single cell RNA-seq) parameters:"
  echo "    --soloType"
  echo "        type: string, multiple values allowed"
  echo "        type of single-cell RNA-seq"
  echo "        - CB_UMI_Simple   ... (a.k.a. Droplet) one UMI and one Cell Barcode of"
  echo "        fixed length in read2, e.g. Drop-seq and 10X Chromium."
  echo "        - CB_UMI_Complex  ... multiple Cell Barcodes of varying length, one UMI"
  echo "        of fixed length and one adapter sequence of fixed length are allowed in"
  echo "        read2 only (e.g. inDrop, ddSeq)."
  echo "        - CB_samTagOut    ... output Cell Barcode as CR and/or CB SAm tag. No"
  echo "        UMI counting. --readFilesIn cDNA_read1 [cDNA_read2 if paired-end]"
  echo "        CellBarcode_read . Requires --outSAMtype BAM Unsorted [and/or"
  echo "        SortedByCoordinate]"
  echo "        - SmartSeq        ... Smart-seq: each cell in a separate FASTQ (paired-"
  echo "        or single-end), barcodes are corresponding read-groups, no UMI"
  echo "        sequences, alignments deduplicated according to alignment start and end"
  echo "        (after extending soft-clipped bases)"
  echo ""
  echo "    --soloCBwhitelist"
  echo "        type: string, multiple values allowed"
  echo "        file(s) with whitelist(s) of cell barcodes. Only --soloType"
  echo "        CB_UMI_Complex allows more than one whitelist file."
  echo "        - None            ... no whitelist: all cell barcodes are allowed"
  echo ""
  echo "    --soloCBstart"
  echo "        type: integer"
  echo "        example: 1"
  echo "        cell barcode start base"
  echo ""
  echo "    --soloCBlen"
  echo "        type: integer"
  echo "        example: 16"
  echo "        cell barcode length"
  echo ""
  echo "    --soloUMIstart"
  echo "        type: integer"
  echo "        example: 17"
  echo "        UMI start base"
  echo ""
  echo "    --soloUMIlen"
  echo "        type: integer"
  echo "        example: 10"
  echo "        UMI length"
  echo ""
  echo "    --soloBarcodeReadLength"
  echo "        type: integer"
  echo "        example: 1"
  echo "        length of the barcode read"
  echo "        - 1   ... equal to sum of soloCBlen+soloUMIlen"
  echo "        - 0   ... not defined, do not check"
  echo ""
  echo "    --soloBarcodeMate"
  echo "        type: integer"
  echo "        example: 0"
  echo "        identifies which read mate contains the barcode (CB+UMI) sequence"
  echo "        - 0   ... barcode sequence is on separate read, which should always be"
  echo "        the last file in the --readFilesIn listed"
  echo "        - 1   ... barcode sequence is a part of mate 1"
  echo "        - 2   ... barcode sequence is a part of mate 2"
  echo ""
  echo "    --soloCBposition"
  echo "        type: string, multiple values allowed"
  echo "        position of Cell Barcode(s) on the barcode read."
  echo "        Presently only works with --soloType CB_UMI_Complex, and barcodes are"
  echo "        assumed to be on Read2."
  echo "        Format for each barcode: startAnchor_startPosition_endAnchor_endPosition"
  echo "        start(end)Anchor defines the Anchor Base for the CB: 0: read start; 1:"
  echo "        read end; 2: adapter start; 3: adapter end"
  echo "        start(end)Position is the 0-based position with of the CB start(end)"
  echo "        with respect to the Anchor Base"
  echo "        String for different barcodes are separated by space."
  echo "        Example: inDrop (Zilionis et al, Nat. Protocols, 2017):"
  echo "        --soloCBposition  0_0_2_-1  3_1_3_8"
  echo ""
  echo "    --soloUMIposition"
  echo "        type: string"
  echo "        position of the UMI on the barcode read, same as soloCBposition"
  echo "        Example: inDrop (Zilionis et al, Nat. Protocols, 2017):"
  echo "        --soloCBposition  3_9_3_14"
  echo ""
  echo "    --soloAdapterSequence"
  echo "        type: string"
  echo "        adapter sequence to anchor barcodes. Only one adapter sequence is"
  echo "        allowed."
  echo ""
  echo "    --soloAdapterMismatchesNmax"
  echo "        type: integer"
  echo "        example: 1"
  echo "        maximum number of mismatches allowed in adapter sequence."
  echo ""
  echo "    --soloCBmatchWLtype"
  echo "        type: string"
  echo "        example: 1MM_multi"
  echo "        matching the Cell Barcodes to the WhiteList"
  echo "        - Exact                           ... only exact matches allowed"
  echo "        - 1MM                             ... only one match in whitelist with 1"
  echo "        mismatched base allowed. Allowed CBs have to have at least one read with"
  echo "        exact match."
  echo "        - 1MM_multi                       ... multiple matches in whitelist with"
  echo "        1 mismatched base allowed, posterior probability calculation is used"
  echo "        choose one of the matches."
  echo "        Allowed CBs have to have at least one read with exact match. This option"
  echo "        matches best with CellRanger 2.2.0"
  echo "        - 1MM_multi_pseudocounts          ... same as 1MM_Multi, but"
  echo "        pseudocounts of 1 are added to all whitelist barcodes."
  echo "        - 1MM_multi_Nbase_pseudocounts    ... same as 1MM_multi_pseudocounts,"
  echo "        multimatching to WL is allowed for CBs with N-bases. This option matches"
  echo "        best with CellRanger >= 3.0.0"
  echo "        - EditDist_2                    ... allow up to edit distance of 3 fpr"
  echo "        each of the barcodes. May include one deletion + one insertion. Only"
  echo "        works with --soloType CB_UMI_Complex. Matches to multiple passlist"
  echo "        barcdoes are not allowed. Similar to ParseBio Split-seq pipeline."
  echo ""
  echo "    --soloInputSAMattrBarcodeSeq"
  echo "        type: string, multiple values allowed"
  echo "        when inputting reads from a SAM file (--readsFileType SAM SE/PE), these"
  echo "        SAM attributes mark the barcode sequence (in proper order)."
  echo "        For instance, for 10X CellRanger or STARsolo BAMs, use"
  echo "        --soloInputSAMattrBarcodeSeq CR UR ."
  echo "        This parameter is required when running STARsolo with input from SAM."
  echo ""
  echo "    --soloInputSAMattrBarcodeQual"
  echo "        type: string, multiple values allowed"
  echo "        when inputting reads from a SAM file (--readsFileType SAM SE/PE), these"
  echo "        SAM attributes mark the barcode qualities (in proper order)."
  echo "        For instance, for 10X CellRanger or STARsolo BAMs, use"
  echo "        --soloInputSAMattrBarcodeQual CY UY ."
  echo "        If this parameter is '-' (default), the quality 'H' will be assigned to"
  echo "        all bases."
  echo ""
  echo "    --soloStrand"
  echo "        type: string"
  echo "        example: Forward"
  echo "        strandedness of the solo libraries:"
  echo "        - Unstranded  ... no strand information"
  echo "        - Forward     ... read strand same as the original RNA molecule"
  echo "        - Reverse     ... read strand opposite to the original RNA molecule"
  echo ""
  echo "    --soloFeatures"
  echo "        type: string, multiple values allowed"
  echo "        example: Gene"
  echo "        genomic features for which the UMI counts per Cell Barcode are collected"
  echo "        - Gene            ... genes: reads match the gene transcript"
  echo "        - SJ              ... splice junctions: reported in SJ.out.tab"
  echo "        - GeneFull        ... full gene (pre-mRNA): count all reads overlapping"
  echo "        genes' exons and introns"
  echo "        - GeneFull_ExonOverIntron ... full gene (pre-mRNA): count all reads"
  echo "        overlapping genes' exons and introns: prioritize 100% overlap with exons"
  echo "        - GeneFull_Ex50pAS        ... full gene (pre-RNA): count all reads"
  echo "        overlapping genes' exons and introns: prioritize >50% overlap with"
  echo "        exons. Do not count reads with 100% exonic overlap in the antisense"
  echo "        direction."
  echo ""
  echo "    --soloMultiMappers"
  echo "        type: string, multiple values allowed"
  echo "        example: Unique"
  echo "        counting method for reads mapping to multiple genes"
  echo "        - Unique     ... count only reads that map to unique genes"
  echo "        - Uniform    ... uniformly distribute multi-genic UMIs to all genes"
  echo "        - Rescue     ... distribute UMIs proportionally to unique+uniform counts"
  echo "        (~ first iteration of EM)"
  echo "        - PropUnique ... distribute UMIs proportionally to unique mappers, if"
  echo "        present, and uniformly if not."
  echo "        - EM         ... multi-gene UMIs are distributed using Expectation"
  echo "        Maximization algorithm"
  echo ""
  echo "    --soloUMIdedup"
  echo "        type: string, multiple values allowed"
  echo "        example: 1MM_All"
  echo "        type of UMI deduplication (collapsing) algorithm"
  echo "        - 1MM_All                     ... all UMIs with 1 mismatch distance to"
  echo "        each other are collapsed (i.e. counted once)."
  echo "        - 1MM_Directional_UMItools    ... follows the \"directional\" method from"
  echo "        the UMI-tools by Smith, Heger and Sudbery (Genome Research 2017)."
  echo "        - 1MM_Directional             ... same as 1MM_Directional_UMItools, but"
  echo "        with more stringent criteria for duplicate UMIs"
  echo "        - Exact                       ... only exactly matching UMIs are"
  echo "        collapsed."
  echo "        - NoDedup                     ... no deduplication of UMIs, count all"
  echo "        reads."
  echo "        - 1MM_CR                      ... CellRanger2-4 algorithm for 1MM UMI"
  echo "        collapsing."
  echo ""
  echo "    --soloUMIfiltering"
  echo "        type: string, multiple values allowed"
  echo "        type of UMI filtering (for reads uniquely mapping to genes)"
  echo "        - -                  ... basic filtering: remove UMIs with N and"
  echo "        homopolymers (similar to CellRanger 2.2.0)."
  echo "        - MultiGeneUMI       ... basic + remove lower-count UMIs that map to"
  echo "        more than one gene."
  echo "        - MultiGeneUMI_All   ... basic + remove all UMIs that map to more than"
  echo "        one gene."
  echo "        - MultiGeneUMI_CR    ... basic + remove lower-count UMIs that map to"
  echo "        more than one gene, matching CellRanger > 3.0.0 ."
  echo "        Only works with --soloUMIdedup 1MM_CR"
  echo ""
  echo "    --soloOutFileNames"
  echo "        type: string, multiple values allowed"
  echo "        example: Solo.out/;features.tsv;barcodes.tsv;matrix.mtx"
  echo "        file names for STARsolo output:"
  echo "        file_name_prefix   gene_names   barcode_sequences"
  echo "        cell_feature_count_matrix"
  echo ""
  echo "    --soloCellFilter"
  echo "        type: string, multiple values allowed"
  echo "        example: CellRanger2.2;3000;0.99;10"
  echo "        cell filtering type and parameters"
  echo "        - None            ... do not output filtered cells"
  echo "        - TopCells        ... only report top cells by UMI count, followed by"
  echo "        the exact number of cells"
  echo "        - CellRanger2.2   ... simple filtering of CellRanger 2.2."
  echo "        Can be followed by numbers: number of expected cells, robust maximum"
  echo "        percentile for UMI count, maximum to minimum ratio for UMI count"
  echo "        The harcoded values are from CellRanger: nExpectedCells=3000;"
  echo "        maxPercentile=0.99;  maxMinRatio=10"
  echo "        - EmptyDrops_CR   ... EmptyDrops filtering in CellRanger flavor. Please"
  echo "        cite the original EmptyDrops paper: A.T.L Lun et al, Genome Biology, 20,"
  echo "        63 (2019):"
  echo "       "
  echo "https://genomebiology.biomedcentral.com/articles/10.1186/s13059-019-1662-y"
  echo "        Can be followed by 10 numeric parameters:  nExpectedCells"
  echo "        maxPercentile   maxMinRatio   indMin   indMax   umiMin"
  echo "        umiMinFracMedian   candMaxN   FDR   simN"
  echo "        The harcoded values are from CellRanger:             3000"
  echo "        0.99            10    45000    90000      500               0.01"
  echo "        20000  0.01  10000"
  echo ""
  echo "    --soloOutFormatFeaturesGeneField3"
  echo "        type: string, multiple values allowed"
  echo "        example: Gene Expression"
  echo "        field 3 in the Gene features.tsv file. If \"-\", then no 3rd field is"
  echo "        output."
  echo ""
  echo "    --soloCellReadStats"
  echo "        type: string"
  echo "        Output reads statistics for each CB"
  echo "        - Standard    ... standard output"
  echo ""
  echo "HTSeq arguments:"
  echo "    -s, --stranded"
  echo "        type: string"
  echo "        default: yes"
  echo "        choices: [ yes, no, reverse ]"
  echo "        Whether the data is from a strand-specific assay. 'reverse' means 'yes'"
  echo "        with reversed strand interpretation."
  echo ""
  echo "    -a, --minaqual, --minimum_alignment_quality"
  echo "        type: integer"
  echo "        default: 10"
  echo "        Skip all reads with MAPQ alignment quality lower than the given minimum"
  echo "        value."
  echo "        MAPQ is the 5th column of a SAM/BAM file and its usage depends on the"
  echo "        software"
  echo "        used to map the reads."
  echo ""
  echo "    -t, --type"
  echo "        type: string"
  echo "        example: exon"
  echo "        Feature type (3rd column in GTF file) to be used, all features of other"
  echo "        type are ignored (default, suitable for Ensembl GTF files: exon)"
  echo ""
  echo "    -i, --id_attribute"
  echo "        type: string, multiple values allowed"
  echo "        example: gene_id"
  echo "        GTF attribute to be used as feature ID (default, suitable for Ensembl"
  echo "        GTF files: gene_id)."
  echo "        All feature of the right type (see -t option) within the same GTF"
  echo "        attribute will be added"
  echo "        together. The typical way of using this option is to count all exonic"
  echo "        reads from each gene"
  echo "        and add the exons but other uses are possible as well. You can call this"
  echo "        option multiple"
  echo "        times: in that case, the combination of all attributes separated by"
  echo "        colons (:) will be used"
  echo "        as a unique identifier, e.g. for exons you might use -i gene_id -i"
  echo "        exon_number."
  echo ""
  echo "    --additional_attributes"
  echo "        type: string, multiple values allowed"
  echo "        example: gene_name"
  echo "        Additional feature attributes (suitable for Ensembl GTF files:"
  echo "        gene_name). Use multiple times"
  echo "        for more than one additional attribute. These attributes are only used"
  echo "        as annotations in the"
  echo "        output, while the determination of how the counts are added together is"
  echo "        done based on option -i."
  echo ""
  echo "    --add_chromosome_info"
  echo "        type: boolean_true"
  echo "        Store information about the chromosome of each feature as an additional"
  echo "        attribute"
  echo "        (e.g. colunm in the TSV output file)."
  echo ""
  echo "    -m, --mode"
  echo "        type: string"
  echo "        default: union"
  echo "        choices: [ union, intersection-strict, intersection-nonempty ]"
  echo "        Mode to handle reads overlapping more than one feature."
  echo ""
  echo "    --non_unique"
  echo "        type: string"
  echo "        default: none"
  echo "        choices: [ none, all, fraction, random ]"
  echo "        Whether and how to score reads that are not uniquely aligned or"
  echo "        ambiguously assigned to features."
  echo ""
  echo "    --secondary_alignments"
  echo "        type: string"
  echo "        choices: [ score, ignore ]"
  echo "        Whether to score secondary alignments (0x100 flag)."
  echo ""
  echo "    --supplementary_alignments"
  echo "        type: string"
  echo "        choices: [ score, ignore ]"
  echo "        Whether to score supplementary alignments (0x800 flag)."
  echo ""
  echo "    --counts_output_sparse"
  echo "        type: boolean_true"
  echo "        Store the counts as a sparse matrix (mtx, h5ad, loom)."
  echo ""
  echo "Viash built in Computational Requirements:"
  echo "    ---cpus=INT"
  echo "        Number of CPUs to use"
  echo "    ---memory=STRING"
  echo "        Amount of memory to use. Examples: 4GB, 3MiB."
  echo ""
  echo "Viash built in Docker:"
  echo "    ---setup=STRATEGY"
  echo "        Setup the docker container. Options are: alwaysbuild, alwayscachedbuild, ifneedbebuild, ifneedbecachedbuild, alwayspull, alwayspullelsebuild, alwayspullelsecachedbuild, ifneedbepull, ifneedbepullelsebuild, ifneedbepullelsecachedbuild, push, pushifnotpresent, donothing."
  echo "        Default: ifneedbepullelsecachedbuild"
  echo "    ---dockerfile"
  echo "        Print the dockerfile to stdout."
  echo "    ---docker_run_args=ARG"
  echo "        Provide runtime arguments to Docker. See the documentation on \`docker run\` for more information."
  echo "    ---docker_image_id"
  echo "        Print the docker image id to stdout."
  echo "    ---debug"
  echo "        Enter the docker container for debugging purposes."
  echo ""
  echo "Viash built in Engines:"
  echo "    ---engine=ENGINE_ID"
  echo "        Specify the engine to use. Options are: docker, native."
  echo "        Default: docker"
}

# 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 "multi_star v4.0.2"
            exit
            ;;
        --input_id)
            if [ -z "$VIASH_PAR_INPUT_ID" ]; then
              VIASH_PAR_INPUT_ID="$2"
            else
              VIASH_PAR_INPUT_ID="$VIASH_PAR_INPUT_ID;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --input_id. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --input_id=*)
            if [ -z "$VIASH_PAR_INPUT_ID" ]; then
              VIASH_PAR_INPUT_ID=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_INPUT_ID="$VIASH_PAR_INPUT_ID;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --input_r1)
            if [ -z "$VIASH_PAR_INPUT_R1" ]; then
              VIASH_PAR_INPUT_R1="$2"
            else
              VIASH_PAR_INPUT_R1="$VIASH_PAR_INPUT_R1;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --input_r1. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --input_r1=*)
            if [ -z "$VIASH_PAR_INPUT_R1" ]; then
              VIASH_PAR_INPUT_R1=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_INPUT_R1="$VIASH_PAR_INPUT_R1;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --input_r2)
            if [ -z "$VIASH_PAR_INPUT_R2" ]; then
              VIASH_PAR_INPUT_R2="$2"
            else
              VIASH_PAR_INPUT_R2="$VIASH_PAR_INPUT_R2;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --input_r2. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --input_r2=*)
            if [ -z "$VIASH_PAR_INPUT_R2" ]; then
              VIASH_PAR_INPUT_R2=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_INPUT_R2="$VIASH_PAR_INPUT_R2;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --reference_index)
            [ -n "$VIASH_PAR_REFERENCE_INDEX" ] && ViashError Bad arguments for option \'--reference_index\': \'$VIASH_PAR_REFERENCE_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_REFERENCE_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --reference_index. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --reference_index=*)
            [ -n "$VIASH_PAR_REFERENCE_INDEX" ] && ViashError Bad arguments for option \'--reference_index=*\': \'$VIASH_PAR_REFERENCE_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_REFERENCE_INDEX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --genomeDir)
            [ -n "$VIASH_PAR_REFERENCE_INDEX" ] && ViashError Bad arguments for option \'--genomeDir\': \'$VIASH_PAR_REFERENCE_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_REFERENCE_INDEX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --genomeDir. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --reference_gtf)
            [ -n "$VIASH_PAR_REFERENCE_GTF" ] && ViashError Bad arguments for option \'--reference_gtf\': \'$VIASH_PAR_REFERENCE_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_REFERENCE_GTF="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --reference_gtf. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --reference_gtf=*)
            [ -n "$VIASH_PAR_REFERENCE_GTF" ] && ViashError Bad arguments for option \'--reference_gtf=*\': \'$VIASH_PAR_REFERENCE_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_REFERENCE_GTF=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --output)
            [ -n "$VIASH_PAR_OUTPUT" ] && ViashError Bad arguments for option \'--output\': \'$VIASH_PAR_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --output. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --output=*)
            [ -n "$VIASH_PAR_OUTPUT" ] && ViashError Bad arguments for option \'--output=*\': \'$VIASH_PAR_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFileNamePrefix)
            [ -n "$VIASH_PAR_OUTPUT" ] && ViashError Bad arguments for option \'--outFileNamePrefix\': \'$VIASH_PAR_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTPUT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFileNamePrefix. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --run_htseq_count)
            [ -n "$VIASH_PAR_RUN_HTSEQ_COUNT" ] && ViashError Bad arguments for option \'--run_htseq_count\': \'$VIASH_PAR_RUN_HTSEQ_COUNT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RUN_HTSEQ_COUNT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --run_htseq_count. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --run_htseq_count=*)
            [ -n "$VIASH_PAR_RUN_HTSEQ_COUNT" ] && ViashError Bad arguments for option \'--run_htseq_count=*\': \'$VIASH_PAR_RUN_HTSEQ_COUNT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RUN_HTSEQ_COUNT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --run_multiqc)
            [ -n "$VIASH_PAR_RUN_MULTIQC" ] && ViashError Bad arguments for option \'--run_multiqc\': \'$VIASH_PAR_RUN_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RUN_MULTIQC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --run_multiqc. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --run_multiqc=*)
            [ -n "$VIASH_PAR_RUN_MULTIQC" ] && ViashError Bad arguments for option \'--run_multiqc=*\': \'$VIASH_PAR_RUN_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RUN_MULTIQC=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --min_success_rate)
            [ -n "$VIASH_PAR_MIN_SUCCESS_RATE" ] && ViashError Bad arguments for option \'--min_success_rate\': \'$VIASH_PAR_MIN_SUCCESS_RATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MIN_SUCCESS_RATE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --min_success_rate. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --min_success_rate=*)
            [ -n "$VIASH_PAR_MIN_SUCCESS_RATE" ] && ViashError Bad arguments for option \'--min_success_rate=*\': \'$VIASH_PAR_MIN_SUCCESS_RATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MIN_SUCCESS_RATE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --runRNGseed)
            [ -n "$VIASH_PAR_RUNRNGSEED" ] && ViashError Bad arguments for option \'--runRNGseed\': \'$VIASH_PAR_RUNRNGSEED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RUNRNGSEED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --runRNGseed. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --runRNGseed=*)
            [ -n "$VIASH_PAR_RUNRNGSEED" ] && ViashError Bad arguments for option \'--runRNGseed=*\': \'$VIASH_PAR_RUNRNGSEED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_RUNRNGSEED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --genomeFastaFiles)
            if [ -z "$VIASH_PAR_GENOMEFASTAFILES" ]; then
              VIASH_PAR_GENOMEFASTAFILES="$2"
            else
              VIASH_PAR_GENOMEFASTAFILES="$VIASH_PAR_GENOMEFASTAFILES;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --genomeFastaFiles. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --genomeFastaFiles=*)
            if [ -z "$VIASH_PAR_GENOMEFASTAFILES" ]; then
              VIASH_PAR_GENOMEFASTAFILES=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_GENOMEFASTAFILES="$VIASH_PAR_GENOMEFASTAFILES;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --sjdbFileChrStartEnd)
            if [ -z "$VIASH_PAR_SJDBFILECHRSTARTEND" ]; then
              VIASH_PAR_SJDBFILECHRSTARTEND="$2"
            else
              VIASH_PAR_SJDBFILECHRSTARTEND="$VIASH_PAR_SJDBFILECHRSTARTEND;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbFileChrStartEnd. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sjdbFileChrStartEnd=*)
            if [ -z "$VIASH_PAR_SJDBFILECHRSTARTEND" ]; then
              VIASH_PAR_SJDBFILECHRSTARTEND=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SJDBFILECHRSTARTEND="$VIASH_PAR_SJDBFILECHRSTARTEND;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --sjdbGTFfile)
            [ -n "$VIASH_PAR_SJDBGTFFILE" ] && ViashError Bad arguments for option \'--sjdbGTFfile\': \'$VIASH_PAR_SJDBGTFFILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBGTFFILE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFfile. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sjdbGTFfile=*)
            [ -n "$VIASH_PAR_SJDBGTFFILE" ] && ViashError Bad arguments for option \'--sjdbGTFfile=*\': \'$VIASH_PAR_SJDBGTFFILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBGTFFILE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sjdbGTFchrPrefix)
            [ -n "$VIASH_PAR_SJDBGTFCHRPREFIX" ] && ViashError Bad arguments for option \'--sjdbGTFchrPrefix\': \'$VIASH_PAR_SJDBGTFCHRPREFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBGTFCHRPREFIX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFchrPrefix. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sjdbGTFchrPrefix=*)
            [ -n "$VIASH_PAR_SJDBGTFCHRPREFIX" ] && ViashError Bad arguments for option \'--sjdbGTFchrPrefix=*\': \'$VIASH_PAR_SJDBGTFCHRPREFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBGTFCHRPREFIX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sjdbGTFfeatureExon)
            [ -n "$VIASH_PAR_SJDBGTFFEATUREEXON" ] && ViashError Bad arguments for option \'--sjdbGTFfeatureExon\': \'$VIASH_PAR_SJDBGTFFEATUREEXON\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBGTFFEATUREEXON="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFfeatureExon. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sjdbGTFfeatureExon=*)
            [ -n "$VIASH_PAR_SJDBGTFFEATUREEXON" ] && ViashError Bad arguments for option \'--sjdbGTFfeatureExon=*\': \'$VIASH_PAR_SJDBGTFFEATUREEXON\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBGTFFEATUREEXON=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sjdbGTFtagExonParentTranscript)
            [ -n "$VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT" ] && ViashError Bad arguments for option \'--sjdbGTFtagExonParentTranscript\': \'$VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFtagExonParentTranscript. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sjdbGTFtagExonParentTranscript=*)
            [ -n "$VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT" ] && ViashError Bad arguments for option \'--sjdbGTFtagExonParentTranscript=*\': \'$VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sjdbGTFtagExonParentGene)
            [ -n "$VIASH_PAR_SJDBGTFTAGEXONPARENTGENE" ] && ViashError Bad arguments for option \'--sjdbGTFtagExonParentGene\': \'$VIASH_PAR_SJDBGTFTAGEXONPARENTGENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBGTFTAGEXONPARENTGENE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFtagExonParentGene. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sjdbGTFtagExonParentGene=*)
            [ -n "$VIASH_PAR_SJDBGTFTAGEXONPARENTGENE" ] && ViashError Bad arguments for option \'--sjdbGTFtagExonParentGene=*\': \'$VIASH_PAR_SJDBGTFTAGEXONPARENTGENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBGTFTAGEXONPARENTGENE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sjdbGTFtagExonParentGeneName)
            if [ -z "$VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME" ]; then
              VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME="$2"
            else
              VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME="$VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFtagExonParentGeneName. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sjdbGTFtagExonParentGeneName=*)
            if [ -z "$VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME" ]; then
              VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME="$VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --sjdbGTFtagExonParentGeneType)
            if [ -z "$VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE" ]; then
              VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE="$2"
            else
              VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE="$VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbGTFtagExonParentGeneType. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sjdbGTFtagExonParentGeneType=*)
            if [ -z "$VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE" ]; then
              VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE="$VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --sjdbOverhang)
            [ -n "$VIASH_PAR_SJDBOVERHANG" ] && ViashError Bad arguments for option \'--sjdbOverhang\': \'$VIASH_PAR_SJDBOVERHANG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBOVERHANG="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbOverhang. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sjdbOverhang=*)
            [ -n "$VIASH_PAR_SJDBOVERHANG" ] && ViashError Bad arguments for option \'--sjdbOverhang=*\': \'$VIASH_PAR_SJDBOVERHANG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBOVERHANG=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sjdbScore)
            [ -n "$VIASH_PAR_SJDBSCORE" ] && ViashError Bad arguments for option \'--sjdbScore\': \'$VIASH_PAR_SJDBSCORE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBSCORE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbScore. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sjdbScore=*)
            [ -n "$VIASH_PAR_SJDBSCORE" ] && ViashError Bad arguments for option \'--sjdbScore=*\': \'$VIASH_PAR_SJDBSCORE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBSCORE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --sjdbInsertSave)
            [ -n "$VIASH_PAR_SJDBINSERTSAVE" ] && ViashError Bad arguments for option \'--sjdbInsertSave\': \'$VIASH_PAR_SJDBINSERTSAVE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBINSERTSAVE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --sjdbInsertSave. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --sjdbInsertSave=*)
            [ -n "$VIASH_PAR_SJDBINSERTSAVE" ] && ViashError Bad arguments for option \'--sjdbInsertSave=*\': \'$VIASH_PAR_SJDBINSERTSAVE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SJDBINSERTSAVE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --varVCFfile)
            [ -n "$VIASH_PAR_VARVCFFILE" ] && ViashError Bad arguments for option \'--varVCFfile\': \'$VIASH_PAR_VARVCFFILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_VARVCFFILE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --varVCFfile. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --varVCFfile=*)
            [ -n "$VIASH_PAR_VARVCFFILE" ] && ViashError Bad arguments for option \'--varVCFfile=*\': \'$VIASH_PAR_VARVCFFILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_VARVCFFILE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --readFilesType)
            [ -n "$VIASH_PAR_READFILESTYPE" ] && ViashError Bad arguments for option \'--readFilesType\': \'$VIASH_PAR_READFILESTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READFILESTYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --readFilesType. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --readFilesType=*)
            [ -n "$VIASH_PAR_READFILESTYPE" ] && ViashError Bad arguments for option \'--readFilesType=*\': \'$VIASH_PAR_READFILESTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READFILESTYPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --readFilesSAMattrKeep)
            if [ -z "$VIASH_PAR_READFILESSAMATTRKEEP" ]; then
              VIASH_PAR_READFILESSAMATTRKEEP="$2"
            else
              VIASH_PAR_READFILESSAMATTRKEEP="$VIASH_PAR_READFILESSAMATTRKEEP;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --readFilesSAMattrKeep. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --readFilesSAMattrKeep=*)
            if [ -z "$VIASH_PAR_READFILESSAMATTRKEEP" ]; then
              VIASH_PAR_READFILESSAMATTRKEEP=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_READFILESSAMATTRKEEP="$VIASH_PAR_READFILESSAMATTRKEEP;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --readFilesManifest)
            [ -n "$VIASH_PAR_READFILESMANIFEST" ] && ViashError Bad arguments for option \'--readFilesManifest\': \'$VIASH_PAR_READFILESMANIFEST\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READFILESMANIFEST="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --readFilesManifest. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --readFilesManifest=*)
            [ -n "$VIASH_PAR_READFILESMANIFEST" ] && ViashError Bad arguments for option \'--readFilesManifest=*\': \'$VIASH_PAR_READFILESMANIFEST\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READFILESMANIFEST=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --readFilesPrefix)
            [ -n "$VIASH_PAR_READFILESPREFIX" ] && ViashError Bad arguments for option \'--readFilesPrefix\': \'$VIASH_PAR_READFILESPREFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READFILESPREFIX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --readFilesPrefix. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --readFilesPrefix=*)
            [ -n "$VIASH_PAR_READFILESPREFIX" ] && ViashError Bad arguments for option \'--readFilesPrefix=*\': \'$VIASH_PAR_READFILESPREFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READFILESPREFIX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --readFilesCommand)
            if [ -z "$VIASH_PAR_READFILESCOMMAND" ]; then
              VIASH_PAR_READFILESCOMMAND="$2"
            else
              VIASH_PAR_READFILESCOMMAND="$VIASH_PAR_READFILESCOMMAND;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --readFilesCommand. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --readFilesCommand=*)
            if [ -z "$VIASH_PAR_READFILESCOMMAND" ]; then
              VIASH_PAR_READFILESCOMMAND=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_READFILESCOMMAND="$VIASH_PAR_READFILESCOMMAND;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --readMapNumber)
            [ -n "$VIASH_PAR_READMAPNUMBER" ] && ViashError Bad arguments for option \'--readMapNumber\': \'$VIASH_PAR_READMAPNUMBER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READMAPNUMBER="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --readMapNumber. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --readMapNumber=*)
            [ -n "$VIASH_PAR_READMAPNUMBER" ] && ViashError Bad arguments for option \'--readMapNumber=*\': \'$VIASH_PAR_READMAPNUMBER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READMAPNUMBER=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --readMatesLengthsIn)
            [ -n "$VIASH_PAR_READMATESLENGTHSIN" ] && ViashError Bad arguments for option \'--readMatesLengthsIn\': \'$VIASH_PAR_READMATESLENGTHSIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READMATESLENGTHSIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --readMatesLengthsIn. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --readMatesLengthsIn=*)
            [ -n "$VIASH_PAR_READMATESLENGTHSIN" ] && ViashError Bad arguments for option \'--readMatesLengthsIn=*\': \'$VIASH_PAR_READMATESLENGTHSIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READMATESLENGTHSIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --readNameSeparator)
            if [ -z "$VIASH_PAR_READNAMESEPARATOR" ]; then
              VIASH_PAR_READNAMESEPARATOR="$2"
            else
              VIASH_PAR_READNAMESEPARATOR="$VIASH_PAR_READNAMESEPARATOR;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --readNameSeparator. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --readNameSeparator=*)
            if [ -z "$VIASH_PAR_READNAMESEPARATOR" ]; then
              VIASH_PAR_READNAMESEPARATOR=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_READNAMESEPARATOR="$VIASH_PAR_READNAMESEPARATOR;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --readQualityScoreBase)
            [ -n "$VIASH_PAR_READQUALITYSCOREBASE" ] && ViashError Bad arguments for option \'--readQualityScoreBase\': \'$VIASH_PAR_READQUALITYSCOREBASE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READQUALITYSCOREBASE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --readQualityScoreBase. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --readQualityScoreBase=*)
            [ -n "$VIASH_PAR_READQUALITYSCOREBASE" ] && ViashError Bad arguments for option \'--readQualityScoreBase=*\': \'$VIASH_PAR_READQUALITYSCOREBASE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_READQUALITYSCOREBASE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --clipAdapterType)
            [ -n "$VIASH_PAR_CLIPADAPTERTYPE" ] && ViashError Bad arguments for option \'--clipAdapterType\': \'$VIASH_PAR_CLIPADAPTERTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CLIPADAPTERTYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --clipAdapterType. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --clipAdapterType=*)
            [ -n "$VIASH_PAR_CLIPADAPTERTYPE" ] && ViashError Bad arguments for option \'--clipAdapterType=*\': \'$VIASH_PAR_CLIPADAPTERTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CLIPADAPTERTYPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --clip3pNbases)
            if [ -z "$VIASH_PAR_CLIP3PNBASES" ]; then
              VIASH_PAR_CLIP3PNBASES="$2"
            else
              VIASH_PAR_CLIP3PNBASES="$VIASH_PAR_CLIP3PNBASES;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --clip3pNbases. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --clip3pNbases=*)
            if [ -z "$VIASH_PAR_CLIP3PNBASES" ]; then
              VIASH_PAR_CLIP3PNBASES=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_CLIP3PNBASES="$VIASH_PAR_CLIP3PNBASES;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --clip3pAdapterSeq)
            if [ -z "$VIASH_PAR_CLIP3PADAPTERSEQ" ]; then
              VIASH_PAR_CLIP3PADAPTERSEQ="$2"
            else
              VIASH_PAR_CLIP3PADAPTERSEQ="$VIASH_PAR_CLIP3PADAPTERSEQ;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --clip3pAdapterSeq. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --clip3pAdapterSeq=*)
            if [ -z "$VIASH_PAR_CLIP3PADAPTERSEQ" ]; then
              VIASH_PAR_CLIP3PADAPTERSEQ=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_CLIP3PADAPTERSEQ="$VIASH_PAR_CLIP3PADAPTERSEQ;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --clip3pAdapterMMp)
            if [ -z "$VIASH_PAR_CLIP3PADAPTERMMP" ]; then
              VIASH_PAR_CLIP3PADAPTERMMP="$2"
            else
              VIASH_PAR_CLIP3PADAPTERMMP="$VIASH_PAR_CLIP3PADAPTERMMP;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --clip3pAdapterMMp. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --clip3pAdapterMMp=*)
            if [ -z "$VIASH_PAR_CLIP3PADAPTERMMP" ]; then
              VIASH_PAR_CLIP3PADAPTERMMP=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_CLIP3PADAPTERMMP="$VIASH_PAR_CLIP3PADAPTERMMP;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --clip3pAfterAdapterNbases)
            if [ -z "$VIASH_PAR_CLIP3PAFTERADAPTERNBASES" ]; then
              VIASH_PAR_CLIP3PAFTERADAPTERNBASES="$2"
            else
              VIASH_PAR_CLIP3PAFTERADAPTERNBASES="$VIASH_PAR_CLIP3PAFTERADAPTERNBASES;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --clip3pAfterAdapterNbases. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --clip3pAfterAdapterNbases=*)
            if [ -z "$VIASH_PAR_CLIP3PAFTERADAPTERNBASES" ]; then
              VIASH_PAR_CLIP3PAFTERADAPTERNBASES=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_CLIP3PAFTERADAPTERNBASES="$VIASH_PAR_CLIP3PAFTERADAPTERNBASES;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --clip5pNbases)
            if [ -z "$VIASH_PAR_CLIP5PNBASES" ]; then
              VIASH_PAR_CLIP5PNBASES="$2"
            else
              VIASH_PAR_CLIP5PNBASES="$VIASH_PAR_CLIP5PNBASES;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --clip5pNbases. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --clip5pNbases=*)
            if [ -z "$VIASH_PAR_CLIP5PNBASES" ]; then
              VIASH_PAR_CLIP5PNBASES=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_CLIP5PNBASES="$VIASH_PAR_CLIP5PNBASES;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --limitGenomeGenerateRAM)
            [ -n "$VIASH_PAR_LIMITGENOMEGENERATERAM" ] && ViashError Bad arguments for option \'--limitGenomeGenerateRAM\': \'$VIASH_PAR_LIMITGENOMEGENERATERAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITGENOMEGENERATERAM="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --limitGenomeGenerateRAM. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --limitGenomeGenerateRAM=*)
            [ -n "$VIASH_PAR_LIMITGENOMEGENERATERAM" ] && ViashError Bad arguments for option \'--limitGenomeGenerateRAM=*\': \'$VIASH_PAR_LIMITGENOMEGENERATERAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITGENOMEGENERATERAM=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --limitIObufferSize)
            if [ -z "$VIASH_PAR_LIMITIOBUFFERSIZE" ]; then
              VIASH_PAR_LIMITIOBUFFERSIZE="$2"
            else
              VIASH_PAR_LIMITIOBUFFERSIZE="$VIASH_PAR_LIMITIOBUFFERSIZE;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --limitIObufferSize. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --limitIObufferSize=*)
            if [ -z "$VIASH_PAR_LIMITIOBUFFERSIZE" ]; then
              VIASH_PAR_LIMITIOBUFFERSIZE=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_LIMITIOBUFFERSIZE="$VIASH_PAR_LIMITIOBUFFERSIZE;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --limitOutSAMoneReadBytes)
            [ -n "$VIASH_PAR_LIMITOUTSAMONEREADBYTES" ] && ViashError Bad arguments for option \'--limitOutSAMoneReadBytes\': \'$VIASH_PAR_LIMITOUTSAMONEREADBYTES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITOUTSAMONEREADBYTES="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --limitOutSAMoneReadBytes. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --limitOutSAMoneReadBytes=*)
            [ -n "$VIASH_PAR_LIMITOUTSAMONEREADBYTES" ] && ViashError Bad arguments for option \'--limitOutSAMoneReadBytes=*\': \'$VIASH_PAR_LIMITOUTSAMONEREADBYTES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITOUTSAMONEREADBYTES=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --limitOutSJoneRead)
            [ -n "$VIASH_PAR_LIMITOUTSJONEREAD" ] && ViashError Bad arguments for option \'--limitOutSJoneRead\': \'$VIASH_PAR_LIMITOUTSJONEREAD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITOUTSJONEREAD="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --limitOutSJoneRead. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --limitOutSJoneRead=*)
            [ -n "$VIASH_PAR_LIMITOUTSJONEREAD" ] && ViashError Bad arguments for option \'--limitOutSJoneRead=*\': \'$VIASH_PAR_LIMITOUTSJONEREAD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITOUTSJONEREAD=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --limitOutSJcollapsed)
            [ -n "$VIASH_PAR_LIMITOUTSJCOLLAPSED" ] && ViashError Bad arguments for option \'--limitOutSJcollapsed\': \'$VIASH_PAR_LIMITOUTSJCOLLAPSED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITOUTSJCOLLAPSED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --limitOutSJcollapsed. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --limitOutSJcollapsed=*)
            [ -n "$VIASH_PAR_LIMITOUTSJCOLLAPSED" ] && ViashError Bad arguments for option \'--limitOutSJcollapsed=*\': \'$VIASH_PAR_LIMITOUTSJCOLLAPSED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITOUTSJCOLLAPSED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --limitBAMsortRAM)
            [ -n "$VIASH_PAR_LIMITBAMSORTRAM" ] && ViashError Bad arguments for option \'--limitBAMsortRAM\': \'$VIASH_PAR_LIMITBAMSORTRAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITBAMSORTRAM="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --limitBAMsortRAM. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --limitBAMsortRAM=*)
            [ -n "$VIASH_PAR_LIMITBAMSORTRAM" ] && ViashError Bad arguments for option \'--limitBAMsortRAM=*\': \'$VIASH_PAR_LIMITBAMSORTRAM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITBAMSORTRAM=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --limitSjdbInsertNsj)
            [ -n "$VIASH_PAR_LIMITSJDBINSERTNSJ" ] && ViashError Bad arguments for option \'--limitSjdbInsertNsj\': \'$VIASH_PAR_LIMITSJDBINSERTNSJ\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITSJDBINSERTNSJ="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --limitSjdbInsertNsj. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --limitSjdbInsertNsj=*)
            [ -n "$VIASH_PAR_LIMITSJDBINSERTNSJ" ] && ViashError Bad arguments for option \'--limitSjdbInsertNsj=*\': \'$VIASH_PAR_LIMITSJDBINSERTNSJ\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITSJDBINSERTNSJ=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --limitNreadsSoft)
            [ -n "$VIASH_PAR_LIMITNREADSSOFT" ] && ViashError Bad arguments for option \'--limitNreadsSoft\': \'$VIASH_PAR_LIMITNREADSSOFT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITNREADSSOFT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --limitNreadsSoft. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --limitNreadsSoft=*)
            [ -n "$VIASH_PAR_LIMITNREADSSOFT" ] && ViashError Bad arguments for option \'--limitNreadsSoft=*\': \'$VIASH_PAR_LIMITNREADSSOFT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_LIMITNREADSSOFT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outTmpKeep)
            [ -n "$VIASH_PAR_OUTTMPKEEP" ] && ViashError Bad arguments for option \'--outTmpKeep\': \'$VIASH_PAR_OUTTMPKEEP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTTMPKEEP="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outTmpKeep. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outTmpKeep=*)
            [ -n "$VIASH_PAR_OUTTMPKEEP" ] && ViashError Bad arguments for option \'--outTmpKeep=*\': \'$VIASH_PAR_OUTTMPKEEP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTTMPKEEP=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outStd)
            [ -n "$VIASH_PAR_OUTSTD" ] && ViashError Bad arguments for option \'--outStd\': \'$VIASH_PAR_OUTSTD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSTD="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outStd. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outStd=*)
            [ -n "$VIASH_PAR_OUTSTD" ] && ViashError Bad arguments for option \'--outStd=*\': \'$VIASH_PAR_OUTSTD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSTD=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outReadsUnmapped)
            [ -n "$VIASH_PAR_OUTREADSUNMAPPED" ] && ViashError Bad arguments for option \'--outReadsUnmapped\': \'$VIASH_PAR_OUTREADSUNMAPPED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTREADSUNMAPPED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outReadsUnmapped. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outReadsUnmapped=*)
            [ -n "$VIASH_PAR_OUTREADSUNMAPPED" ] && ViashError Bad arguments for option \'--outReadsUnmapped=*\': \'$VIASH_PAR_OUTREADSUNMAPPED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTREADSUNMAPPED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outQSconversionAdd)
            [ -n "$VIASH_PAR_OUTQSCONVERSIONADD" ] && ViashError Bad arguments for option \'--outQSconversionAdd\': \'$VIASH_PAR_OUTQSCONVERSIONADD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTQSCONVERSIONADD="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outQSconversionAdd. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outQSconversionAdd=*)
            [ -n "$VIASH_PAR_OUTQSCONVERSIONADD" ] && ViashError Bad arguments for option \'--outQSconversionAdd=*\': \'$VIASH_PAR_OUTQSCONVERSIONADD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTQSCONVERSIONADD=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outMultimapperOrder)
            [ -n "$VIASH_PAR_OUTMULTIMAPPERORDER" ] && ViashError Bad arguments for option \'--outMultimapperOrder\': \'$VIASH_PAR_OUTMULTIMAPPERORDER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTMULTIMAPPERORDER="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outMultimapperOrder. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outMultimapperOrder=*)
            [ -n "$VIASH_PAR_OUTMULTIMAPPERORDER" ] && ViashError Bad arguments for option \'--outMultimapperOrder=*\': \'$VIASH_PAR_OUTMULTIMAPPERORDER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTMULTIMAPPERORDER=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSAMmode)
            [ -n "$VIASH_PAR_OUTSAMMODE" ] && ViashError Bad arguments for option \'--outSAMmode\': \'$VIASH_PAR_OUTSAMMODE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMMODE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMmode. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMmode=*)
            [ -n "$VIASH_PAR_OUTSAMMODE" ] && ViashError Bad arguments for option \'--outSAMmode=*\': \'$VIASH_PAR_OUTSAMMODE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMMODE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSAMstrandField)
            [ -n "$VIASH_PAR_OUTSAMSTRANDFIELD" ] && ViashError Bad arguments for option \'--outSAMstrandField\': \'$VIASH_PAR_OUTSAMSTRANDFIELD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMSTRANDFIELD="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMstrandField. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMstrandField=*)
            [ -n "$VIASH_PAR_OUTSAMSTRANDFIELD" ] && ViashError Bad arguments for option \'--outSAMstrandField=*\': \'$VIASH_PAR_OUTSAMSTRANDFIELD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMSTRANDFIELD=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSAMattributes)
            if [ -z "$VIASH_PAR_OUTSAMATTRIBUTES" ]; then
              VIASH_PAR_OUTSAMATTRIBUTES="$2"
            else
              VIASH_PAR_OUTSAMATTRIBUTES="$VIASH_PAR_OUTSAMATTRIBUTES;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMattributes. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMattributes=*)
            if [ -z "$VIASH_PAR_OUTSAMATTRIBUTES" ]; then
              VIASH_PAR_OUTSAMATTRIBUTES=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_OUTSAMATTRIBUTES="$VIASH_PAR_OUTSAMATTRIBUTES;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --outSAMattrIHstart)
            [ -n "$VIASH_PAR_OUTSAMATTRIHSTART" ] && ViashError Bad arguments for option \'--outSAMattrIHstart\': \'$VIASH_PAR_OUTSAMATTRIHSTART\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMATTRIHSTART="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMattrIHstart. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMattrIHstart=*)
            [ -n "$VIASH_PAR_OUTSAMATTRIHSTART" ] && ViashError Bad arguments for option \'--outSAMattrIHstart=*\': \'$VIASH_PAR_OUTSAMATTRIHSTART\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMATTRIHSTART=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSAMunmapped)
            if [ -z "$VIASH_PAR_OUTSAMUNMAPPED" ]; then
              VIASH_PAR_OUTSAMUNMAPPED="$2"
            else
              VIASH_PAR_OUTSAMUNMAPPED="$VIASH_PAR_OUTSAMUNMAPPED;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMunmapped. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMunmapped=*)
            if [ -z "$VIASH_PAR_OUTSAMUNMAPPED" ]; then
              VIASH_PAR_OUTSAMUNMAPPED=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_OUTSAMUNMAPPED="$VIASH_PAR_OUTSAMUNMAPPED;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --outSAMorder)
            [ -n "$VIASH_PAR_OUTSAMORDER" ] && ViashError Bad arguments for option \'--outSAMorder\': \'$VIASH_PAR_OUTSAMORDER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMORDER="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMorder. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMorder=*)
            [ -n "$VIASH_PAR_OUTSAMORDER" ] && ViashError Bad arguments for option \'--outSAMorder=*\': \'$VIASH_PAR_OUTSAMORDER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMORDER=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSAMprimaryFlag)
            [ -n "$VIASH_PAR_OUTSAMPRIMARYFLAG" ] && ViashError Bad arguments for option \'--outSAMprimaryFlag\': \'$VIASH_PAR_OUTSAMPRIMARYFLAG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMPRIMARYFLAG="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMprimaryFlag. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMprimaryFlag=*)
            [ -n "$VIASH_PAR_OUTSAMPRIMARYFLAG" ] && ViashError Bad arguments for option \'--outSAMprimaryFlag=*\': \'$VIASH_PAR_OUTSAMPRIMARYFLAG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMPRIMARYFLAG=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSAMreadID)
            [ -n "$VIASH_PAR_OUTSAMREADID" ] && ViashError Bad arguments for option \'--outSAMreadID\': \'$VIASH_PAR_OUTSAMREADID\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMREADID="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMreadID. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMreadID=*)
            [ -n "$VIASH_PAR_OUTSAMREADID" ] && ViashError Bad arguments for option \'--outSAMreadID=*\': \'$VIASH_PAR_OUTSAMREADID\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMREADID=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSAMmapqUnique)
            [ -n "$VIASH_PAR_OUTSAMMAPQUNIQUE" ] && ViashError Bad arguments for option \'--outSAMmapqUnique\': \'$VIASH_PAR_OUTSAMMAPQUNIQUE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMMAPQUNIQUE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMmapqUnique. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMmapqUnique=*)
            [ -n "$VIASH_PAR_OUTSAMMAPQUNIQUE" ] && ViashError Bad arguments for option \'--outSAMmapqUnique=*\': \'$VIASH_PAR_OUTSAMMAPQUNIQUE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMMAPQUNIQUE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSAMflagOR)
            [ -n "$VIASH_PAR_OUTSAMFLAGOR" ] && ViashError Bad arguments for option \'--outSAMflagOR\': \'$VIASH_PAR_OUTSAMFLAGOR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMFLAGOR="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMflagOR. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMflagOR=*)
            [ -n "$VIASH_PAR_OUTSAMFLAGOR" ] && ViashError Bad arguments for option \'--outSAMflagOR=*\': \'$VIASH_PAR_OUTSAMFLAGOR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMFLAGOR=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSAMflagAND)
            [ -n "$VIASH_PAR_OUTSAMFLAGAND" ] && ViashError Bad arguments for option \'--outSAMflagAND\': \'$VIASH_PAR_OUTSAMFLAGAND\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMFLAGAND="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMflagAND. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMflagAND=*)
            [ -n "$VIASH_PAR_OUTSAMFLAGAND" ] && ViashError Bad arguments for option \'--outSAMflagAND=*\': \'$VIASH_PAR_OUTSAMFLAGAND\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMFLAGAND=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSAMattrRGline)
            if [ -z "$VIASH_PAR_OUTSAMATTRRGLINE" ]; then
              VIASH_PAR_OUTSAMATTRRGLINE="$2"
            else
              VIASH_PAR_OUTSAMATTRRGLINE="$VIASH_PAR_OUTSAMATTRRGLINE;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMattrRGline. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMattrRGline=*)
            if [ -z "$VIASH_PAR_OUTSAMATTRRGLINE" ]; then
              VIASH_PAR_OUTSAMATTRRGLINE=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_OUTSAMATTRRGLINE="$VIASH_PAR_OUTSAMATTRRGLINE;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --outSAMheaderHD)
            if [ -z "$VIASH_PAR_OUTSAMHEADERHD" ]; then
              VIASH_PAR_OUTSAMHEADERHD="$2"
            else
              VIASH_PAR_OUTSAMHEADERHD="$VIASH_PAR_OUTSAMHEADERHD;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMheaderHD. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMheaderHD=*)
            if [ -z "$VIASH_PAR_OUTSAMHEADERHD" ]; then
              VIASH_PAR_OUTSAMHEADERHD=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_OUTSAMHEADERHD="$VIASH_PAR_OUTSAMHEADERHD;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --outSAMheaderPG)
            if [ -z "$VIASH_PAR_OUTSAMHEADERPG" ]; then
              VIASH_PAR_OUTSAMHEADERPG="$2"
            else
              VIASH_PAR_OUTSAMHEADERPG="$VIASH_PAR_OUTSAMHEADERPG;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMheaderPG. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMheaderPG=*)
            if [ -z "$VIASH_PAR_OUTSAMHEADERPG" ]; then
              VIASH_PAR_OUTSAMHEADERPG=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_OUTSAMHEADERPG="$VIASH_PAR_OUTSAMHEADERPG;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --outSAMheaderCommentFile)
            [ -n "$VIASH_PAR_OUTSAMHEADERCOMMENTFILE" ] && ViashError Bad arguments for option \'--outSAMheaderCommentFile\': \'$VIASH_PAR_OUTSAMHEADERCOMMENTFILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMHEADERCOMMENTFILE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMheaderCommentFile. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMheaderCommentFile=*)
            [ -n "$VIASH_PAR_OUTSAMHEADERCOMMENTFILE" ] && ViashError Bad arguments for option \'--outSAMheaderCommentFile=*\': \'$VIASH_PAR_OUTSAMHEADERCOMMENTFILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMHEADERCOMMENTFILE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSAMfilter)
            if [ -z "$VIASH_PAR_OUTSAMFILTER" ]; then
              VIASH_PAR_OUTSAMFILTER="$2"
            else
              VIASH_PAR_OUTSAMFILTER="$VIASH_PAR_OUTSAMFILTER;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMfilter. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMfilter=*)
            if [ -z "$VIASH_PAR_OUTSAMFILTER" ]; then
              VIASH_PAR_OUTSAMFILTER=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_OUTSAMFILTER="$VIASH_PAR_OUTSAMFILTER;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --outSAMmultNmax)
            [ -n "$VIASH_PAR_OUTSAMMULTNMAX" ] && ViashError Bad arguments for option \'--outSAMmultNmax\': \'$VIASH_PAR_OUTSAMMULTNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMMULTNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMmultNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMmultNmax=*)
            [ -n "$VIASH_PAR_OUTSAMMULTNMAX" ] && ViashError Bad arguments for option \'--outSAMmultNmax=*\': \'$VIASH_PAR_OUTSAMMULTNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMMULTNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSAMtlen)
            [ -n "$VIASH_PAR_OUTSAMTLEN" ] && ViashError Bad arguments for option \'--outSAMtlen\': \'$VIASH_PAR_OUTSAMTLEN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMTLEN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSAMtlen. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSAMtlen=*)
            [ -n "$VIASH_PAR_OUTSAMTLEN" ] && ViashError Bad arguments for option \'--outSAMtlen=*\': \'$VIASH_PAR_OUTSAMTLEN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSAMTLEN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outBAMcompression)
            [ -n "$VIASH_PAR_OUTBAMCOMPRESSION" ] && ViashError Bad arguments for option \'--outBAMcompression\': \'$VIASH_PAR_OUTBAMCOMPRESSION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTBAMCOMPRESSION="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outBAMcompression. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outBAMcompression=*)
            [ -n "$VIASH_PAR_OUTBAMCOMPRESSION" ] && ViashError Bad arguments for option \'--outBAMcompression=*\': \'$VIASH_PAR_OUTBAMCOMPRESSION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTBAMCOMPRESSION=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outBAMsortingThreadN)
            [ -n "$VIASH_PAR_OUTBAMSORTINGTHREADN" ] && ViashError Bad arguments for option \'--outBAMsortingThreadN\': \'$VIASH_PAR_OUTBAMSORTINGTHREADN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTBAMSORTINGTHREADN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outBAMsortingThreadN. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outBAMsortingThreadN=*)
            [ -n "$VIASH_PAR_OUTBAMSORTINGTHREADN" ] && ViashError Bad arguments for option \'--outBAMsortingThreadN=*\': \'$VIASH_PAR_OUTBAMSORTINGTHREADN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTBAMSORTINGTHREADN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outBAMsortingBinsN)
            [ -n "$VIASH_PAR_OUTBAMSORTINGBINSN" ] && ViashError Bad arguments for option \'--outBAMsortingBinsN\': \'$VIASH_PAR_OUTBAMSORTINGBINSN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTBAMSORTINGBINSN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outBAMsortingBinsN. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outBAMsortingBinsN=*)
            [ -n "$VIASH_PAR_OUTBAMSORTINGBINSN" ] && ViashError Bad arguments for option \'--outBAMsortingBinsN=*\': \'$VIASH_PAR_OUTBAMSORTINGBINSN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTBAMSORTINGBINSN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --bamRemoveDuplicatesType)
            [ -n "$VIASH_PAR_BAMREMOVEDUPLICATESTYPE" ] && ViashError Bad arguments for option \'--bamRemoveDuplicatesType\': \'$VIASH_PAR_BAMREMOVEDUPLICATESTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAMREMOVEDUPLICATESTYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --bamRemoveDuplicatesType. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --bamRemoveDuplicatesType=*)
            [ -n "$VIASH_PAR_BAMREMOVEDUPLICATESTYPE" ] && ViashError Bad arguments for option \'--bamRemoveDuplicatesType=*\': \'$VIASH_PAR_BAMREMOVEDUPLICATESTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAMREMOVEDUPLICATESTYPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --bamRemoveDuplicatesMate2basesN)
            [ -n "$VIASH_PAR_BAMREMOVEDUPLICATESMATE2BASESN" ] && ViashError Bad arguments for option \'--bamRemoveDuplicatesMate2basesN\': \'$VIASH_PAR_BAMREMOVEDUPLICATESMATE2BASESN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAMREMOVEDUPLICATESMATE2BASESN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --bamRemoveDuplicatesMate2basesN. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --bamRemoveDuplicatesMate2basesN=*)
            [ -n "$VIASH_PAR_BAMREMOVEDUPLICATESMATE2BASESN" ] && ViashError Bad arguments for option \'--bamRemoveDuplicatesMate2basesN=*\': \'$VIASH_PAR_BAMREMOVEDUPLICATESMATE2BASESN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_BAMREMOVEDUPLICATESMATE2BASESN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outWigType)
            if [ -z "$VIASH_PAR_OUTWIGTYPE" ]; then
              VIASH_PAR_OUTWIGTYPE="$2"
            else
              VIASH_PAR_OUTWIGTYPE="$VIASH_PAR_OUTWIGTYPE;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outWigType. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outWigType=*)
            if [ -z "$VIASH_PAR_OUTWIGTYPE" ]; then
              VIASH_PAR_OUTWIGTYPE=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_OUTWIGTYPE="$VIASH_PAR_OUTWIGTYPE;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --outWigStrand)
            [ -n "$VIASH_PAR_OUTWIGSTRAND" ] && ViashError Bad arguments for option \'--outWigStrand\': \'$VIASH_PAR_OUTWIGSTRAND\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTWIGSTRAND="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outWigStrand. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outWigStrand=*)
            [ -n "$VIASH_PAR_OUTWIGSTRAND" ] && ViashError Bad arguments for option \'--outWigStrand=*\': \'$VIASH_PAR_OUTWIGSTRAND\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTWIGSTRAND=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outWigReferencesPrefix)
            [ -n "$VIASH_PAR_OUTWIGREFERENCESPREFIX" ] && ViashError Bad arguments for option \'--outWigReferencesPrefix\': \'$VIASH_PAR_OUTWIGREFERENCESPREFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTWIGREFERENCESPREFIX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outWigReferencesPrefix. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outWigReferencesPrefix=*)
            [ -n "$VIASH_PAR_OUTWIGREFERENCESPREFIX" ] && ViashError Bad arguments for option \'--outWigReferencesPrefix=*\': \'$VIASH_PAR_OUTWIGREFERENCESPREFIX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTWIGREFERENCESPREFIX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outWigNorm)
            [ -n "$VIASH_PAR_OUTWIGNORM" ] && ViashError Bad arguments for option \'--outWigNorm\': \'$VIASH_PAR_OUTWIGNORM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTWIGNORM="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outWigNorm. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outWigNorm=*)
            [ -n "$VIASH_PAR_OUTWIGNORM" ] && ViashError Bad arguments for option \'--outWigNorm=*\': \'$VIASH_PAR_OUTWIGNORM\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTWIGNORM=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFilterType)
            [ -n "$VIASH_PAR_OUTFILTERTYPE" ] && ViashError Bad arguments for option \'--outFilterType\': \'$VIASH_PAR_OUTFILTERTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERTYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFilterType. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outFilterType=*)
            [ -n "$VIASH_PAR_OUTFILTERTYPE" ] && ViashError Bad arguments for option \'--outFilterType=*\': \'$VIASH_PAR_OUTFILTERTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERTYPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFilterMultimapScoreRange)
            [ -n "$VIASH_PAR_OUTFILTERMULTIMAPSCORERANGE" ] && ViashError Bad arguments for option \'--outFilterMultimapScoreRange\': \'$VIASH_PAR_OUTFILTERMULTIMAPSCORERANGE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMULTIMAPSCORERANGE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFilterMultimapScoreRange. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outFilterMultimapScoreRange=*)
            [ -n "$VIASH_PAR_OUTFILTERMULTIMAPSCORERANGE" ] && ViashError Bad arguments for option \'--outFilterMultimapScoreRange=*\': \'$VIASH_PAR_OUTFILTERMULTIMAPSCORERANGE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMULTIMAPSCORERANGE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFilterMultimapNmax)
            [ -n "$VIASH_PAR_OUTFILTERMULTIMAPNMAX" ] && ViashError Bad arguments for option \'--outFilterMultimapNmax\': \'$VIASH_PAR_OUTFILTERMULTIMAPNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMULTIMAPNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFilterMultimapNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outFilterMultimapNmax=*)
            [ -n "$VIASH_PAR_OUTFILTERMULTIMAPNMAX" ] && ViashError Bad arguments for option \'--outFilterMultimapNmax=*\': \'$VIASH_PAR_OUTFILTERMULTIMAPNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMULTIMAPNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFilterMismatchNmax)
            [ -n "$VIASH_PAR_OUTFILTERMISMATCHNMAX" ] && ViashError Bad arguments for option \'--outFilterMismatchNmax\': \'$VIASH_PAR_OUTFILTERMISMATCHNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMISMATCHNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFilterMismatchNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outFilterMismatchNmax=*)
            [ -n "$VIASH_PAR_OUTFILTERMISMATCHNMAX" ] && ViashError Bad arguments for option \'--outFilterMismatchNmax=*\': \'$VIASH_PAR_OUTFILTERMISMATCHNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMISMATCHNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFilterMismatchNoverLmax)
            [ -n "$VIASH_PAR_OUTFILTERMISMATCHNOVERLMAX" ] && ViashError Bad arguments for option \'--outFilterMismatchNoverLmax\': \'$VIASH_PAR_OUTFILTERMISMATCHNOVERLMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMISMATCHNOVERLMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFilterMismatchNoverLmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outFilterMismatchNoverLmax=*)
            [ -n "$VIASH_PAR_OUTFILTERMISMATCHNOVERLMAX" ] && ViashError Bad arguments for option \'--outFilterMismatchNoverLmax=*\': \'$VIASH_PAR_OUTFILTERMISMATCHNOVERLMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMISMATCHNOVERLMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFilterMismatchNoverReadLmax)
            [ -n "$VIASH_PAR_OUTFILTERMISMATCHNOVERREADLMAX" ] && ViashError Bad arguments for option \'--outFilterMismatchNoverReadLmax\': \'$VIASH_PAR_OUTFILTERMISMATCHNOVERREADLMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMISMATCHNOVERREADLMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFilterMismatchNoverReadLmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outFilterMismatchNoverReadLmax=*)
            [ -n "$VIASH_PAR_OUTFILTERMISMATCHNOVERREADLMAX" ] && ViashError Bad arguments for option \'--outFilterMismatchNoverReadLmax=*\': \'$VIASH_PAR_OUTFILTERMISMATCHNOVERREADLMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMISMATCHNOVERREADLMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFilterScoreMin)
            [ -n "$VIASH_PAR_OUTFILTERSCOREMIN" ] && ViashError Bad arguments for option \'--outFilterScoreMin\': \'$VIASH_PAR_OUTFILTERSCOREMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERSCOREMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFilterScoreMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outFilterScoreMin=*)
            [ -n "$VIASH_PAR_OUTFILTERSCOREMIN" ] && ViashError Bad arguments for option \'--outFilterScoreMin=*\': \'$VIASH_PAR_OUTFILTERSCOREMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERSCOREMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFilterScoreMinOverLread)
            [ -n "$VIASH_PAR_OUTFILTERSCOREMINOVERLREAD" ] && ViashError Bad arguments for option \'--outFilterScoreMinOverLread\': \'$VIASH_PAR_OUTFILTERSCOREMINOVERLREAD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERSCOREMINOVERLREAD="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFilterScoreMinOverLread. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outFilterScoreMinOverLread=*)
            [ -n "$VIASH_PAR_OUTFILTERSCOREMINOVERLREAD" ] && ViashError Bad arguments for option \'--outFilterScoreMinOverLread=*\': \'$VIASH_PAR_OUTFILTERSCOREMINOVERLREAD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERSCOREMINOVERLREAD=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFilterMatchNmin)
            [ -n "$VIASH_PAR_OUTFILTERMATCHNMIN" ] && ViashError Bad arguments for option \'--outFilterMatchNmin\': \'$VIASH_PAR_OUTFILTERMATCHNMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMATCHNMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFilterMatchNmin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outFilterMatchNmin=*)
            [ -n "$VIASH_PAR_OUTFILTERMATCHNMIN" ] && ViashError Bad arguments for option \'--outFilterMatchNmin=*\': \'$VIASH_PAR_OUTFILTERMATCHNMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMATCHNMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFilterMatchNminOverLread)
            [ -n "$VIASH_PAR_OUTFILTERMATCHNMINOVERLREAD" ] && ViashError Bad arguments for option \'--outFilterMatchNminOverLread\': \'$VIASH_PAR_OUTFILTERMATCHNMINOVERLREAD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMATCHNMINOVERLREAD="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFilterMatchNminOverLread. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outFilterMatchNminOverLread=*)
            [ -n "$VIASH_PAR_OUTFILTERMATCHNMINOVERLREAD" ] && ViashError Bad arguments for option \'--outFilterMatchNminOverLread=*\': \'$VIASH_PAR_OUTFILTERMATCHNMINOVERLREAD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERMATCHNMINOVERLREAD=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFilterIntronMotifs)
            [ -n "$VIASH_PAR_OUTFILTERINTRONMOTIFS" ] && ViashError Bad arguments for option \'--outFilterIntronMotifs\': \'$VIASH_PAR_OUTFILTERINTRONMOTIFS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERINTRONMOTIFS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFilterIntronMotifs. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outFilterIntronMotifs=*)
            [ -n "$VIASH_PAR_OUTFILTERINTRONMOTIFS" ] && ViashError Bad arguments for option \'--outFilterIntronMotifs=*\': \'$VIASH_PAR_OUTFILTERINTRONMOTIFS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERINTRONMOTIFS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outFilterIntronStrands)
            [ -n "$VIASH_PAR_OUTFILTERINTRONSTRANDS" ] && ViashError Bad arguments for option \'--outFilterIntronStrands\': \'$VIASH_PAR_OUTFILTERINTRONSTRANDS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERINTRONSTRANDS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outFilterIntronStrands. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outFilterIntronStrands=*)
            [ -n "$VIASH_PAR_OUTFILTERINTRONSTRANDS" ] && ViashError Bad arguments for option \'--outFilterIntronStrands=*\': \'$VIASH_PAR_OUTFILTERINTRONSTRANDS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTFILTERINTRONSTRANDS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSJtype)
            [ -n "$VIASH_PAR_OUTSJTYPE" ] && ViashError Bad arguments for option \'--outSJtype\': \'$VIASH_PAR_OUTSJTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSJTYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSJtype. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSJtype=*)
            [ -n "$VIASH_PAR_OUTSJTYPE" ] && ViashError Bad arguments for option \'--outSJtype=*\': \'$VIASH_PAR_OUTSJTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSJTYPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSJfilterReads)
            [ -n "$VIASH_PAR_OUTSJFILTERREADS" ] && ViashError Bad arguments for option \'--outSJfilterReads\': \'$VIASH_PAR_OUTSJFILTERREADS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSJFILTERREADS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSJfilterReads. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSJfilterReads=*)
            [ -n "$VIASH_PAR_OUTSJFILTERREADS" ] && ViashError Bad arguments for option \'--outSJfilterReads=*\': \'$VIASH_PAR_OUTSJFILTERREADS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_OUTSJFILTERREADS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --outSJfilterOverhangMin)
            if [ -z "$VIASH_PAR_OUTSJFILTEROVERHANGMIN" ]; then
              VIASH_PAR_OUTSJFILTEROVERHANGMIN="$2"
            else
              VIASH_PAR_OUTSJFILTEROVERHANGMIN="$VIASH_PAR_OUTSJFILTEROVERHANGMIN;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSJfilterOverhangMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSJfilterOverhangMin=*)
            if [ -z "$VIASH_PAR_OUTSJFILTEROVERHANGMIN" ]; then
              VIASH_PAR_OUTSJFILTEROVERHANGMIN=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_OUTSJFILTEROVERHANGMIN="$VIASH_PAR_OUTSJFILTEROVERHANGMIN;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --outSJfilterCountUniqueMin)
            if [ -z "$VIASH_PAR_OUTSJFILTERCOUNTUNIQUEMIN" ]; then
              VIASH_PAR_OUTSJFILTERCOUNTUNIQUEMIN="$2"
            else
              VIASH_PAR_OUTSJFILTERCOUNTUNIQUEMIN="$VIASH_PAR_OUTSJFILTERCOUNTUNIQUEMIN;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSJfilterCountUniqueMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSJfilterCountUniqueMin=*)
            if [ -z "$VIASH_PAR_OUTSJFILTERCOUNTUNIQUEMIN" ]; then
              VIASH_PAR_OUTSJFILTERCOUNTUNIQUEMIN=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_OUTSJFILTERCOUNTUNIQUEMIN="$VIASH_PAR_OUTSJFILTERCOUNTUNIQUEMIN;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --outSJfilterCountTotalMin)
            if [ -z "$VIASH_PAR_OUTSJFILTERCOUNTTOTALMIN" ]; then
              VIASH_PAR_OUTSJFILTERCOUNTTOTALMIN="$2"
            else
              VIASH_PAR_OUTSJFILTERCOUNTTOTALMIN="$VIASH_PAR_OUTSJFILTERCOUNTTOTALMIN;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSJfilterCountTotalMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSJfilterCountTotalMin=*)
            if [ -z "$VIASH_PAR_OUTSJFILTERCOUNTTOTALMIN" ]; then
              VIASH_PAR_OUTSJFILTERCOUNTTOTALMIN=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_OUTSJFILTERCOUNTTOTALMIN="$VIASH_PAR_OUTSJFILTERCOUNTTOTALMIN;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --outSJfilterDistToOtherSJmin)
            if [ -z "$VIASH_PAR_OUTSJFILTERDISTTOOTHERSJMIN" ]; then
              VIASH_PAR_OUTSJFILTERDISTTOOTHERSJMIN="$2"
            else
              VIASH_PAR_OUTSJFILTERDISTTOOTHERSJMIN="$VIASH_PAR_OUTSJFILTERDISTTOOTHERSJMIN;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSJfilterDistToOtherSJmin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSJfilterDistToOtherSJmin=*)
            if [ -z "$VIASH_PAR_OUTSJFILTERDISTTOOTHERSJMIN" ]; then
              VIASH_PAR_OUTSJFILTERDISTTOOTHERSJMIN=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_OUTSJFILTERDISTTOOTHERSJMIN="$VIASH_PAR_OUTSJFILTERDISTTOOTHERSJMIN;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --outSJfilterIntronMaxVsReadN)
            if [ -z "$VIASH_PAR_OUTSJFILTERINTRONMAXVSREADN" ]; then
              VIASH_PAR_OUTSJFILTERINTRONMAXVSREADN="$2"
            else
              VIASH_PAR_OUTSJFILTERINTRONMAXVSREADN="$VIASH_PAR_OUTSJFILTERINTRONMAXVSREADN;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --outSJfilterIntronMaxVsReadN. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --outSJfilterIntronMaxVsReadN=*)
            if [ -z "$VIASH_PAR_OUTSJFILTERINTRONMAXVSREADN" ]; then
              VIASH_PAR_OUTSJFILTERINTRONMAXVSREADN=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_OUTSJFILTERINTRONMAXVSREADN="$VIASH_PAR_OUTSJFILTERINTRONMAXVSREADN;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --scoreGap)
            [ -n "$VIASH_PAR_SCOREGAP" ] && ViashError Bad arguments for option \'--scoreGap\': \'$VIASH_PAR_SCOREGAP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREGAP="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --scoreGap. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --scoreGap=*)
            [ -n "$VIASH_PAR_SCOREGAP" ] && ViashError Bad arguments for option \'--scoreGap=*\': \'$VIASH_PAR_SCOREGAP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREGAP=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --scoreGapNoncan)
            [ -n "$VIASH_PAR_SCOREGAPNONCAN" ] && ViashError Bad arguments for option \'--scoreGapNoncan\': \'$VIASH_PAR_SCOREGAPNONCAN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREGAPNONCAN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --scoreGapNoncan. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --scoreGapNoncan=*)
            [ -n "$VIASH_PAR_SCOREGAPNONCAN" ] && ViashError Bad arguments for option \'--scoreGapNoncan=*\': \'$VIASH_PAR_SCOREGAPNONCAN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREGAPNONCAN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --scoreGapGCAG)
            [ -n "$VIASH_PAR_SCOREGAPGCAG" ] && ViashError Bad arguments for option \'--scoreGapGCAG\': \'$VIASH_PAR_SCOREGAPGCAG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREGAPGCAG="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --scoreGapGCAG. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --scoreGapGCAG=*)
            [ -n "$VIASH_PAR_SCOREGAPGCAG" ] && ViashError Bad arguments for option \'--scoreGapGCAG=*\': \'$VIASH_PAR_SCOREGAPGCAG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREGAPGCAG=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --scoreGapATAC)
            [ -n "$VIASH_PAR_SCOREGAPATAC" ] && ViashError Bad arguments for option \'--scoreGapATAC\': \'$VIASH_PAR_SCOREGAPATAC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREGAPATAC="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --scoreGapATAC. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --scoreGapATAC=*)
            [ -n "$VIASH_PAR_SCOREGAPATAC" ] && ViashError Bad arguments for option \'--scoreGapATAC=*\': \'$VIASH_PAR_SCOREGAPATAC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREGAPATAC=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --scoreGenomicLengthLog2scale)
            [ -n "$VIASH_PAR_SCOREGENOMICLENGTHLOG2SCALE" ] && ViashError Bad arguments for option \'--scoreGenomicLengthLog2scale\': \'$VIASH_PAR_SCOREGENOMICLENGTHLOG2SCALE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREGENOMICLENGTHLOG2SCALE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --scoreGenomicLengthLog2scale. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --scoreGenomicLengthLog2scale=*)
            [ -n "$VIASH_PAR_SCOREGENOMICLENGTHLOG2SCALE" ] && ViashError Bad arguments for option \'--scoreGenomicLengthLog2scale=*\': \'$VIASH_PAR_SCOREGENOMICLENGTHLOG2SCALE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREGENOMICLENGTHLOG2SCALE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --scoreDelOpen)
            [ -n "$VIASH_PAR_SCOREDELOPEN" ] && ViashError Bad arguments for option \'--scoreDelOpen\': \'$VIASH_PAR_SCOREDELOPEN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREDELOPEN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --scoreDelOpen. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --scoreDelOpen=*)
            [ -n "$VIASH_PAR_SCOREDELOPEN" ] && ViashError Bad arguments for option \'--scoreDelOpen=*\': \'$VIASH_PAR_SCOREDELOPEN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREDELOPEN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --scoreDelBase)
            [ -n "$VIASH_PAR_SCOREDELBASE" ] && ViashError Bad arguments for option \'--scoreDelBase\': \'$VIASH_PAR_SCOREDELBASE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREDELBASE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --scoreDelBase. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --scoreDelBase=*)
            [ -n "$VIASH_PAR_SCOREDELBASE" ] && ViashError Bad arguments for option \'--scoreDelBase=*\': \'$VIASH_PAR_SCOREDELBASE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREDELBASE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --scoreInsOpen)
            [ -n "$VIASH_PAR_SCOREINSOPEN" ] && ViashError Bad arguments for option \'--scoreInsOpen\': \'$VIASH_PAR_SCOREINSOPEN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREINSOPEN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --scoreInsOpen. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --scoreInsOpen=*)
            [ -n "$VIASH_PAR_SCOREINSOPEN" ] && ViashError Bad arguments for option \'--scoreInsOpen=*\': \'$VIASH_PAR_SCOREINSOPEN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREINSOPEN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --scoreInsBase)
            [ -n "$VIASH_PAR_SCOREINSBASE" ] && ViashError Bad arguments for option \'--scoreInsBase\': \'$VIASH_PAR_SCOREINSBASE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREINSBASE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --scoreInsBase. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --scoreInsBase=*)
            [ -n "$VIASH_PAR_SCOREINSBASE" ] && ViashError Bad arguments for option \'--scoreInsBase=*\': \'$VIASH_PAR_SCOREINSBASE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCOREINSBASE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --scoreStitchSJshift)
            [ -n "$VIASH_PAR_SCORESTITCHSJSHIFT" ] && ViashError Bad arguments for option \'--scoreStitchSJshift\': \'$VIASH_PAR_SCORESTITCHSJSHIFT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCORESTITCHSJSHIFT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --scoreStitchSJshift. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --scoreStitchSJshift=*)
            [ -n "$VIASH_PAR_SCORESTITCHSJSHIFT" ] && ViashError Bad arguments for option \'--scoreStitchSJshift=*\': \'$VIASH_PAR_SCORESTITCHSJSHIFT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SCORESTITCHSJSHIFT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --seedSearchStartLmax)
            [ -n "$VIASH_PAR_SEEDSEARCHSTARTLMAX" ] && ViashError Bad arguments for option \'--seedSearchStartLmax\': \'$VIASH_PAR_SEEDSEARCHSTARTLMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDSEARCHSTARTLMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --seedSearchStartLmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --seedSearchStartLmax=*)
            [ -n "$VIASH_PAR_SEEDSEARCHSTARTLMAX" ] && ViashError Bad arguments for option \'--seedSearchStartLmax=*\': \'$VIASH_PAR_SEEDSEARCHSTARTLMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDSEARCHSTARTLMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --seedSearchStartLmaxOverLread)
            [ -n "$VIASH_PAR_SEEDSEARCHSTARTLMAXOVERLREAD" ] && ViashError Bad arguments for option \'--seedSearchStartLmaxOverLread\': \'$VIASH_PAR_SEEDSEARCHSTARTLMAXOVERLREAD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDSEARCHSTARTLMAXOVERLREAD="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --seedSearchStartLmaxOverLread. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --seedSearchStartLmaxOverLread=*)
            [ -n "$VIASH_PAR_SEEDSEARCHSTARTLMAXOVERLREAD" ] && ViashError Bad arguments for option \'--seedSearchStartLmaxOverLread=*\': \'$VIASH_PAR_SEEDSEARCHSTARTLMAXOVERLREAD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDSEARCHSTARTLMAXOVERLREAD=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --seedSearchLmax)
            [ -n "$VIASH_PAR_SEEDSEARCHLMAX" ] && ViashError Bad arguments for option \'--seedSearchLmax\': \'$VIASH_PAR_SEEDSEARCHLMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDSEARCHLMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --seedSearchLmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --seedSearchLmax=*)
            [ -n "$VIASH_PAR_SEEDSEARCHLMAX" ] && ViashError Bad arguments for option \'--seedSearchLmax=*\': \'$VIASH_PAR_SEEDSEARCHLMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDSEARCHLMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --seedMultimapNmax)
            [ -n "$VIASH_PAR_SEEDMULTIMAPNMAX" ] && ViashError Bad arguments for option \'--seedMultimapNmax\': \'$VIASH_PAR_SEEDMULTIMAPNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDMULTIMAPNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --seedMultimapNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --seedMultimapNmax=*)
            [ -n "$VIASH_PAR_SEEDMULTIMAPNMAX" ] && ViashError Bad arguments for option \'--seedMultimapNmax=*\': \'$VIASH_PAR_SEEDMULTIMAPNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDMULTIMAPNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --seedPerReadNmax)
            [ -n "$VIASH_PAR_SEEDPERREADNMAX" ] && ViashError Bad arguments for option \'--seedPerReadNmax\': \'$VIASH_PAR_SEEDPERREADNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDPERREADNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --seedPerReadNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --seedPerReadNmax=*)
            [ -n "$VIASH_PAR_SEEDPERREADNMAX" ] && ViashError Bad arguments for option \'--seedPerReadNmax=*\': \'$VIASH_PAR_SEEDPERREADNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDPERREADNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --seedPerWindowNmax)
            [ -n "$VIASH_PAR_SEEDPERWINDOWNMAX" ] && ViashError Bad arguments for option \'--seedPerWindowNmax\': \'$VIASH_PAR_SEEDPERWINDOWNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDPERWINDOWNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --seedPerWindowNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --seedPerWindowNmax=*)
            [ -n "$VIASH_PAR_SEEDPERWINDOWNMAX" ] && ViashError Bad arguments for option \'--seedPerWindowNmax=*\': \'$VIASH_PAR_SEEDPERWINDOWNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDPERWINDOWNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --seedNoneLociPerWindow)
            [ -n "$VIASH_PAR_SEEDNONELOCIPERWINDOW" ] && ViashError Bad arguments for option \'--seedNoneLociPerWindow\': \'$VIASH_PAR_SEEDNONELOCIPERWINDOW\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDNONELOCIPERWINDOW="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --seedNoneLociPerWindow. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --seedNoneLociPerWindow=*)
            [ -n "$VIASH_PAR_SEEDNONELOCIPERWINDOW" ] && ViashError Bad arguments for option \'--seedNoneLociPerWindow=*\': \'$VIASH_PAR_SEEDNONELOCIPERWINDOW\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDNONELOCIPERWINDOW=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --seedSplitMin)
            [ -n "$VIASH_PAR_SEEDSPLITMIN" ] && ViashError Bad arguments for option \'--seedSplitMin\': \'$VIASH_PAR_SEEDSPLITMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDSPLITMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --seedSplitMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --seedSplitMin=*)
            [ -n "$VIASH_PAR_SEEDSPLITMIN" ] && ViashError Bad arguments for option \'--seedSplitMin=*\': \'$VIASH_PAR_SEEDSPLITMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDSPLITMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --seedMapMin)
            [ -n "$VIASH_PAR_SEEDMAPMIN" ] && ViashError Bad arguments for option \'--seedMapMin\': \'$VIASH_PAR_SEEDMAPMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDMAPMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --seedMapMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --seedMapMin=*)
            [ -n "$VIASH_PAR_SEEDMAPMIN" ] && ViashError Bad arguments for option \'--seedMapMin=*\': \'$VIASH_PAR_SEEDMAPMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SEEDMAPMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignIntronMin)
            [ -n "$VIASH_PAR_ALIGNINTRONMIN" ] && ViashError Bad arguments for option \'--alignIntronMin\': \'$VIASH_PAR_ALIGNINTRONMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNINTRONMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignIntronMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignIntronMin=*)
            [ -n "$VIASH_PAR_ALIGNINTRONMIN" ] && ViashError Bad arguments for option \'--alignIntronMin=*\': \'$VIASH_PAR_ALIGNINTRONMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNINTRONMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignIntronMax)
            [ -n "$VIASH_PAR_ALIGNINTRONMAX" ] && ViashError Bad arguments for option \'--alignIntronMax\': \'$VIASH_PAR_ALIGNINTRONMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNINTRONMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignIntronMax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignIntronMax=*)
            [ -n "$VIASH_PAR_ALIGNINTRONMAX" ] && ViashError Bad arguments for option \'--alignIntronMax=*\': \'$VIASH_PAR_ALIGNINTRONMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNINTRONMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignMatesGapMax)
            [ -n "$VIASH_PAR_ALIGNMATESGAPMAX" ] && ViashError Bad arguments for option \'--alignMatesGapMax\': \'$VIASH_PAR_ALIGNMATESGAPMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNMATESGAPMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignMatesGapMax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignMatesGapMax=*)
            [ -n "$VIASH_PAR_ALIGNMATESGAPMAX" ] && ViashError Bad arguments for option \'--alignMatesGapMax=*\': \'$VIASH_PAR_ALIGNMATESGAPMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNMATESGAPMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignSJoverhangMin)
            [ -n "$VIASH_PAR_ALIGNSJOVERHANGMIN" ] && ViashError Bad arguments for option \'--alignSJoverhangMin\': \'$VIASH_PAR_ALIGNSJOVERHANGMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNSJOVERHANGMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignSJoverhangMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignSJoverhangMin=*)
            [ -n "$VIASH_PAR_ALIGNSJOVERHANGMIN" ] && ViashError Bad arguments for option \'--alignSJoverhangMin=*\': \'$VIASH_PAR_ALIGNSJOVERHANGMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNSJOVERHANGMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignSJstitchMismatchNmax)
            if [ -z "$VIASH_PAR_ALIGNSJSTITCHMISMATCHNMAX" ]; then
              VIASH_PAR_ALIGNSJSTITCHMISMATCHNMAX="$2"
            else
              VIASH_PAR_ALIGNSJSTITCHMISMATCHNMAX="$VIASH_PAR_ALIGNSJSTITCHMISMATCHNMAX;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignSJstitchMismatchNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignSJstitchMismatchNmax=*)
            if [ -z "$VIASH_PAR_ALIGNSJSTITCHMISMATCHNMAX" ]; then
              VIASH_PAR_ALIGNSJSTITCHMISMATCHNMAX=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_ALIGNSJSTITCHMISMATCHNMAX="$VIASH_PAR_ALIGNSJSTITCHMISMATCHNMAX;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --alignSJDBoverhangMin)
            [ -n "$VIASH_PAR_ALIGNSJDBOVERHANGMIN" ] && ViashError Bad arguments for option \'--alignSJDBoverhangMin\': \'$VIASH_PAR_ALIGNSJDBOVERHANGMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNSJDBOVERHANGMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignSJDBoverhangMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignSJDBoverhangMin=*)
            [ -n "$VIASH_PAR_ALIGNSJDBOVERHANGMIN" ] && ViashError Bad arguments for option \'--alignSJDBoverhangMin=*\': \'$VIASH_PAR_ALIGNSJDBOVERHANGMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNSJDBOVERHANGMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignSplicedMateMapLmin)
            [ -n "$VIASH_PAR_ALIGNSPLICEDMATEMAPLMIN" ] && ViashError Bad arguments for option \'--alignSplicedMateMapLmin\': \'$VIASH_PAR_ALIGNSPLICEDMATEMAPLMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNSPLICEDMATEMAPLMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignSplicedMateMapLmin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignSplicedMateMapLmin=*)
            [ -n "$VIASH_PAR_ALIGNSPLICEDMATEMAPLMIN" ] && ViashError Bad arguments for option \'--alignSplicedMateMapLmin=*\': \'$VIASH_PAR_ALIGNSPLICEDMATEMAPLMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNSPLICEDMATEMAPLMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignSplicedMateMapLminOverLmate)
            [ -n "$VIASH_PAR_ALIGNSPLICEDMATEMAPLMINOVERLMATE" ] && ViashError Bad arguments for option \'--alignSplicedMateMapLminOverLmate\': \'$VIASH_PAR_ALIGNSPLICEDMATEMAPLMINOVERLMATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNSPLICEDMATEMAPLMINOVERLMATE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignSplicedMateMapLminOverLmate. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignSplicedMateMapLminOverLmate=*)
            [ -n "$VIASH_PAR_ALIGNSPLICEDMATEMAPLMINOVERLMATE" ] && ViashError Bad arguments for option \'--alignSplicedMateMapLminOverLmate=*\': \'$VIASH_PAR_ALIGNSPLICEDMATEMAPLMINOVERLMATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNSPLICEDMATEMAPLMINOVERLMATE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignWindowsPerReadNmax)
            [ -n "$VIASH_PAR_ALIGNWINDOWSPERREADNMAX" ] && ViashError Bad arguments for option \'--alignWindowsPerReadNmax\': \'$VIASH_PAR_ALIGNWINDOWSPERREADNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNWINDOWSPERREADNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignWindowsPerReadNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignWindowsPerReadNmax=*)
            [ -n "$VIASH_PAR_ALIGNWINDOWSPERREADNMAX" ] && ViashError Bad arguments for option \'--alignWindowsPerReadNmax=*\': \'$VIASH_PAR_ALIGNWINDOWSPERREADNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNWINDOWSPERREADNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignTranscriptsPerWindowNmax)
            [ -n "$VIASH_PAR_ALIGNTRANSCRIPTSPERWINDOWNMAX" ] && ViashError Bad arguments for option \'--alignTranscriptsPerWindowNmax\': \'$VIASH_PAR_ALIGNTRANSCRIPTSPERWINDOWNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNTRANSCRIPTSPERWINDOWNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignTranscriptsPerWindowNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignTranscriptsPerWindowNmax=*)
            [ -n "$VIASH_PAR_ALIGNTRANSCRIPTSPERWINDOWNMAX" ] && ViashError Bad arguments for option \'--alignTranscriptsPerWindowNmax=*\': \'$VIASH_PAR_ALIGNTRANSCRIPTSPERWINDOWNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNTRANSCRIPTSPERWINDOWNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignTranscriptsPerReadNmax)
            [ -n "$VIASH_PAR_ALIGNTRANSCRIPTSPERREADNMAX" ] && ViashError Bad arguments for option \'--alignTranscriptsPerReadNmax\': \'$VIASH_PAR_ALIGNTRANSCRIPTSPERREADNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNTRANSCRIPTSPERREADNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignTranscriptsPerReadNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignTranscriptsPerReadNmax=*)
            [ -n "$VIASH_PAR_ALIGNTRANSCRIPTSPERREADNMAX" ] && ViashError Bad arguments for option \'--alignTranscriptsPerReadNmax=*\': \'$VIASH_PAR_ALIGNTRANSCRIPTSPERREADNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNTRANSCRIPTSPERREADNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignEndsType)
            [ -n "$VIASH_PAR_ALIGNENDSTYPE" ] && ViashError Bad arguments for option \'--alignEndsType\': \'$VIASH_PAR_ALIGNENDSTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNENDSTYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignEndsType. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignEndsType=*)
            [ -n "$VIASH_PAR_ALIGNENDSTYPE" ] && ViashError Bad arguments for option \'--alignEndsType=*\': \'$VIASH_PAR_ALIGNENDSTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNENDSTYPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignEndsProtrude)
            [ -n "$VIASH_PAR_ALIGNENDSPROTRUDE" ] && ViashError Bad arguments for option \'--alignEndsProtrude\': \'$VIASH_PAR_ALIGNENDSPROTRUDE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNENDSPROTRUDE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignEndsProtrude. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignEndsProtrude=*)
            [ -n "$VIASH_PAR_ALIGNENDSPROTRUDE" ] && ViashError Bad arguments for option \'--alignEndsProtrude=*\': \'$VIASH_PAR_ALIGNENDSPROTRUDE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNENDSPROTRUDE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignSoftClipAtReferenceEnds)
            [ -n "$VIASH_PAR_ALIGNSOFTCLIPATREFERENCEENDS" ] && ViashError Bad arguments for option \'--alignSoftClipAtReferenceEnds\': \'$VIASH_PAR_ALIGNSOFTCLIPATREFERENCEENDS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNSOFTCLIPATREFERENCEENDS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignSoftClipAtReferenceEnds. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignSoftClipAtReferenceEnds=*)
            [ -n "$VIASH_PAR_ALIGNSOFTCLIPATREFERENCEENDS" ] && ViashError Bad arguments for option \'--alignSoftClipAtReferenceEnds=*\': \'$VIASH_PAR_ALIGNSOFTCLIPATREFERENCEENDS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNSOFTCLIPATREFERENCEENDS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --alignInsertionFlush)
            [ -n "$VIASH_PAR_ALIGNINSERTIONFLUSH" ] && ViashError Bad arguments for option \'--alignInsertionFlush\': \'$VIASH_PAR_ALIGNINSERTIONFLUSH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNINSERTIONFLUSH="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --alignInsertionFlush. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --alignInsertionFlush=*)
            [ -n "$VIASH_PAR_ALIGNINSERTIONFLUSH" ] && ViashError Bad arguments for option \'--alignInsertionFlush=*\': \'$VIASH_PAR_ALIGNINSERTIONFLUSH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ALIGNINSERTIONFLUSH=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --peOverlapNbasesMin)
            [ -n "$VIASH_PAR_PEOVERLAPNBASESMIN" ] && ViashError Bad arguments for option \'--peOverlapNbasesMin\': \'$VIASH_PAR_PEOVERLAPNBASESMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PEOVERLAPNBASESMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --peOverlapNbasesMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --peOverlapNbasesMin=*)
            [ -n "$VIASH_PAR_PEOVERLAPNBASESMIN" ] && ViashError Bad arguments for option \'--peOverlapNbasesMin=*\': \'$VIASH_PAR_PEOVERLAPNBASESMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PEOVERLAPNBASESMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --peOverlapMMp)
            [ -n "$VIASH_PAR_PEOVERLAPMMP" ] && ViashError Bad arguments for option \'--peOverlapMMp\': \'$VIASH_PAR_PEOVERLAPMMP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PEOVERLAPMMP="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --peOverlapMMp. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --peOverlapMMp=*)
            [ -n "$VIASH_PAR_PEOVERLAPMMP" ] && ViashError Bad arguments for option \'--peOverlapMMp=*\': \'$VIASH_PAR_PEOVERLAPMMP\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_PEOVERLAPMMP=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --winAnchorMultimapNmax)
            [ -n "$VIASH_PAR_WINANCHORMULTIMAPNMAX" ] && ViashError Bad arguments for option \'--winAnchorMultimapNmax\': \'$VIASH_PAR_WINANCHORMULTIMAPNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WINANCHORMULTIMAPNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --winAnchorMultimapNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --winAnchorMultimapNmax=*)
            [ -n "$VIASH_PAR_WINANCHORMULTIMAPNMAX" ] && ViashError Bad arguments for option \'--winAnchorMultimapNmax=*\': \'$VIASH_PAR_WINANCHORMULTIMAPNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WINANCHORMULTIMAPNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --winBinNbits)
            [ -n "$VIASH_PAR_WINBINNBITS" ] && ViashError Bad arguments for option \'--winBinNbits\': \'$VIASH_PAR_WINBINNBITS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WINBINNBITS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --winBinNbits. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --winBinNbits=*)
            [ -n "$VIASH_PAR_WINBINNBITS" ] && ViashError Bad arguments for option \'--winBinNbits=*\': \'$VIASH_PAR_WINBINNBITS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WINBINNBITS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --winAnchorDistNbins)
            [ -n "$VIASH_PAR_WINANCHORDISTNBINS" ] && ViashError Bad arguments for option \'--winAnchorDistNbins\': \'$VIASH_PAR_WINANCHORDISTNBINS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WINANCHORDISTNBINS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --winAnchorDistNbins. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --winAnchorDistNbins=*)
            [ -n "$VIASH_PAR_WINANCHORDISTNBINS" ] && ViashError Bad arguments for option \'--winAnchorDistNbins=*\': \'$VIASH_PAR_WINANCHORDISTNBINS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WINANCHORDISTNBINS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --winFlankNbins)
            [ -n "$VIASH_PAR_WINFLANKNBINS" ] && ViashError Bad arguments for option \'--winFlankNbins\': \'$VIASH_PAR_WINFLANKNBINS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WINFLANKNBINS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --winFlankNbins. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --winFlankNbins=*)
            [ -n "$VIASH_PAR_WINFLANKNBINS" ] && ViashError Bad arguments for option \'--winFlankNbins=*\': \'$VIASH_PAR_WINFLANKNBINS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WINFLANKNBINS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --winReadCoverageRelativeMin)
            [ -n "$VIASH_PAR_WINREADCOVERAGERELATIVEMIN" ] && ViashError Bad arguments for option \'--winReadCoverageRelativeMin\': \'$VIASH_PAR_WINREADCOVERAGERELATIVEMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WINREADCOVERAGERELATIVEMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --winReadCoverageRelativeMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --winReadCoverageRelativeMin=*)
            [ -n "$VIASH_PAR_WINREADCOVERAGERELATIVEMIN" ] && ViashError Bad arguments for option \'--winReadCoverageRelativeMin=*\': \'$VIASH_PAR_WINREADCOVERAGERELATIVEMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WINREADCOVERAGERELATIVEMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --winReadCoverageBasesMin)
            [ -n "$VIASH_PAR_WINREADCOVERAGEBASESMIN" ] && ViashError Bad arguments for option \'--winReadCoverageBasesMin\': \'$VIASH_PAR_WINREADCOVERAGEBASESMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WINREADCOVERAGEBASESMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --winReadCoverageBasesMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --winReadCoverageBasesMin=*)
            [ -n "$VIASH_PAR_WINREADCOVERAGEBASESMIN" ] && ViashError Bad arguments for option \'--winReadCoverageBasesMin=*\': \'$VIASH_PAR_WINREADCOVERAGEBASESMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WINREADCOVERAGEBASESMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --chimOutType)
            if [ -z "$VIASH_PAR_CHIMOUTTYPE" ]; then
              VIASH_PAR_CHIMOUTTYPE="$2"
            else
              VIASH_PAR_CHIMOUTTYPE="$VIASH_PAR_CHIMOUTTYPE;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimOutType. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimOutType=*)
            if [ -z "$VIASH_PAR_CHIMOUTTYPE" ]; then
              VIASH_PAR_CHIMOUTTYPE=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_CHIMOUTTYPE="$VIASH_PAR_CHIMOUTTYPE;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --chimSegmentMin)
            [ -n "$VIASH_PAR_CHIMSEGMENTMIN" ] && ViashError Bad arguments for option \'--chimSegmentMin\': \'$VIASH_PAR_CHIMSEGMENTMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMSEGMENTMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimSegmentMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimSegmentMin=*)
            [ -n "$VIASH_PAR_CHIMSEGMENTMIN" ] && ViashError Bad arguments for option \'--chimSegmentMin=*\': \'$VIASH_PAR_CHIMSEGMENTMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMSEGMENTMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --chimScoreMin)
            [ -n "$VIASH_PAR_CHIMSCOREMIN" ] && ViashError Bad arguments for option \'--chimScoreMin\': \'$VIASH_PAR_CHIMSCOREMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMSCOREMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimScoreMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimScoreMin=*)
            [ -n "$VIASH_PAR_CHIMSCOREMIN" ] && ViashError Bad arguments for option \'--chimScoreMin=*\': \'$VIASH_PAR_CHIMSCOREMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMSCOREMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --chimScoreDropMax)
            [ -n "$VIASH_PAR_CHIMSCOREDROPMAX" ] && ViashError Bad arguments for option \'--chimScoreDropMax\': \'$VIASH_PAR_CHIMSCOREDROPMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMSCOREDROPMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimScoreDropMax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimScoreDropMax=*)
            [ -n "$VIASH_PAR_CHIMSCOREDROPMAX" ] && ViashError Bad arguments for option \'--chimScoreDropMax=*\': \'$VIASH_PAR_CHIMSCOREDROPMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMSCOREDROPMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --chimScoreSeparation)
            [ -n "$VIASH_PAR_CHIMSCORESEPARATION" ] && ViashError Bad arguments for option \'--chimScoreSeparation\': \'$VIASH_PAR_CHIMSCORESEPARATION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMSCORESEPARATION="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimScoreSeparation. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimScoreSeparation=*)
            [ -n "$VIASH_PAR_CHIMSCORESEPARATION" ] && ViashError Bad arguments for option \'--chimScoreSeparation=*\': \'$VIASH_PAR_CHIMSCORESEPARATION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMSCORESEPARATION=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --chimScoreJunctionNonGTAG)
            [ -n "$VIASH_PAR_CHIMSCOREJUNCTIONNONGTAG" ] && ViashError Bad arguments for option \'--chimScoreJunctionNonGTAG\': \'$VIASH_PAR_CHIMSCOREJUNCTIONNONGTAG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMSCOREJUNCTIONNONGTAG="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimScoreJunctionNonGTAG. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimScoreJunctionNonGTAG=*)
            [ -n "$VIASH_PAR_CHIMSCOREJUNCTIONNONGTAG" ] && ViashError Bad arguments for option \'--chimScoreJunctionNonGTAG=*\': \'$VIASH_PAR_CHIMSCOREJUNCTIONNONGTAG\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMSCOREJUNCTIONNONGTAG=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --chimJunctionOverhangMin)
            [ -n "$VIASH_PAR_CHIMJUNCTIONOVERHANGMIN" ] && ViashError Bad arguments for option \'--chimJunctionOverhangMin\': \'$VIASH_PAR_CHIMJUNCTIONOVERHANGMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMJUNCTIONOVERHANGMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimJunctionOverhangMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimJunctionOverhangMin=*)
            [ -n "$VIASH_PAR_CHIMJUNCTIONOVERHANGMIN" ] && ViashError Bad arguments for option \'--chimJunctionOverhangMin=*\': \'$VIASH_PAR_CHIMJUNCTIONOVERHANGMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMJUNCTIONOVERHANGMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --chimSegmentReadGapMax)
            [ -n "$VIASH_PAR_CHIMSEGMENTREADGAPMAX" ] && ViashError Bad arguments for option \'--chimSegmentReadGapMax\': \'$VIASH_PAR_CHIMSEGMENTREADGAPMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMSEGMENTREADGAPMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimSegmentReadGapMax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimSegmentReadGapMax=*)
            [ -n "$VIASH_PAR_CHIMSEGMENTREADGAPMAX" ] && ViashError Bad arguments for option \'--chimSegmentReadGapMax=*\': \'$VIASH_PAR_CHIMSEGMENTREADGAPMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMSEGMENTREADGAPMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --chimFilter)
            if [ -z "$VIASH_PAR_CHIMFILTER" ]; then
              VIASH_PAR_CHIMFILTER="$2"
            else
              VIASH_PAR_CHIMFILTER="$VIASH_PAR_CHIMFILTER;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimFilter. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimFilter=*)
            if [ -z "$VIASH_PAR_CHIMFILTER" ]; then
              VIASH_PAR_CHIMFILTER=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_CHIMFILTER="$VIASH_PAR_CHIMFILTER;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --chimMainSegmentMultNmax)
            [ -n "$VIASH_PAR_CHIMMAINSEGMENTMULTNMAX" ] && ViashError Bad arguments for option \'--chimMainSegmentMultNmax\': \'$VIASH_PAR_CHIMMAINSEGMENTMULTNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMMAINSEGMENTMULTNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimMainSegmentMultNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimMainSegmentMultNmax=*)
            [ -n "$VIASH_PAR_CHIMMAINSEGMENTMULTNMAX" ] && ViashError Bad arguments for option \'--chimMainSegmentMultNmax=*\': \'$VIASH_PAR_CHIMMAINSEGMENTMULTNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMMAINSEGMENTMULTNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --chimMultimapNmax)
            [ -n "$VIASH_PAR_CHIMMULTIMAPNMAX" ] && ViashError Bad arguments for option \'--chimMultimapNmax\': \'$VIASH_PAR_CHIMMULTIMAPNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMMULTIMAPNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimMultimapNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimMultimapNmax=*)
            [ -n "$VIASH_PAR_CHIMMULTIMAPNMAX" ] && ViashError Bad arguments for option \'--chimMultimapNmax=*\': \'$VIASH_PAR_CHIMMULTIMAPNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMMULTIMAPNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --chimMultimapScoreRange)
            [ -n "$VIASH_PAR_CHIMMULTIMAPSCORERANGE" ] && ViashError Bad arguments for option \'--chimMultimapScoreRange\': \'$VIASH_PAR_CHIMMULTIMAPSCORERANGE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMMULTIMAPSCORERANGE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimMultimapScoreRange. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimMultimapScoreRange=*)
            [ -n "$VIASH_PAR_CHIMMULTIMAPSCORERANGE" ] && ViashError Bad arguments for option \'--chimMultimapScoreRange=*\': \'$VIASH_PAR_CHIMMULTIMAPSCORERANGE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMMULTIMAPSCORERANGE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --chimNonchimScoreDropMin)
            [ -n "$VIASH_PAR_CHIMNONCHIMSCOREDROPMIN" ] && ViashError Bad arguments for option \'--chimNonchimScoreDropMin\': \'$VIASH_PAR_CHIMNONCHIMSCOREDROPMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMNONCHIMSCOREDROPMIN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimNonchimScoreDropMin. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimNonchimScoreDropMin=*)
            [ -n "$VIASH_PAR_CHIMNONCHIMSCOREDROPMIN" ] && ViashError Bad arguments for option \'--chimNonchimScoreDropMin=*\': \'$VIASH_PAR_CHIMNONCHIMSCOREDROPMIN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMNONCHIMSCOREDROPMIN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --chimOutJunctionFormat)
            [ -n "$VIASH_PAR_CHIMOUTJUNCTIONFORMAT" ] && ViashError Bad arguments for option \'--chimOutJunctionFormat\': \'$VIASH_PAR_CHIMOUTJUNCTIONFORMAT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMOUTJUNCTIONFORMAT="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --chimOutJunctionFormat. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --chimOutJunctionFormat=*)
            [ -n "$VIASH_PAR_CHIMOUTJUNCTIONFORMAT" ] && ViashError Bad arguments for option \'--chimOutJunctionFormat=*\': \'$VIASH_PAR_CHIMOUTJUNCTIONFORMAT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_CHIMOUTJUNCTIONFORMAT=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --quantMode)
            if [ -z "$VIASH_PAR_QUANTMODE" ]; then
              VIASH_PAR_QUANTMODE="$2"
            else
              VIASH_PAR_QUANTMODE="$VIASH_PAR_QUANTMODE;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --quantMode. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --quantMode=*)
            if [ -z "$VIASH_PAR_QUANTMODE" ]; then
              VIASH_PAR_QUANTMODE=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_QUANTMODE="$VIASH_PAR_QUANTMODE;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --quantTranscriptomeBAMcompression)
            [ -n "$VIASH_PAR_QUANTTRANSCRIPTOMEBAMCOMPRESSION" ] && ViashError Bad arguments for option \'--quantTranscriptomeBAMcompression\': \'$VIASH_PAR_QUANTTRANSCRIPTOMEBAMCOMPRESSION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUANTTRANSCRIPTOMEBAMCOMPRESSION="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --quantTranscriptomeBAMcompression. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --quantTranscriptomeBAMcompression=*)
            [ -n "$VIASH_PAR_QUANTTRANSCRIPTOMEBAMCOMPRESSION" ] && ViashError Bad arguments for option \'--quantTranscriptomeBAMcompression=*\': \'$VIASH_PAR_QUANTTRANSCRIPTOMEBAMCOMPRESSION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUANTTRANSCRIPTOMEBAMCOMPRESSION=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --quantTranscriptomeBan)
            [ -n "$VIASH_PAR_QUANTTRANSCRIPTOMEBAN" ] && ViashError Bad arguments for option \'--quantTranscriptomeBan\': \'$VIASH_PAR_QUANTTRANSCRIPTOMEBAN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUANTTRANSCRIPTOMEBAN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --quantTranscriptomeBan. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --quantTranscriptomeBan=*)
            [ -n "$VIASH_PAR_QUANTTRANSCRIPTOMEBAN" ] && ViashError Bad arguments for option \'--quantTranscriptomeBan=*\': \'$VIASH_PAR_QUANTTRANSCRIPTOMEBAN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_QUANTTRANSCRIPTOMEBAN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --twopassMode)
            [ -n "$VIASH_PAR_TWOPASSMODE" ] && ViashError Bad arguments for option \'--twopassMode\': \'$VIASH_PAR_TWOPASSMODE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TWOPASSMODE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --twopassMode. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --twopassMode=*)
            [ -n "$VIASH_PAR_TWOPASSMODE" ] && ViashError Bad arguments for option \'--twopassMode=*\': \'$VIASH_PAR_TWOPASSMODE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TWOPASSMODE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --twopass1readsN)
            [ -n "$VIASH_PAR_TWOPASS1READSN" ] && ViashError Bad arguments for option \'--twopass1readsN\': \'$VIASH_PAR_TWOPASS1READSN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TWOPASS1READSN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --twopass1readsN. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --twopass1readsN=*)
            [ -n "$VIASH_PAR_TWOPASS1READSN" ] && ViashError Bad arguments for option \'--twopass1readsN=*\': \'$VIASH_PAR_TWOPASS1READSN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TWOPASS1READSN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --waspOutputMode)
            [ -n "$VIASH_PAR_WASPOUTPUTMODE" ] && ViashError Bad arguments for option \'--waspOutputMode\': \'$VIASH_PAR_WASPOUTPUTMODE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WASPOUTPUTMODE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --waspOutputMode. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --waspOutputMode=*)
            [ -n "$VIASH_PAR_WASPOUTPUTMODE" ] && ViashError Bad arguments for option \'--waspOutputMode=*\': \'$VIASH_PAR_WASPOUTPUTMODE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_WASPOUTPUTMODE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --soloType)
            if [ -z "$VIASH_PAR_SOLOTYPE" ]; then
              VIASH_PAR_SOLOTYPE="$2"
            else
              VIASH_PAR_SOLOTYPE="$VIASH_PAR_SOLOTYPE;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloType. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloType=*)
            if [ -z "$VIASH_PAR_SOLOTYPE" ]; then
              VIASH_PAR_SOLOTYPE=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SOLOTYPE="$VIASH_PAR_SOLOTYPE;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --soloCBwhitelist)
            if [ -z "$VIASH_PAR_SOLOCBWHITELIST" ]; then
              VIASH_PAR_SOLOCBWHITELIST="$2"
            else
              VIASH_PAR_SOLOCBWHITELIST="$VIASH_PAR_SOLOCBWHITELIST;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloCBwhitelist. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloCBwhitelist=*)
            if [ -z "$VIASH_PAR_SOLOCBWHITELIST" ]; then
              VIASH_PAR_SOLOCBWHITELIST=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SOLOCBWHITELIST="$VIASH_PAR_SOLOCBWHITELIST;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --soloCBstart)
            [ -n "$VIASH_PAR_SOLOCBSTART" ] && ViashError Bad arguments for option \'--soloCBstart\': \'$VIASH_PAR_SOLOCBSTART\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOCBSTART="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloCBstart. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloCBstart=*)
            [ -n "$VIASH_PAR_SOLOCBSTART" ] && ViashError Bad arguments for option \'--soloCBstart=*\': \'$VIASH_PAR_SOLOCBSTART\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOCBSTART=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --soloCBlen)
            [ -n "$VIASH_PAR_SOLOCBLEN" ] && ViashError Bad arguments for option \'--soloCBlen\': \'$VIASH_PAR_SOLOCBLEN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOCBLEN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloCBlen. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloCBlen=*)
            [ -n "$VIASH_PAR_SOLOCBLEN" ] && ViashError Bad arguments for option \'--soloCBlen=*\': \'$VIASH_PAR_SOLOCBLEN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOCBLEN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --soloUMIstart)
            [ -n "$VIASH_PAR_SOLOUMISTART" ] && ViashError Bad arguments for option \'--soloUMIstart\': \'$VIASH_PAR_SOLOUMISTART\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOUMISTART="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloUMIstart. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloUMIstart=*)
            [ -n "$VIASH_PAR_SOLOUMISTART" ] && ViashError Bad arguments for option \'--soloUMIstart=*\': \'$VIASH_PAR_SOLOUMISTART\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOUMISTART=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --soloUMIlen)
            [ -n "$VIASH_PAR_SOLOUMILEN" ] && ViashError Bad arguments for option \'--soloUMIlen\': \'$VIASH_PAR_SOLOUMILEN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOUMILEN="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloUMIlen. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloUMIlen=*)
            [ -n "$VIASH_PAR_SOLOUMILEN" ] && ViashError Bad arguments for option \'--soloUMIlen=*\': \'$VIASH_PAR_SOLOUMILEN\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOUMILEN=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --soloBarcodeReadLength)
            [ -n "$VIASH_PAR_SOLOBARCODEREADLENGTH" ] && ViashError Bad arguments for option \'--soloBarcodeReadLength\': \'$VIASH_PAR_SOLOBARCODEREADLENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOBARCODEREADLENGTH="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloBarcodeReadLength. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloBarcodeReadLength=*)
            [ -n "$VIASH_PAR_SOLOBARCODEREADLENGTH" ] && ViashError Bad arguments for option \'--soloBarcodeReadLength=*\': \'$VIASH_PAR_SOLOBARCODEREADLENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOBARCODEREADLENGTH=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --soloBarcodeMate)
            [ -n "$VIASH_PAR_SOLOBARCODEMATE" ] && ViashError Bad arguments for option \'--soloBarcodeMate\': \'$VIASH_PAR_SOLOBARCODEMATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOBARCODEMATE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloBarcodeMate. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloBarcodeMate=*)
            [ -n "$VIASH_PAR_SOLOBARCODEMATE" ] && ViashError Bad arguments for option \'--soloBarcodeMate=*\': \'$VIASH_PAR_SOLOBARCODEMATE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOBARCODEMATE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --soloCBposition)
            if [ -z "$VIASH_PAR_SOLOCBPOSITION" ]; then
              VIASH_PAR_SOLOCBPOSITION="$2"
            else
              VIASH_PAR_SOLOCBPOSITION="$VIASH_PAR_SOLOCBPOSITION;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloCBposition. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloCBposition=*)
            if [ -z "$VIASH_PAR_SOLOCBPOSITION" ]; then
              VIASH_PAR_SOLOCBPOSITION=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SOLOCBPOSITION="$VIASH_PAR_SOLOCBPOSITION;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --soloUMIposition)
            [ -n "$VIASH_PAR_SOLOUMIPOSITION" ] && ViashError Bad arguments for option \'--soloUMIposition\': \'$VIASH_PAR_SOLOUMIPOSITION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOUMIPOSITION="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloUMIposition. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloUMIposition=*)
            [ -n "$VIASH_PAR_SOLOUMIPOSITION" ] && ViashError Bad arguments for option \'--soloUMIposition=*\': \'$VIASH_PAR_SOLOUMIPOSITION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOUMIPOSITION=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --soloAdapterSequence)
            [ -n "$VIASH_PAR_SOLOADAPTERSEQUENCE" ] && ViashError Bad arguments for option \'--soloAdapterSequence\': \'$VIASH_PAR_SOLOADAPTERSEQUENCE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOADAPTERSEQUENCE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloAdapterSequence. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloAdapterSequence=*)
            [ -n "$VIASH_PAR_SOLOADAPTERSEQUENCE" ] && ViashError Bad arguments for option \'--soloAdapterSequence=*\': \'$VIASH_PAR_SOLOADAPTERSEQUENCE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOADAPTERSEQUENCE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --soloAdapterMismatchesNmax)
            [ -n "$VIASH_PAR_SOLOADAPTERMISMATCHESNMAX" ] && ViashError Bad arguments for option \'--soloAdapterMismatchesNmax\': \'$VIASH_PAR_SOLOADAPTERMISMATCHESNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOADAPTERMISMATCHESNMAX="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloAdapterMismatchesNmax. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloAdapterMismatchesNmax=*)
            [ -n "$VIASH_PAR_SOLOADAPTERMISMATCHESNMAX" ] && ViashError Bad arguments for option \'--soloAdapterMismatchesNmax=*\': \'$VIASH_PAR_SOLOADAPTERMISMATCHESNMAX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOADAPTERMISMATCHESNMAX=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --soloCBmatchWLtype)
            [ -n "$VIASH_PAR_SOLOCBMATCHWLTYPE" ] && ViashError Bad arguments for option \'--soloCBmatchWLtype\': \'$VIASH_PAR_SOLOCBMATCHWLTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOCBMATCHWLTYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloCBmatchWLtype. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloCBmatchWLtype=*)
            [ -n "$VIASH_PAR_SOLOCBMATCHWLTYPE" ] && ViashError Bad arguments for option \'--soloCBmatchWLtype=*\': \'$VIASH_PAR_SOLOCBMATCHWLTYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOCBMATCHWLTYPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --soloInputSAMattrBarcodeSeq)
            if [ -z "$VIASH_PAR_SOLOINPUTSAMATTRBARCODESEQ" ]; then
              VIASH_PAR_SOLOINPUTSAMATTRBARCODESEQ="$2"
            else
              VIASH_PAR_SOLOINPUTSAMATTRBARCODESEQ="$VIASH_PAR_SOLOINPUTSAMATTRBARCODESEQ;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloInputSAMattrBarcodeSeq. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloInputSAMattrBarcodeSeq=*)
            if [ -z "$VIASH_PAR_SOLOINPUTSAMATTRBARCODESEQ" ]; then
              VIASH_PAR_SOLOINPUTSAMATTRBARCODESEQ=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SOLOINPUTSAMATTRBARCODESEQ="$VIASH_PAR_SOLOINPUTSAMATTRBARCODESEQ;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --soloInputSAMattrBarcodeQual)
            if [ -z "$VIASH_PAR_SOLOINPUTSAMATTRBARCODEQUAL" ]; then
              VIASH_PAR_SOLOINPUTSAMATTRBARCODEQUAL="$2"
            else
              VIASH_PAR_SOLOINPUTSAMATTRBARCODEQUAL="$VIASH_PAR_SOLOINPUTSAMATTRBARCODEQUAL;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloInputSAMattrBarcodeQual. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloInputSAMattrBarcodeQual=*)
            if [ -z "$VIASH_PAR_SOLOINPUTSAMATTRBARCODEQUAL" ]; then
              VIASH_PAR_SOLOINPUTSAMATTRBARCODEQUAL=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SOLOINPUTSAMATTRBARCODEQUAL="$VIASH_PAR_SOLOINPUTSAMATTRBARCODEQUAL;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --soloStrand)
            [ -n "$VIASH_PAR_SOLOSTRAND" ] && ViashError Bad arguments for option \'--soloStrand\': \'$VIASH_PAR_SOLOSTRAND\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOSTRAND="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloStrand. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloStrand=*)
            [ -n "$VIASH_PAR_SOLOSTRAND" ] && ViashError Bad arguments for option \'--soloStrand=*\': \'$VIASH_PAR_SOLOSTRAND\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOSTRAND=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --soloFeatures)
            if [ -z "$VIASH_PAR_SOLOFEATURES" ]; then
              VIASH_PAR_SOLOFEATURES="$2"
            else
              VIASH_PAR_SOLOFEATURES="$VIASH_PAR_SOLOFEATURES;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloFeatures. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloFeatures=*)
            if [ -z "$VIASH_PAR_SOLOFEATURES" ]; then
              VIASH_PAR_SOLOFEATURES=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SOLOFEATURES="$VIASH_PAR_SOLOFEATURES;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --soloMultiMappers)
            if [ -z "$VIASH_PAR_SOLOMULTIMAPPERS" ]; then
              VIASH_PAR_SOLOMULTIMAPPERS="$2"
            else
              VIASH_PAR_SOLOMULTIMAPPERS="$VIASH_PAR_SOLOMULTIMAPPERS;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloMultiMappers. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloMultiMappers=*)
            if [ -z "$VIASH_PAR_SOLOMULTIMAPPERS" ]; then
              VIASH_PAR_SOLOMULTIMAPPERS=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SOLOMULTIMAPPERS="$VIASH_PAR_SOLOMULTIMAPPERS;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --soloUMIdedup)
            if [ -z "$VIASH_PAR_SOLOUMIDEDUP" ]; then
              VIASH_PAR_SOLOUMIDEDUP="$2"
            else
              VIASH_PAR_SOLOUMIDEDUP="$VIASH_PAR_SOLOUMIDEDUP;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloUMIdedup. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloUMIdedup=*)
            if [ -z "$VIASH_PAR_SOLOUMIDEDUP" ]; then
              VIASH_PAR_SOLOUMIDEDUP=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SOLOUMIDEDUP="$VIASH_PAR_SOLOUMIDEDUP;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --soloUMIfiltering)
            if [ -z "$VIASH_PAR_SOLOUMIFILTERING" ]; then
              VIASH_PAR_SOLOUMIFILTERING="$2"
            else
              VIASH_PAR_SOLOUMIFILTERING="$VIASH_PAR_SOLOUMIFILTERING;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloUMIfiltering. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloUMIfiltering=*)
            if [ -z "$VIASH_PAR_SOLOUMIFILTERING" ]; then
              VIASH_PAR_SOLOUMIFILTERING=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SOLOUMIFILTERING="$VIASH_PAR_SOLOUMIFILTERING;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --soloOutFileNames)
            if [ -z "$VIASH_PAR_SOLOOUTFILENAMES" ]; then
              VIASH_PAR_SOLOOUTFILENAMES="$2"
            else
              VIASH_PAR_SOLOOUTFILENAMES="$VIASH_PAR_SOLOOUTFILENAMES;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloOutFileNames. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloOutFileNames=*)
            if [ -z "$VIASH_PAR_SOLOOUTFILENAMES" ]; then
              VIASH_PAR_SOLOOUTFILENAMES=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SOLOOUTFILENAMES="$VIASH_PAR_SOLOOUTFILENAMES;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --soloCellFilter)
            if [ -z "$VIASH_PAR_SOLOCELLFILTER" ]; then
              VIASH_PAR_SOLOCELLFILTER="$2"
            else
              VIASH_PAR_SOLOCELLFILTER="$VIASH_PAR_SOLOCELLFILTER;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloCellFilter. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloCellFilter=*)
            if [ -z "$VIASH_PAR_SOLOCELLFILTER" ]; then
              VIASH_PAR_SOLOCELLFILTER=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SOLOCELLFILTER="$VIASH_PAR_SOLOCELLFILTER;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --soloOutFormatFeaturesGeneField3)
            if [ -z "$VIASH_PAR_SOLOOUTFORMATFEATURESGENEFIELD3" ]; then
              VIASH_PAR_SOLOOUTFORMATFEATURESGENEFIELD3="$2"
            else
              VIASH_PAR_SOLOOUTFORMATFEATURESGENEFIELD3="$VIASH_PAR_SOLOOUTFORMATFEATURESGENEFIELD3;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloOutFormatFeaturesGeneField3. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloOutFormatFeaturesGeneField3=*)
            if [ -z "$VIASH_PAR_SOLOOUTFORMATFEATURESGENEFIELD3" ]; then
              VIASH_PAR_SOLOOUTFORMATFEATURESGENEFIELD3=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_SOLOOUTFORMATFEATURESGENEFIELD3="$VIASH_PAR_SOLOOUTFORMATFEATURESGENEFIELD3;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --soloCellReadStats)
            [ -n "$VIASH_PAR_SOLOCELLREADSTATS" ] && ViashError Bad arguments for option \'--soloCellReadStats\': \'$VIASH_PAR_SOLOCELLREADSTATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOCELLREADSTATS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --soloCellReadStats. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --soloCellReadStats=*)
            [ -n "$VIASH_PAR_SOLOCELLREADSTATS" ] && ViashError Bad arguments for option \'--soloCellReadStats=*\': \'$VIASH_PAR_SOLOCELLREADSTATS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SOLOCELLREADSTATS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --stranded)
            [ -n "$VIASH_PAR_STRANDED" ] && ViashError Bad arguments for option \'--stranded\': \'$VIASH_PAR_STRANDED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRANDED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --stranded. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --stranded=*)
            [ -n "$VIASH_PAR_STRANDED" ] && ViashError Bad arguments for option \'--stranded=*\': \'$VIASH_PAR_STRANDED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRANDED=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        -s)
            [ -n "$VIASH_PAR_STRANDED" ] && ViashError Bad arguments for option \'-s\': \'$VIASH_PAR_STRANDED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_STRANDED="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to -s. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --minimum_alignment_quality)
            [ -n "$VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY" ] && ViashError Bad arguments for option \'--minimum_alignment_quality\': \'$VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --minimum_alignment_quality. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --minimum_alignment_quality=*)
            [ -n "$VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY" ] && ViashError Bad arguments for option \'--minimum_alignment_quality=*\': \'$VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        -a)
            [ -n "$VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY" ] && ViashError Bad arguments for option \'-a\': \'$VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to -a. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --minaqual)
            [ -n "$VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY" ] && ViashError Bad arguments for option \'--minaqual\': \'$VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --minaqual. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --type)
            [ -n "$VIASH_PAR_TYPE" ] && ViashError Bad arguments for option \'--type\': \'$VIASH_PAR_TYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --type. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --type=*)
            [ -n "$VIASH_PAR_TYPE" ] && ViashError Bad arguments for option \'--type=*\': \'$VIASH_PAR_TYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TYPE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        -t)
            [ -n "$VIASH_PAR_TYPE" ] && ViashError Bad arguments for option \'-t\': \'$VIASH_PAR_TYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_TYPE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to -t. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --id_attribute)
            if [ -z "$VIASH_PAR_ID_ATTRIBUTE" ]; then
              VIASH_PAR_ID_ATTRIBUTE="$2"
            else
              VIASH_PAR_ID_ATTRIBUTE="$VIASH_PAR_ID_ATTRIBUTE;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --id_attribute. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --id_attribute=*)
            if [ -z "$VIASH_PAR_ID_ATTRIBUTE" ]; then
              VIASH_PAR_ID_ATTRIBUTE=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_ID_ATTRIBUTE="$VIASH_PAR_ID_ATTRIBUTE;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        -i)
            if [ -z "$VIASH_PAR_ID_ATTRIBUTE" ]; then
              VIASH_PAR_ID_ATTRIBUTE="$2"
            else
              VIASH_PAR_ID_ATTRIBUTE="$VIASH_PAR_ID_ATTRIBUTE;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to -i. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --additional_attributes)
            if [ -z "$VIASH_PAR_ADDITIONAL_ATTRIBUTES" ]; then
              VIASH_PAR_ADDITIONAL_ATTRIBUTES="$2"
            else
              VIASH_PAR_ADDITIONAL_ATTRIBUTES="$VIASH_PAR_ADDITIONAL_ATTRIBUTES;""$2"
            fi
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --additional_attributes. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --additional_attributes=*)
            if [ -z "$VIASH_PAR_ADDITIONAL_ATTRIBUTES" ]; then
              VIASH_PAR_ADDITIONAL_ATTRIBUTES=$(ViashRemoveFlags "$1")
            else
              VIASH_PAR_ADDITIONAL_ATTRIBUTES="$VIASH_PAR_ADDITIONAL_ATTRIBUTES;"$(ViashRemoveFlags "$1")
            fi
            shift 1
            ;;
        --add_chromosome_info)
            [ -n "$VIASH_PAR_ADD_CHROMOSOME_INFO" ] && ViashError Bad arguments for option \'--add_chromosome_info\': \'$VIASH_PAR_ADD_CHROMOSOME_INFO\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_ADD_CHROMOSOME_INFO=true
            shift 1
            ;;
        --mode)
            [ -n "$VIASH_PAR_MODE" ] && ViashError Bad arguments for option \'--mode\': \'$VIASH_PAR_MODE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MODE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --mode. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --mode=*)
            [ -n "$VIASH_PAR_MODE" ] && ViashError Bad arguments for option \'--mode=*\': \'$VIASH_PAR_MODE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MODE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        -m)
            [ -n "$VIASH_PAR_MODE" ] && ViashError Bad arguments for option \'-m\': \'$VIASH_PAR_MODE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_MODE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to -m. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --non_unique)
            [ -n "$VIASH_PAR_NON_UNIQUE" ] && ViashError Bad arguments for option \'--non_unique\': \'$VIASH_PAR_NON_UNIQUE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_NON_UNIQUE="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --non_unique. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --non_unique=*)
            [ -n "$VIASH_PAR_NON_UNIQUE" ] && ViashError Bad arguments for option \'--non_unique=*\': \'$VIASH_PAR_NON_UNIQUE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_NON_UNIQUE=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --secondary_alignments)
            [ -n "$VIASH_PAR_SECONDARY_ALIGNMENTS" ] && ViashError Bad arguments for option \'--secondary_alignments\': \'$VIASH_PAR_SECONDARY_ALIGNMENTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SECONDARY_ALIGNMENTS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --secondary_alignments. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --secondary_alignments=*)
            [ -n "$VIASH_PAR_SECONDARY_ALIGNMENTS" ] && ViashError Bad arguments for option \'--secondary_alignments=*\': \'$VIASH_PAR_SECONDARY_ALIGNMENTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SECONDARY_ALIGNMENTS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --supplementary_alignments)
            [ -n "$VIASH_PAR_SUPPLEMENTARY_ALIGNMENTS" ] && ViashError Bad arguments for option \'--supplementary_alignments\': \'$VIASH_PAR_SUPPLEMENTARY_ALIGNMENTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SUPPLEMENTARY_ALIGNMENTS="$2"
            [ $# -lt 2 ] && ViashError Not enough arguments passed to --supplementary_alignments. Use "--help" to get more information on the parameters. && exit 1
            shift 2
            ;;
        --supplementary_alignments=*)
            [ -n "$VIASH_PAR_SUPPLEMENTARY_ALIGNMENTS" ] && ViashError Bad arguments for option \'--supplementary_alignments=*\': \'$VIASH_PAR_SUPPLEMENTARY_ALIGNMENTS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_SUPPLEMENTARY_ALIGNMENTS=$(ViashRemoveFlags "$1")
            shift 1
            ;;
        --counts_output_sparse)
            [ -n "$VIASH_PAR_COUNTS_OUTPUT_SPARSE" ] && ViashError Bad arguments for option \'--counts_output_sparse\': \'$VIASH_PAR_COUNTS_OUTPUT_SPARSE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
            VIASH_PAR_COUNTS_OUTPUT_SPARSE=true
            shift 1
            ;;
        ---engine)
            VIASH_ENGINE_ID="$2"
            shift 2
            ;;
        ---engine=*)
            VIASH_ENGINE_ID="$(ViashRemoveFlags "$1")"
            shift 1
            ;;
        ---setup)
            VIASH_MODE='setup'
            VIASH_SETUP_STRATEGY="$2"
            shift 2
            ;;
        ---setup=*)
            VIASH_MODE='setup'
            VIASH_SETUP_STRATEGY="$(ViashRemoveFlags "$1")"
            shift 1
            ;;
        ---dockerfile)
            VIASH_MODE='dockerfile'
            shift 1
            ;;
        ---docker_run_args)
            VIASH_DOCKER_RUN_ARGS+=("$2")
            shift 2
            ;;
        ---docker_run_args=*)
            VIASH_DOCKER_RUN_ARGS+=("$(ViashRemoveFlags "$1")")
            shift 1
            ;;
        ---docker_image_id)
            VIASH_MODE='docker_image_id'
            shift 1
            ;;
        ---debug)
            VIASH_MODE='debug'
            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'
elif   [ "$VIASH_ENGINE_ID" == "docker" ]  ; then
  VIASH_ENGINE_TYPE='docker'
else
  ViashError "Engine '$VIASH_ENGINE_ID' is not recognized. Options are: docker, native."
  exit 1
fi

if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then
  # check if docker is installed properly
  ViashDockerInstallationCheck

  # determine docker image id
  if [[ "$VIASH_ENGINE_ID" == 'docker' ]]; then
    VIASH_DOCKER_IMAGE_ID='images.viash-hub.com/vsh/openpipeline/mapping/multi_star:v4.0.2'
  fi

  # print dockerfile
  if [ "$VIASH_MODE" == "dockerfile" ]; then
    ViashDockerfile "$VIASH_ENGINE_ID"
    exit 0

  elif [ "$VIASH_MODE" == "docker_image_id" ]; then
    echo "$VIASH_DOCKER_IMAGE_ID"
    exit 0
  
  # enter docker container
  elif [[ "$VIASH_MODE" == "debug" ]]; then
    VIASH_CMD="docker run --entrypoint=bash ${VIASH_DOCKER_RUN_ARGS[@]} -v '$(pwd)':/pwd --workdir /pwd -t $VIASH_DOCKER_IMAGE_ID"
    ViashNotice "+ $VIASH_CMD"
    eval $VIASH_CMD
    exit 

  # build docker image
  elif [ "$VIASH_MODE" == "setup" ]; then
    ViashDockerSetup "$VIASH_DOCKER_IMAGE_ID" "$VIASH_SETUP_STRATEGY"
    ViashDockerCheckCommands "$VIASH_DOCKER_IMAGE_ID" 'bash'
    exit 0
  fi

  # check if docker image exists
  ViashDockerSetup "$VIASH_DOCKER_IMAGE_ID" ifneedbepullelsecachedbuild
  ViashDockerCheckCommands "$VIASH_DOCKER_IMAGE_ID" 'bash'
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_INPUT_ID+x} ]; then
  ViashError '--input_id' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi
if [ -z ${VIASH_PAR_INPUT_R1+x} ]; then
  ViashError '--input_r1' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi
if [ -z ${VIASH_PAR_REFERENCE_INDEX+x} ]; then
  ViashError '--reference_index' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi
if [ -z ${VIASH_PAR_REFERENCE_GTF+x} ]; then
  ViashError '--reference_gtf' is a required argument. Use "--help" to get more information on the parameters.
  exit 1
fi
if [ -z ${VIASH_PAR_OUTPUT+x} ]; then
  ViashError '--output' 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_RUN_HTSEQ_COUNT+x} ]; then
  VIASH_PAR_RUN_HTSEQ_COUNT="true"
fi
if [ -z ${VIASH_PAR_RUN_MULTIQC+x} ]; then
  VIASH_PAR_RUN_MULTIQC="true"
fi
if [ -z ${VIASH_PAR_MIN_SUCCESS_RATE+x} ]; then
  VIASH_PAR_MIN_SUCCESS_RATE="0.5"
fi
if [ -z ${VIASH_PAR_STRANDED+x} ]; then
  VIASH_PAR_STRANDED="yes"
fi
if [ -z ${VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY+x} ]; then
  VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY="10"
fi
if [ -z ${VIASH_PAR_ADD_CHROMOSOME_INFO+x} ]; then
  VIASH_PAR_ADD_CHROMOSOME_INFO="false"
fi
if [ -z ${VIASH_PAR_MODE+x} ]; then
  VIASH_PAR_MODE="union"
fi
if [ -z ${VIASH_PAR_NON_UNIQUE+x} ]; then
  VIASH_PAR_NON_UNIQUE="none"
fi
if [ -z ${VIASH_PAR_COUNTS_OUTPUT_SPARSE+x} ]; then
  VIASH_PAR_COUNTS_OUTPUT_SPARSE="false"
fi

# check whether required files exist
if [ ! -z "$VIASH_PAR_INPUT_R1" ]; then
  IFS=';'
  set -f
  for file in $VIASH_PAR_INPUT_R1; do
    unset IFS
    if [ ! -e "$file" ]; then
      ViashError "Input file '$file' does not exist."
      exit 1
    fi
  done
  set +f
fi
if [ ! -z "$VIASH_PAR_INPUT_R2" ]; then
  IFS=';'
  set -f
  for file in $VIASH_PAR_INPUT_R2; do
    unset IFS
    if [ ! -e "$file" ]; then
      ViashError "Input file '$file' does not exist."
      exit 1
    fi
  done
  set +f
fi
if [ ! -z "$VIASH_PAR_REFERENCE_INDEX" ] && [ ! -e "$VIASH_PAR_REFERENCE_INDEX" ]; then
  ViashError "Input file '$VIASH_PAR_REFERENCE_INDEX' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_REFERENCE_GTF" ] && [ ! -e "$VIASH_PAR_REFERENCE_GTF" ]; then
  ViashError "Input file '$VIASH_PAR_REFERENCE_GTF' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_GENOMEFASTAFILES" ]; then
  IFS=';'
  set -f
  for file in $VIASH_PAR_GENOMEFASTAFILES; do
    unset IFS
    if [ ! -e "$file" ]; then
      ViashError "Input file '$file' does not exist."
      exit 1
    fi
  done
  set +f
fi
if [ ! -z "$VIASH_PAR_SJDBGTFFILE" ] && [ ! -e "$VIASH_PAR_SJDBGTFFILE" ]; then
  ViashError "Input file '$VIASH_PAR_SJDBGTFFILE' does not exist."
  exit 1
fi
if [ ! -z "$VIASH_PAR_READFILESMANIFEST" ] && [ ! -e "$VIASH_PAR_READFILESMANIFEST" ]; then
  ViashError "Input file '$VIASH_PAR_READFILESMANIFEST' does not exist."
  exit 1
fi

# check whether parameters values are of the right type
if [[ -n "$VIASH_PAR_RUN_HTSEQ_COUNT" ]]; then
  if ! [[ "$VIASH_PAR_RUN_HTSEQ_COUNT" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--run_htseq_count' has to be a boolean. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_RUN_MULTIQC" ]]; then
  if ! [[ "$VIASH_PAR_RUN_MULTIQC" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--run_multiqc' has to be a boolean. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_MIN_SUCCESS_RATE" ]]; then
  if ! [[ "$VIASH_PAR_MIN_SUCCESS_RATE" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--min_success_rate' has to be a double. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_RUNRNGSEED" ]]; then
  if ! [[ "$VIASH_PAR_RUNRNGSEED" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--runRNGseed' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SJDBOVERHANG" ]]; then
  if ! [[ "$VIASH_PAR_SJDBOVERHANG" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--sjdbOverhang' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SJDBSCORE" ]]; then
  if ! [[ "$VIASH_PAR_SJDBSCORE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--sjdbScore' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_READMAPNUMBER" ]]; then
  if ! [[ "$VIASH_PAR_READMAPNUMBER" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--readMapNumber' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_READQUALITYSCOREBASE" ]]; then
  if ! [[ "$VIASH_PAR_READQUALITYSCOREBASE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--readQualityScoreBase' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [ -n "$VIASH_PAR_CLIP3PNBASES" ]; then
  IFS=';'
  set -f
  for val in $VIASH_PAR_CLIP3PNBASES; do
    if ! [[ "${val}" =~ ^[-+]?[0-9]+$ ]]; then
      ViashError '--clip3pNbases' has to be an integer. Use "--help" to get more information on the parameters.
      exit 1
    fi
  done
  set +f
  unset IFS
fi

if [ -n "$VIASH_PAR_CLIP3PADAPTERMMP" ]; then
  IFS=';'
  set -f
  for val in $VIASH_PAR_CLIP3PADAPTERMMP; do
    if ! [[ "${val}" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
      ViashError '--clip3pAdapterMMp' has to be a double. Use "--help" to get more information on the parameters.
      exit 1
    fi
  done
  set +f
  unset IFS
fi

if [ -n "$VIASH_PAR_CLIP3PAFTERADAPTERNBASES" ]; then
  IFS=';'
  set -f
  for val in $VIASH_PAR_CLIP3PAFTERADAPTERNBASES; do
    if ! [[ "${val}" =~ ^[-+]?[0-9]+$ ]]; then
      ViashError '--clip3pAfterAdapterNbases' has to be an integer. Use "--help" to get more information on the parameters.
      exit 1
    fi
  done
  set +f
  unset IFS
fi

if [ -n "$VIASH_PAR_CLIP5PNBASES" ]; then
  IFS=';'
  set -f
  for val in $VIASH_PAR_CLIP5PNBASES; do
    if ! [[ "${val}" =~ ^[-+]?[0-9]+$ ]]; then
      ViashError '--clip5pNbases' has to be an integer. Use "--help" to get more information on the parameters.
      exit 1
    fi
  done
  set +f
  unset IFS
fi

if [[ -n "$VIASH_PAR_LIMITGENOMEGENERATERAM" ]]; then
  if ! [[ "$VIASH_PAR_LIMITGENOMEGENERATERAM" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--limitGenomeGenerateRAM' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [ -n "$VIASH_PAR_LIMITIOBUFFERSIZE" ]; then
  IFS=';'
  set -f
  for val in $VIASH_PAR_LIMITIOBUFFERSIZE; do
    if ! [[ "${val}" =~ ^[-+]?[0-9]+$ ]]; then
      ViashError '--limitIObufferSize' has to be a long. Use "--help" to get more information on the parameters.
      exit 1
    fi
  done
  set +f
  unset IFS
fi

if [[ -n "$VIASH_PAR_LIMITOUTSAMONEREADBYTES" ]]; then
  if ! [[ "$VIASH_PAR_LIMITOUTSAMONEREADBYTES" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--limitOutSAMoneReadBytes' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_LIMITOUTSJONEREAD" ]]; then
  if ! [[ "$VIASH_PAR_LIMITOUTSJONEREAD" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--limitOutSJoneRead' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_LIMITOUTSJCOLLAPSED" ]]; then
  if ! [[ "$VIASH_PAR_LIMITOUTSJCOLLAPSED" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--limitOutSJcollapsed' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_LIMITBAMSORTRAM" ]]; then
  if ! [[ "$VIASH_PAR_LIMITBAMSORTRAM" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--limitBAMsortRAM' has to be a long. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_LIMITSJDBINSERTNSJ" ]]; then
  if ! [[ "$VIASH_PAR_LIMITSJDBINSERTNSJ" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--limitSjdbInsertNsj' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_LIMITNREADSSOFT" ]]; then
  if ! [[ "$VIASH_PAR_LIMITNREADSSOFT" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--limitNreadsSoft' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTQSCONVERSIONADD" ]]; then
  if ! [[ "$VIASH_PAR_OUTQSCONVERSIONADD" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outQSconversionAdd' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTSAMATTRIHSTART" ]]; then
  if ! [[ "$VIASH_PAR_OUTSAMATTRIHSTART" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outSAMattrIHstart' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTSAMMAPQUNIQUE" ]]; then
  if ! [[ "$VIASH_PAR_OUTSAMMAPQUNIQUE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outSAMmapqUnique' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTSAMFLAGOR" ]]; then
  if ! [[ "$VIASH_PAR_OUTSAMFLAGOR" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outSAMflagOR' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTSAMFLAGAND" ]]; then
  if ! [[ "$VIASH_PAR_OUTSAMFLAGAND" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outSAMflagAND' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTSAMMULTNMAX" ]]; then
  if ! [[ "$VIASH_PAR_OUTSAMMULTNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outSAMmultNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTSAMTLEN" ]]; then
  if ! [[ "$VIASH_PAR_OUTSAMTLEN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outSAMtlen' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTBAMCOMPRESSION" ]]; then
  if ! [[ "$VIASH_PAR_OUTBAMCOMPRESSION" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outBAMcompression' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTBAMSORTINGTHREADN" ]]; then
  if ! [[ "$VIASH_PAR_OUTBAMSORTINGTHREADN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outBAMsortingThreadN' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTBAMSORTINGBINSN" ]]; then
  if ! [[ "$VIASH_PAR_OUTBAMSORTINGBINSN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outBAMsortingBinsN' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_BAMREMOVEDUPLICATESMATE2BASESN" ]]; then
  if ! [[ "$VIASH_PAR_BAMREMOVEDUPLICATESMATE2BASESN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--bamRemoveDuplicatesMate2basesN' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTFILTERMULTIMAPSCORERANGE" ]]; then
  if ! [[ "$VIASH_PAR_OUTFILTERMULTIMAPSCORERANGE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outFilterMultimapScoreRange' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTFILTERMULTIMAPNMAX" ]]; then
  if ! [[ "$VIASH_PAR_OUTFILTERMULTIMAPNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outFilterMultimapNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTFILTERMISMATCHNMAX" ]]; then
  if ! [[ "$VIASH_PAR_OUTFILTERMISMATCHNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outFilterMismatchNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTFILTERMISMATCHNOVERLMAX" ]]; then
  if ! [[ "$VIASH_PAR_OUTFILTERMISMATCHNOVERLMAX" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--outFilterMismatchNoverLmax' has to be a double. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTFILTERMISMATCHNOVERREADLMAX" ]]; then
  if ! [[ "$VIASH_PAR_OUTFILTERMISMATCHNOVERREADLMAX" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--outFilterMismatchNoverReadLmax' has to be a double. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTFILTERSCOREMIN" ]]; then
  if ! [[ "$VIASH_PAR_OUTFILTERSCOREMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outFilterScoreMin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTFILTERSCOREMINOVERLREAD" ]]; then
  if ! [[ "$VIASH_PAR_OUTFILTERSCOREMINOVERLREAD" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--outFilterScoreMinOverLread' has to be a double. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTFILTERMATCHNMIN" ]]; then
  if ! [[ "$VIASH_PAR_OUTFILTERMATCHNMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--outFilterMatchNmin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_OUTFILTERMATCHNMINOVERLREAD" ]]; then
  if ! [[ "$VIASH_PAR_OUTFILTERMATCHNMINOVERLREAD" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--outFilterMatchNminOverLread' has to be a double. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [ -n "$VIASH_PAR_OUTSJFILTEROVERHANGMIN" ]; then
  IFS=';'
  set -f
  for val in $VIASH_PAR_OUTSJFILTEROVERHANGMIN; do
    if ! [[ "${val}" =~ ^[-+]?[0-9]+$ ]]; then
      ViashError '--outSJfilterOverhangMin' has to be an integer. Use "--help" to get more information on the parameters.
      exit 1
    fi
  done
  set +f
  unset IFS
fi

if [ -n "$VIASH_PAR_OUTSJFILTERCOUNTUNIQUEMIN" ]; then
  IFS=';'
  set -f
  for val in $VIASH_PAR_OUTSJFILTERCOUNTUNIQUEMIN; do
    if ! [[ "${val}" =~ ^[-+]?[0-9]+$ ]]; then
      ViashError '--outSJfilterCountUniqueMin' has to be an integer. Use "--help" to get more information on the parameters.
      exit 1
    fi
  done
  set +f
  unset IFS
fi

if [ -n "$VIASH_PAR_OUTSJFILTERCOUNTTOTALMIN" ]; then
  IFS=';'
  set -f
  for val in $VIASH_PAR_OUTSJFILTERCOUNTTOTALMIN; do
    if ! [[ "${val}" =~ ^[-+]?[0-9]+$ ]]; then
      ViashError '--outSJfilterCountTotalMin' has to be an integer. Use "--help" to get more information on the parameters.
      exit 1
    fi
  done
  set +f
  unset IFS
fi

if [ -n "$VIASH_PAR_OUTSJFILTERDISTTOOTHERSJMIN" ]; then
  IFS=';'
  set -f
  for val in $VIASH_PAR_OUTSJFILTERDISTTOOTHERSJMIN; do
    if ! [[ "${val}" =~ ^[-+]?[0-9]+$ ]]; then
      ViashError '--outSJfilterDistToOtherSJmin' has to be an integer. Use "--help" to get more information on the parameters.
      exit 1
    fi
  done
  set +f
  unset IFS
fi

if [ -n "$VIASH_PAR_OUTSJFILTERINTRONMAXVSREADN" ]; then
  IFS=';'
  set -f
  for val in $VIASH_PAR_OUTSJFILTERINTRONMAXVSREADN; do
    if ! [[ "${val}" =~ ^[-+]?[0-9]+$ ]]; then
      ViashError '--outSJfilterIntronMaxVsReadN' has to be an integer. Use "--help" to get more information on the parameters.
      exit 1
    fi
  done
  set +f
  unset IFS
fi

if [[ -n "$VIASH_PAR_SCOREGAP" ]]; then
  if ! [[ "$VIASH_PAR_SCOREGAP" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--scoreGap' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SCOREGAPNONCAN" ]]; then
  if ! [[ "$VIASH_PAR_SCOREGAPNONCAN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--scoreGapNoncan' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SCOREGAPGCAG" ]]; then
  if ! [[ "$VIASH_PAR_SCOREGAPGCAG" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--scoreGapGCAG' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SCOREGAPATAC" ]]; then
  if ! [[ "$VIASH_PAR_SCOREGAPATAC" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--scoreGapATAC' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SCOREGENOMICLENGTHLOG2SCALE" ]]; then
  if ! [[ "$VIASH_PAR_SCOREGENOMICLENGTHLOG2SCALE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--scoreGenomicLengthLog2scale' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SCOREDELOPEN" ]]; then
  if ! [[ "$VIASH_PAR_SCOREDELOPEN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--scoreDelOpen' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SCOREDELBASE" ]]; then
  if ! [[ "$VIASH_PAR_SCOREDELBASE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--scoreDelBase' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SCOREINSOPEN" ]]; then
  if ! [[ "$VIASH_PAR_SCOREINSOPEN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--scoreInsOpen' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SCOREINSBASE" ]]; then
  if ! [[ "$VIASH_PAR_SCOREINSBASE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--scoreInsBase' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SCORESTITCHSJSHIFT" ]]; then
  if ! [[ "$VIASH_PAR_SCORESTITCHSJSHIFT" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--scoreStitchSJshift' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SEEDSEARCHSTARTLMAX" ]]; then
  if ! [[ "$VIASH_PAR_SEEDSEARCHSTARTLMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--seedSearchStartLmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SEEDSEARCHSTARTLMAXOVERLREAD" ]]; then
  if ! [[ "$VIASH_PAR_SEEDSEARCHSTARTLMAXOVERLREAD" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--seedSearchStartLmaxOverLread' has to be a double. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SEEDSEARCHLMAX" ]]; then
  if ! [[ "$VIASH_PAR_SEEDSEARCHLMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--seedSearchLmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SEEDMULTIMAPNMAX" ]]; then
  if ! [[ "$VIASH_PAR_SEEDMULTIMAPNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--seedMultimapNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SEEDPERREADNMAX" ]]; then
  if ! [[ "$VIASH_PAR_SEEDPERREADNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--seedPerReadNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SEEDPERWINDOWNMAX" ]]; then
  if ! [[ "$VIASH_PAR_SEEDPERWINDOWNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--seedPerWindowNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SEEDNONELOCIPERWINDOW" ]]; then
  if ! [[ "$VIASH_PAR_SEEDNONELOCIPERWINDOW" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--seedNoneLociPerWindow' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SEEDSPLITMIN" ]]; then
  if ! [[ "$VIASH_PAR_SEEDSPLITMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--seedSplitMin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SEEDMAPMIN" ]]; then
  if ! [[ "$VIASH_PAR_SEEDMAPMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--seedMapMin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_ALIGNINTRONMIN" ]]; then
  if ! [[ "$VIASH_PAR_ALIGNINTRONMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--alignIntronMin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_ALIGNINTRONMAX" ]]; then
  if ! [[ "$VIASH_PAR_ALIGNINTRONMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--alignIntronMax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_ALIGNMATESGAPMAX" ]]; then
  if ! [[ "$VIASH_PAR_ALIGNMATESGAPMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--alignMatesGapMax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_ALIGNSJOVERHANGMIN" ]]; then
  if ! [[ "$VIASH_PAR_ALIGNSJOVERHANGMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--alignSJoverhangMin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [ -n "$VIASH_PAR_ALIGNSJSTITCHMISMATCHNMAX" ]; then
  IFS=';'
  set -f
  for val in $VIASH_PAR_ALIGNSJSTITCHMISMATCHNMAX; do
    if ! [[ "${val}" =~ ^[-+]?[0-9]+$ ]]; then
      ViashError '--alignSJstitchMismatchNmax' has to be an integer. Use "--help" to get more information on the parameters.
      exit 1
    fi
  done
  set +f
  unset IFS
fi

if [[ -n "$VIASH_PAR_ALIGNSJDBOVERHANGMIN" ]]; then
  if ! [[ "$VIASH_PAR_ALIGNSJDBOVERHANGMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--alignSJDBoverhangMin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_ALIGNSPLICEDMATEMAPLMIN" ]]; then
  if ! [[ "$VIASH_PAR_ALIGNSPLICEDMATEMAPLMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--alignSplicedMateMapLmin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_ALIGNSPLICEDMATEMAPLMINOVERLMATE" ]]; then
  if ! [[ "$VIASH_PAR_ALIGNSPLICEDMATEMAPLMINOVERLMATE" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--alignSplicedMateMapLminOverLmate' has to be a double. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_ALIGNWINDOWSPERREADNMAX" ]]; then
  if ! [[ "$VIASH_PAR_ALIGNWINDOWSPERREADNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--alignWindowsPerReadNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_ALIGNTRANSCRIPTSPERWINDOWNMAX" ]]; then
  if ! [[ "$VIASH_PAR_ALIGNTRANSCRIPTSPERWINDOWNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--alignTranscriptsPerWindowNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_ALIGNTRANSCRIPTSPERREADNMAX" ]]; then
  if ! [[ "$VIASH_PAR_ALIGNTRANSCRIPTSPERREADNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--alignTranscriptsPerReadNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_PEOVERLAPNBASESMIN" ]]; then
  if ! [[ "$VIASH_PAR_PEOVERLAPNBASESMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--peOverlapNbasesMin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_PEOVERLAPMMP" ]]; then
  if ! [[ "$VIASH_PAR_PEOVERLAPMMP" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--peOverlapMMp' has to be a double. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_WINANCHORMULTIMAPNMAX" ]]; then
  if ! [[ "$VIASH_PAR_WINANCHORMULTIMAPNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--winAnchorMultimapNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_WINBINNBITS" ]]; then
  if ! [[ "$VIASH_PAR_WINBINNBITS" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--winBinNbits' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_WINANCHORDISTNBINS" ]]; then
  if ! [[ "$VIASH_PAR_WINANCHORDISTNBINS" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--winAnchorDistNbins' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_WINFLANKNBINS" ]]; then
  if ! [[ "$VIASH_PAR_WINFLANKNBINS" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--winFlankNbins' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_WINREADCOVERAGERELATIVEMIN" ]]; then
  if ! [[ "$VIASH_PAR_WINREADCOVERAGERELATIVEMIN" =~ ^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$ ]]; then
    ViashError '--winReadCoverageRelativeMin' has to be a double. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_WINREADCOVERAGEBASESMIN" ]]; then
  if ! [[ "$VIASH_PAR_WINREADCOVERAGEBASESMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--winReadCoverageBasesMin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_CHIMSEGMENTMIN" ]]; then
  if ! [[ "$VIASH_PAR_CHIMSEGMENTMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--chimSegmentMin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_CHIMSCOREMIN" ]]; then
  if ! [[ "$VIASH_PAR_CHIMSCOREMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--chimScoreMin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_CHIMSCOREDROPMAX" ]]; then
  if ! [[ "$VIASH_PAR_CHIMSCOREDROPMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--chimScoreDropMax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_CHIMSCORESEPARATION" ]]; then
  if ! [[ "$VIASH_PAR_CHIMSCORESEPARATION" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--chimScoreSeparation' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_CHIMSCOREJUNCTIONNONGTAG" ]]; then
  if ! [[ "$VIASH_PAR_CHIMSCOREJUNCTIONNONGTAG" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--chimScoreJunctionNonGTAG' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_CHIMJUNCTIONOVERHANGMIN" ]]; then
  if ! [[ "$VIASH_PAR_CHIMJUNCTIONOVERHANGMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--chimJunctionOverhangMin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_CHIMSEGMENTREADGAPMAX" ]]; then
  if ! [[ "$VIASH_PAR_CHIMSEGMENTREADGAPMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--chimSegmentReadGapMax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_CHIMMAINSEGMENTMULTNMAX" ]]; then
  if ! [[ "$VIASH_PAR_CHIMMAINSEGMENTMULTNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--chimMainSegmentMultNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_CHIMMULTIMAPNMAX" ]]; then
  if ! [[ "$VIASH_PAR_CHIMMULTIMAPNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--chimMultimapNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_CHIMMULTIMAPSCORERANGE" ]]; then
  if ! [[ "$VIASH_PAR_CHIMMULTIMAPSCORERANGE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--chimMultimapScoreRange' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_CHIMNONCHIMSCOREDROPMIN" ]]; then
  if ! [[ "$VIASH_PAR_CHIMNONCHIMSCOREDROPMIN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--chimNonchimScoreDropMin' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_CHIMOUTJUNCTIONFORMAT" ]]; then
  if ! [[ "$VIASH_PAR_CHIMOUTJUNCTIONFORMAT" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--chimOutJunctionFormat' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_QUANTTRANSCRIPTOMEBAMCOMPRESSION" ]]; then
  if ! [[ "$VIASH_PAR_QUANTTRANSCRIPTOMEBAMCOMPRESSION" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--quantTranscriptomeBAMcompression' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_TWOPASS1READSN" ]]; then
  if ! [[ "$VIASH_PAR_TWOPASS1READSN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--twopass1readsN' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SOLOCBSTART" ]]; then
  if ! [[ "$VIASH_PAR_SOLOCBSTART" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--soloCBstart' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SOLOCBLEN" ]]; then
  if ! [[ "$VIASH_PAR_SOLOCBLEN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--soloCBlen' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SOLOUMISTART" ]]; then
  if ! [[ "$VIASH_PAR_SOLOUMISTART" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--soloUMIstart' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SOLOUMILEN" ]]; then
  if ! [[ "$VIASH_PAR_SOLOUMILEN" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--soloUMIlen' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SOLOBARCODEREADLENGTH" ]]; then
  if ! [[ "$VIASH_PAR_SOLOBARCODEREADLENGTH" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--soloBarcodeReadLength' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SOLOBARCODEMATE" ]]; then
  if ! [[ "$VIASH_PAR_SOLOBARCODEMATE" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--soloBarcodeMate' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_SOLOADAPTERMISMATCHESNMAX" ]]; then
  if ! [[ "$VIASH_PAR_SOLOADAPTERMISMATCHESNMAX" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--soloAdapterMismatchesNmax' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY" ]]; then
  if ! [[ "$VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY" =~ ^[-+]?[0-9]+$ ]]; then
    ViashError '--minimum_alignment_quality' has to be an integer. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_ADD_CHROMOSOME_INFO" ]]; then
  if ! [[ "$VIASH_PAR_ADD_CHROMOSOME_INFO" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--add_chromosome_info' has to be a boolean_true. Use "--help" to get more information on the parameters.
    exit 1
  fi
fi
if [[ -n "$VIASH_PAR_COUNTS_OUTPUT_SPARSE" ]]; then
  if ! [[ "$VIASH_PAR_COUNTS_OUTPUT_SPARSE" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then
    ViashError '--counts_output_sparse' has to be a boolean_true. 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_STRANDED" ]; then
  VIASH_PAR_STRANDED_CHOICES=("yes;no;reverse")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_STRANDED_CHOICES[*]};" =~ ";$VIASH_PAR_STRANDED;" ]]; then
    ViashError '--stranded' specified value of \'$VIASH_PAR_STRANDED\' 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_MODE" ]; then
  VIASH_PAR_MODE_CHOICES=("union;intersection-strict;intersection-nonempty")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_MODE_CHOICES[*]};" =~ ";$VIASH_PAR_MODE;" ]]; then
    ViashError '--mode' specified value of \'$VIASH_PAR_MODE\' 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_NON_UNIQUE" ]; then
  VIASH_PAR_NON_UNIQUE_CHOICES=("none;all;fraction;random")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_NON_UNIQUE_CHOICES[*]};" =~ ";$VIASH_PAR_NON_UNIQUE;" ]]; then
    ViashError '--non_unique' specified value of \'$VIASH_PAR_NON_UNIQUE\' 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_SECONDARY_ALIGNMENTS" ]; then
  VIASH_PAR_SECONDARY_ALIGNMENTS_CHOICES=("score;ignore")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_SECONDARY_ALIGNMENTS_CHOICES[*]};" =~ ";$VIASH_PAR_SECONDARY_ALIGNMENTS;" ]]; then
    ViashError '--secondary_alignments' specified value of \'$VIASH_PAR_SECONDARY_ALIGNMENTS\' 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_SUPPLEMENTARY_ALIGNMENTS" ]; then
  VIASH_PAR_SUPPLEMENTARY_ALIGNMENTS_CHOICES=("score;ignore")
  IFS=';'
  set -f
  if ! [[ ";${VIASH_PAR_SUPPLEMENTARY_ALIGNMENTS_CHOICES[*]};" =~ ";$VIASH_PAR_SUPPLEMENTARY_ALIGNMENTS;" ]]; then
    ViashError '--supplementary_alignments' specified value of \'$VIASH_PAR_SUPPLEMENTARY_ALIGNMENTS\' 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_OUTPUT" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT")" ]; then
  mkdir -p "$(dirname "$VIASH_PAR_OUTPUT")"
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

if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then
  # detect volumes from file arguments
  VIASH_CHOWN_VARS=()
if [ ! -z "$VIASH_PAR_INPUT_R1" ]; then
  VIASH_TEST_INPUT_R1=()
  IFS=';'
  for var in $VIASH_PAR_INPUT_R1; do
    unset IFS
    VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$var")" )
    var=$(ViashDockerAutodetectMount "$var")
    VIASH_TEST_INPUT_R1+=( "$var" )
  done
  VIASH_PAR_INPUT_R1=$(IFS=';' ; echo "${VIASH_TEST_INPUT_R1[*]}")
fi
if [ ! -z "$VIASH_PAR_INPUT_R2" ]; then
  VIASH_TEST_INPUT_R2=()
  IFS=';'
  for var in $VIASH_PAR_INPUT_R2; do
    unset IFS
    VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$var")" )
    var=$(ViashDockerAutodetectMount "$var")
    VIASH_TEST_INPUT_R2+=( "$var" )
  done
  VIASH_PAR_INPUT_R2=$(IFS=';' ; echo "${VIASH_TEST_INPUT_R2[*]}")
fi
if [ ! -z "$VIASH_PAR_REFERENCE_INDEX" ]; then
  VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_REFERENCE_INDEX")" )
  VIASH_PAR_REFERENCE_INDEX=$(ViashDockerAutodetectMount "$VIASH_PAR_REFERENCE_INDEX")
fi
if [ ! -z "$VIASH_PAR_REFERENCE_GTF" ]; then
  VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_REFERENCE_GTF")" )
  VIASH_PAR_REFERENCE_GTF=$(ViashDockerAutodetectMount "$VIASH_PAR_REFERENCE_GTF")
fi
if [ ! -z "$VIASH_PAR_OUTPUT" ]; then
  VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_OUTPUT")" )
  VIASH_PAR_OUTPUT=$(ViashDockerAutodetectMount "$VIASH_PAR_OUTPUT")
  VIASH_CHOWN_VARS+=( "$VIASH_PAR_OUTPUT" )
fi
if [ ! -z "$VIASH_PAR_GENOMEFASTAFILES" ]; then
  VIASH_TEST_GENOMEFASTAFILES=()
  IFS=';'
  for var in $VIASH_PAR_GENOMEFASTAFILES; do
    unset IFS
    VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$var")" )
    var=$(ViashDockerAutodetectMount "$var")
    VIASH_TEST_GENOMEFASTAFILES+=( "$var" )
  done
  VIASH_PAR_GENOMEFASTAFILES=$(IFS=';' ; echo "${VIASH_TEST_GENOMEFASTAFILES[*]}")
fi
if [ ! -z "$VIASH_PAR_SJDBGTFFILE" ]; then
  VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_SJDBGTFFILE")" )
  VIASH_PAR_SJDBGTFFILE=$(ViashDockerAutodetectMount "$VIASH_PAR_SJDBGTFFILE")
fi
if [ ! -z "$VIASH_PAR_READFILESMANIFEST" ]; then
  VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_READFILESMANIFEST")" )
  VIASH_PAR_READFILESMANIFEST=$(ViashDockerAutodetectMount "$VIASH_PAR_READFILESMANIFEST")
fi
if [ ! -z "$VIASH_META_RESOURCES_DIR" ]; then
  VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_RESOURCES_DIR")" )
  VIASH_META_RESOURCES_DIR=$(ViashDockerAutodetectMount "$VIASH_META_RESOURCES_DIR")
fi
if [ ! -z "$VIASH_META_EXECUTABLE" ]; then
  VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_EXECUTABLE")" )
  VIASH_META_EXECUTABLE=$(ViashDockerAutodetectMount "$VIASH_META_EXECUTABLE")
fi
if [ ! -z "$VIASH_META_CONFIG" ]; then
  VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_CONFIG")" )
  VIASH_META_CONFIG=$(ViashDockerAutodetectMount "$VIASH_META_CONFIG")
fi
if [ ! -z "$VIASH_META_TEMP_DIR" ]; then
  VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_TEMP_DIR")" )
  VIASH_META_TEMP_DIR=$(ViashDockerAutodetectMount "$VIASH_META_TEMP_DIR")
fi
  
  # get unique mounts
  VIASH_UNIQUE_MOUNTS=($(for val in "${VIASH_DIRECTORY_MOUNTS[@]}"; do echo "$val"; done | sort -u))
fi

if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then
  # change file ownership
  function ViashPerformChown {
    if (( ${#VIASH_CHOWN_VARS[@]} )); then
      set +e
      VIASH_CMD="docker run --entrypoint=bash --rm ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_DOCKER_IMAGE_ID -c 'chown $(id -u):$(id -g) --silent --recursive ${VIASH_CHOWN_VARS[@]}'"
      ViashDebug "+ $VIASH_CMD"
      eval $VIASH_CMD
      set -e
    fi
  }
  trap ViashPerformChown EXIT
fi

if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then
  # helper function for filling in extra docker args
  if [ ! -z "$VIASH_META_MEMORY_B" ]; then
    VIASH_DOCKER_RUN_ARGS+=("--memory=${VIASH_META_MEMORY_B}")
  fi
  if [ ! -z "$VIASH_META_CPUS" ]; then
    VIASH_DOCKER_RUN_ARGS+=("--cpus=${VIASH_META_CPUS}")
  fi
fi

if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then
  VIASH_CMD="docker run --entrypoint=bash ${VIASH_DOCKER_RUN_ARGS[@]} ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_DOCKER_IMAGE_ID"
fi


# set dependency paths


ViashDebug "Running command: $(echo $VIASH_CMD)"
cat << VIASHEOF | eval $VIASH_CMD
set -e
tempscript=\$(mktemp "$VIASH_META_TEMP_DIR/viash-run-multi_star-XXXXXX").py
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'
from typing import Any, Dict, List, Tuple
import math
import tempfile
import subprocess
import tarfile
import gzip
import shutil
from pathlib import Path
import yaml
import pandas as pd
from multiprocess import Pool
import gffutils

## VIASH START
# The following code has been auto-generated by Viash.
par = {
  'input_id': $( if [ ! -z ${VIASH_PAR_INPUT_ID+x} ]; then echo "r'${VIASH_PAR_INPUT_ID//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'input_r1': $( if [ ! -z ${VIASH_PAR_INPUT_R1+x} ]; then echo "r'${VIASH_PAR_INPUT_R1//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'input_r2': $( if [ ! -z ${VIASH_PAR_INPUT_R2+x} ]; then echo "r'${VIASH_PAR_INPUT_R2//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'reference_index': $( if [ ! -z ${VIASH_PAR_REFERENCE_INDEX+x} ]; then echo "r'${VIASH_PAR_REFERENCE_INDEX//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'reference_gtf': $( if [ ! -z ${VIASH_PAR_REFERENCE_GTF+x} ]; then echo "r'${VIASH_PAR_REFERENCE_GTF//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'output': $( if [ ! -z ${VIASH_PAR_OUTPUT+x} ]; then echo "r'${VIASH_PAR_OUTPUT//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'run_htseq_count': $( if [ ! -z ${VIASH_PAR_RUN_HTSEQ_COUNT+x} ]; then echo "r'${VIASH_PAR_RUN_HTSEQ_COUNT//\'/\'\"\'\"r\'}'.lower() == 'true'"; else echo None; fi ),
  'run_multiqc': $( if [ ! -z ${VIASH_PAR_RUN_MULTIQC+x} ]; then echo "r'${VIASH_PAR_RUN_MULTIQC//\'/\'\"\'\"r\'}'.lower() == 'true'"; else echo None; fi ),
  'min_success_rate': $( if [ ! -z ${VIASH_PAR_MIN_SUCCESS_RATE+x} ]; then echo "float(r'${VIASH_PAR_MIN_SUCCESS_RATE//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'runRNGseed': $( if [ ! -z ${VIASH_PAR_RUNRNGSEED+x} ]; then echo "int(r'${VIASH_PAR_RUNRNGSEED//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'genomeFastaFiles': $( if [ ! -z ${VIASH_PAR_GENOMEFASTAFILES+x} ]; then echo "r'${VIASH_PAR_GENOMEFASTAFILES//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'sjdbFileChrStartEnd': $( if [ ! -z ${VIASH_PAR_SJDBFILECHRSTARTEND+x} ]; then echo "r'${VIASH_PAR_SJDBFILECHRSTARTEND//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'sjdbGTFfile': $( if [ ! -z ${VIASH_PAR_SJDBGTFFILE+x} ]; then echo "r'${VIASH_PAR_SJDBGTFFILE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'sjdbGTFchrPrefix': $( if [ ! -z ${VIASH_PAR_SJDBGTFCHRPREFIX+x} ]; then echo "r'${VIASH_PAR_SJDBGTFCHRPREFIX//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'sjdbGTFfeatureExon': $( if [ ! -z ${VIASH_PAR_SJDBGTFFEATUREEXON+x} ]; then echo "r'${VIASH_PAR_SJDBGTFFEATUREEXON//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'sjdbGTFtagExonParentTranscript': $( if [ ! -z ${VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT+x} ]; then echo "r'${VIASH_PAR_SJDBGTFTAGEXONPARENTTRANSCRIPT//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'sjdbGTFtagExonParentGene': $( if [ ! -z ${VIASH_PAR_SJDBGTFTAGEXONPARENTGENE+x} ]; then echo "r'${VIASH_PAR_SJDBGTFTAGEXONPARENTGENE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'sjdbGTFtagExonParentGeneName': $( if [ ! -z ${VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME+x} ]; then echo "r'${VIASH_PAR_SJDBGTFTAGEXONPARENTGENENAME//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'sjdbGTFtagExonParentGeneType': $( if [ ! -z ${VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE+x} ]; then echo "r'${VIASH_PAR_SJDBGTFTAGEXONPARENTGENETYPE//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'sjdbOverhang': $( if [ ! -z ${VIASH_PAR_SJDBOVERHANG+x} ]; then echo "int(r'${VIASH_PAR_SJDBOVERHANG//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'sjdbScore': $( if [ ! -z ${VIASH_PAR_SJDBSCORE+x} ]; then echo "int(r'${VIASH_PAR_SJDBSCORE//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'sjdbInsertSave': $( if [ ! -z ${VIASH_PAR_SJDBINSERTSAVE+x} ]; then echo "r'${VIASH_PAR_SJDBINSERTSAVE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'varVCFfile': $( if [ ! -z ${VIASH_PAR_VARVCFFILE+x} ]; then echo "r'${VIASH_PAR_VARVCFFILE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'readFilesType': $( if [ ! -z ${VIASH_PAR_READFILESTYPE+x} ]; then echo "r'${VIASH_PAR_READFILESTYPE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'readFilesSAMattrKeep': $( if [ ! -z ${VIASH_PAR_READFILESSAMATTRKEEP+x} ]; then echo "r'${VIASH_PAR_READFILESSAMATTRKEEP//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'readFilesManifest': $( if [ ! -z ${VIASH_PAR_READFILESMANIFEST+x} ]; then echo "r'${VIASH_PAR_READFILESMANIFEST//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'readFilesPrefix': $( if [ ! -z ${VIASH_PAR_READFILESPREFIX+x} ]; then echo "r'${VIASH_PAR_READFILESPREFIX//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'readFilesCommand': $( if [ ! -z ${VIASH_PAR_READFILESCOMMAND+x} ]; then echo "r'${VIASH_PAR_READFILESCOMMAND//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'readMapNumber': $( if [ ! -z ${VIASH_PAR_READMAPNUMBER+x} ]; then echo "int(r'${VIASH_PAR_READMAPNUMBER//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'readMatesLengthsIn': $( if [ ! -z ${VIASH_PAR_READMATESLENGTHSIN+x} ]; then echo "r'${VIASH_PAR_READMATESLENGTHSIN//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'readNameSeparator': $( if [ ! -z ${VIASH_PAR_READNAMESEPARATOR+x} ]; then echo "r'${VIASH_PAR_READNAMESEPARATOR//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'readQualityScoreBase': $( if [ ! -z ${VIASH_PAR_READQUALITYSCOREBASE+x} ]; then echo "int(r'${VIASH_PAR_READQUALITYSCOREBASE//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'clipAdapterType': $( if [ ! -z ${VIASH_PAR_CLIPADAPTERTYPE+x} ]; then echo "r'${VIASH_PAR_CLIPADAPTERTYPE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'clip3pNbases': $( if [ ! -z ${VIASH_PAR_CLIP3PNBASES+x} ]; then echo "list(map(int, r'${VIASH_PAR_CLIP3PNBASES//\'/\'\"\'\"r\'}'.split(';')))"; else echo None; fi ),
  'clip3pAdapterSeq': $( if [ ! -z ${VIASH_PAR_CLIP3PADAPTERSEQ+x} ]; then echo "r'${VIASH_PAR_CLIP3PADAPTERSEQ//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'clip3pAdapterMMp': $( if [ ! -z ${VIASH_PAR_CLIP3PADAPTERMMP+x} ]; then echo "list(map(float, r'${VIASH_PAR_CLIP3PADAPTERMMP//\'/\'\"\'\"r\'}'.split(';')))"; else echo None; fi ),
  'clip3pAfterAdapterNbases': $( if [ ! -z ${VIASH_PAR_CLIP3PAFTERADAPTERNBASES+x} ]; then echo "list(map(int, r'${VIASH_PAR_CLIP3PAFTERADAPTERNBASES//\'/\'\"\'\"r\'}'.split(';')))"; else echo None; fi ),
  'clip5pNbases': $( if [ ! -z ${VIASH_PAR_CLIP5PNBASES+x} ]; then echo "list(map(int, r'${VIASH_PAR_CLIP5PNBASES//\'/\'\"\'\"r\'}'.split(';')))"; else echo None; fi ),
  'limitGenomeGenerateRAM': $( if [ ! -z ${VIASH_PAR_LIMITGENOMEGENERATERAM+x} ]; then echo "int(r'${VIASH_PAR_LIMITGENOMEGENERATERAM//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'limitIObufferSize': $( if [ ! -z ${VIASH_PAR_LIMITIOBUFFERSIZE+x} ]; then echo "list(map(int, r'${VIASH_PAR_LIMITIOBUFFERSIZE//\'/\'\"\'\"r\'}'.split(';')))"; else echo None; fi ),
  'limitOutSAMoneReadBytes': $( if [ ! -z ${VIASH_PAR_LIMITOUTSAMONEREADBYTES+x} ]; then echo "int(r'${VIASH_PAR_LIMITOUTSAMONEREADBYTES//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'limitOutSJoneRead': $( if [ ! -z ${VIASH_PAR_LIMITOUTSJONEREAD+x} ]; then echo "int(r'${VIASH_PAR_LIMITOUTSJONEREAD//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'limitOutSJcollapsed': $( if [ ! -z ${VIASH_PAR_LIMITOUTSJCOLLAPSED+x} ]; then echo "int(r'${VIASH_PAR_LIMITOUTSJCOLLAPSED//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'limitBAMsortRAM': $( if [ ! -z ${VIASH_PAR_LIMITBAMSORTRAM+x} ]; then echo "int(r'${VIASH_PAR_LIMITBAMSORTRAM//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'limitSjdbInsertNsj': $( if [ ! -z ${VIASH_PAR_LIMITSJDBINSERTNSJ+x} ]; then echo "int(r'${VIASH_PAR_LIMITSJDBINSERTNSJ//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'limitNreadsSoft': $( if [ ! -z ${VIASH_PAR_LIMITNREADSSOFT+x} ]; then echo "int(r'${VIASH_PAR_LIMITNREADSSOFT//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outTmpKeep': $( if [ ! -z ${VIASH_PAR_OUTTMPKEEP+x} ]; then echo "r'${VIASH_PAR_OUTTMPKEEP//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outStd': $( if [ ! -z ${VIASH_PAR_OUTSTD+x} ]; then echo "r'${VIASH_PAR_OUTSTD//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outReadsUnmapped': $( if [ ! -z ${VIASH_PAR_OUTREADSUNMAPPED+x} ]; then echo "r'${VIASH_PAR_OUTREADSUNMAPPED//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outQSconversionAdd': $( if [ ! -z ${VIASH_PAR_OUTQSCONVERSIONADD+x} ]; then echo "int(r'${VIASH_PAR_OUTQSCONVERSIONADD//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outMultimapperOrder': $( if [ ! -z ${VIASH_PAR_OUTMULTIMAPPERORDER+x} ]; then echo "r'${VIASH_PAR_OUTMULTIMAPPERORDER//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outSAMmode': $( if [ ! -z ${VIASH_PAR_OUTSAMMODE+x} ]; then echo "r'${VIASH_PAR_OUTSAMMODE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outSAMstrandField': $( if [ ! -z ${VIASH_PAR_OUTSAMSTRANDFIELD+x} ]; then echo "r'${VIASH_PAR_OUTSAMSTRANDFIELD//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outSAMattributes': $( if [ ! -z ${VIASH_PAR_OUTSAMATTRIBUTES+x} ]; then echo "r'${VIASH_PAR_OUTSAMATTRIBUTES//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'outSAMattrIHstart': $( if [ ! -z ${VIASH_PAR_OUTSAMATTRIHSTART+x} ]; then echo "int(r'${VIASH_PAR_OUTSAMATTRIHSTART//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outSAMunmapped': $( if [ ! -z ${VIASH_PAR_OUTSAMUNMAPPED+x} ]; then echo "r'${VIASH_PAR_OUTSAMUNMAPPED//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'outSAMorder': $( if [ ! -z ${VIASH_PAR_OUTSAMORDER+x} ]; then echo "r'${VIASH_PAR_OUTSAMORDER//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outSAMprimaryFlag': $( if [ ! -z ${VIASH_PAR_OUTSAMPRIMARYFLAG+x} ]; then echo "r'${VIASH_PAR_OUTSAMPRIMARYFLAG//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outSAMreadID': $( if [ ! -z ${VIASH_PAR_OUTSAMREADID+x} ]; then echo "r'${VIASH_PAR_OUTSAMREADID//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outSAMmapqUnique': $( if [ ! -z ${VIASH_PAR_OUTSAMMAPQUNIQUE+x} ]; then echo "int(r'${VIASH_PAR_OUTSAMMAPQUNIQUE//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outSAMflagOR': $( if [ ! -z ${VIASH_PAR_OUTSAMFLAGOR+x} ]; then echo "int(r'${VIASH_PAR_OUTSAMFLAGOR//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outSAMflagAND': $( if [ ! -z ${VIASH_PAR_OUTSAMFLAGAND+x} ]; then echo "int(r'${VIASH_PAR_OUTSAMFLAGAND//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outSAMattrRGline': $( if [ ! -z ${VIASH_PAR_OUTSAMATTRRGLINE+x} ]; then echo "r'${VIASH_PAR_OUTSAMATTRRGLINE//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'outSAMheaderHD': $( if [ ! -z ${VIASH_PAR_OUTSAMHEADERHD+x} ]; then echo "r'${VIASH_PAR_OUTSAMHEADERHD//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'outSAMheaderPG': $( if [ ! -z ${VIASH_PAR_OUTSAMHEADERPG+x} ]; then echo "r'${VIASH_PAR_OUTSAMHEADERPG//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'outSAMheaderCommentFile': $( if [ ! -z ${VIASH_PAR_OUTSAMHEADERCOMMENTFILE+x} ]; then echo "r'${VIASH_PAR_OUTSAMHEADERCOMMENTFILE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outSAMfilter': $( if [ ! -z ${VIASH_PAR_OUTSAMFILTER+x} ]; then echo "r'${VIASH_PAR_OUTSAMFILTER//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'outSAMmultNmax': $( if [ ! -z ${VIASH_PAR_OUTSAMMULTNMAX+x} ]; then echo "int(r'${VIASH_PAR_OUTSAMMULTNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outSAMtlen': $( if [ ! -z ${VIASH_PAR_OUTSAMTLEN+x} ]; then echo "int(r'${VIASH_PAR_OUTSAMTLEN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outBAMcompression': $( if [ ! -z ${VIASH_PAR_OUTBAMCOMPRESSION+x} ]; then echo "int(r'${VIASH_PAR_OUTBAMCOMPRESSION//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outBAMsortingThreadN': $( if [ ! -z ${VIASH_PAR_OUTBAMSORTINGTHREADN+x} ]; then echo "int(r'${VIASH_PAR_OUTBAMSORTINGTHREADN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outBAMsortingBinsN': $( if [ ! -z ${VIASH_PAR_OUTBAMSORTINGBINSN+x} ]; then echo "int(r'${VIASH_PAR_OUTBAMSORTINGBINSN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'bamRemoveDuplicatesType': $( if [ ! -z ${VIASH_PAR_BAMREMOVEDUPLICATESTYPE+x} ]; then echo "r'${VIASH_PAR_BAMREMOVEDUPLICATESTYPE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'bamRemoveDuplicatesMate2basesN': $( if [ ! -z ${VIASH_PAR_BAMREMOVEDUPLICATESMATE2BASESN+x} ]; then echo "int(r'${VIASH_PAR_BAMREMOVEDUPLICATESMATE2BASESN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outWigType': $( if [ ! -z ${VIASH_PAR_OUTWIGTYPE+x} ]; then echo "r'${VIASH_PAR_OUTWIGTYPE//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'outWigStrand': $( if [ ! -z ${VIASH_PAR_OUTWIGSTRAND+x} ]; then echo "r'${VIASH_PAR_OUTWIGSTRAND//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outWigReferencesPrefix': $( if [ ! -z ${VIASH_PAR_OUTWIGREFERENCESPREFIX+x} ]; then echo "r'${VIASH_PAR_OUTWIGREFERENCESPREFIX//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outWigNorm': $( if [ ! -z ${VIASH_PAR_OUTWIGNORM+x} ]; then echo "r'${VIASH_PAR_OUTWIGNORM//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outFilterType': $( if [ ! -z ${VIASH_PAR_OUTFILTERTYPE+x} ]; then echo "r'${VIASH_PAR_OUTFILTERTYPE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outFilterMultimapScoreRange': $( if [ ! -z ${VIASH_PAR_OUTFILTERMULTIMAPSCORERANGE+x} ]; then echo "int(r'${VIASH_PAR_OUTFILTERMULTIMAPSCORERANGE//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outFilterMultimapNmax': $( if [ ! -z ${VIASH_PAR_OUTFILTERMULTIMAPNMAX+x} ]; then echo "int(r'${VIASH_PAR_OUTFILTERMULTIMAPNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outFilterMismatchNmax': $( if [ ! -z ${VIASH_PAR_OUTFILTERMISMATCHNMAX+x} ]; then echo "int(r'${VIASH_PAR_OUTFILTERMISMATCHNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outFilterMismatchNoverLmax': $( if [ ! -z ${VIASH_PAR_OUTFILTERMISMATCHNOVERLMAX+x} ]; then echo "float(r'${VIASH_PAR_OUTFILTERMISMATCHNOVERLMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outFilterMismatchNoverReadLmax': $( if [ ! -z ${VIASH_PAR_OUTFILTERMISMATCHNOVERREADLMAX+x} ]; then echo "float(r'${VIASH_PAR_OUTFILTERMISMATCHNOVERREADLMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outFilterScoreMin': $( if [ ! -z ${VIASH_PAR_OUTFILTERSCOREMIN+x} ]; then echo "int(r'${VIASH_PAR_OUTFILTERSCOREMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outFilterScoreMinOverLread': $( if [ ! -z ${VIASH_PAR_OUTFILTERSCOREMINOVERLREAD+x} ]; then echo "float(r'${VIASH_PAR_OUTFILTERSCOREMINOVERLREAD//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outFilterMatchNmin': $( if [ ! -z ${VIASH_PAR_OUTFILTERMATCHNMIN+x} ]; then echo "int(r'${VIASH_PAR_OUTFILTERMATCHNMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outFilterMatchNminOverLread': $( if [ ! -z ${VIASH_PAR_OUTFILTERMATCHNMINOVERLREAD+x} ]; then echo "float(r'${VIASH_PAR_OUTFILTERMATCHNMINOVERLREAD//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'outFilterIntronMotifs': $( if [ ! -z ${VIASH_PAR_OUTFILTERINTRONMOTIFS+x} ]; then echo "r'${VIASH_PAR_OUTFILTERINTRONMOTIFS//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outFilterIntronStrands': $( if [ ! -z ${VIASH_PAR_OUTFILTERINTRONSTRANDS+x} ]; then echo "r'${VIASH_PAR_OUTFILTERINTRONSTRANDS//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outSJtype': $( if [ ! -z ${VIASH_PAR_OUTSJTYPE+x} ]; then echo "r'${VIASH_PAR_OUTSJTYPE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outSJfilterReads': $( if [ ! -z ${VIASH_PAR_OUTSJFILTERREADS+x} ]; then echo "r'${VIASH_PAR_OUTSJFILTERREADS//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'outSJfilterOverhangMin': $( if [ ! -z ${VIASH_PAR_OUTSJFILTEROVERHANGMIN+x} ]; then echo "list(map(int, r'${VIASH_PAR_OUTSJFILTEROVERHANGMIN//\'/\'\"\'\"r\'}'.split(';')))"; else echo None; fi ),
  'outSJfilterCountUniqueMin': $( if [ ! -z ${VIASH_PAR_OUTSJFILTERCOUNTUNIQUEMIN+x} ]; then echo "list(map(int, r'${VIASH_PAR_OUTSJFILTERCOUNTUNIQUEMIN//\'/\'\"\'\"r\'}'.split(';')))"; else echo None; fi ),
  'outSJfilterCountTotalMin': $( if [ ! -z ${VIASH_PAR_OUTSJFILTERCOUNTTOTALMIN+x} ]; then echo "list(map(int, r'${VIASH_PAR_OUTSJFILTERCOUNTTOTALMIN//\'/\'\"\'\"r\'}'.split(';')))"; else echo None; fi ),
  'outSJfilterDistToOtherSJmin': $( if [ ! -z ${VIASH_PAR_OUTSJFILTERDISTTOOTHERSJMIN+x} ]; then echo "list(map(int, r'${VIASH_PAR_OUTSJFILTERDISTTOOTHERSJMIN//\'/\'\"\'\"r\'}'.split(';')))"; else echo None; fi ),
  'outSJfilterIntronMaxVsReadN': $( if [ ! -z ${VIASH_PAR_OUTSJFILTERINTRONMAXVSREADN+x} ]; then echo "list(map(int, r'${VIASH_PAR_OUTSJFILTERINTRONMAXVSREADN//\'/\'\"\'\"r\'}'.split(';')))"; else echo None; fi ),
  'scoreGap': $( if [ ! -z ${VIASH_PAR_SCOREGAP+x} ]; then echo "int(r'${VIASH_PAR_SCOREGAP//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'scoreGapNoncan': $( if [ ! -z ${VIASH_PAR_SCOREGAPNONCAN+x} ]; then echo "int(r'${VIASH_PAR_SCOREGAPNONCAN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'scoreGapGCAG': $( if [ ! -z ${VIASH_PAR_SCOREGAPGCAG+x} ]; then echo "int(r'${VIASH_PAR_SCOREGAPGCAG//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'scoreGapATAC': $( if [ ! -z ${VIASH_PAR_SCOREGAPATAC+x} ]; then echo "int(r'${VIASH_PAR_SCOREGAPATAC//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'scoreGenomicLengthLog2scale': $( if [ ! -z ${VIASH_PAR_SCOREGENOMICLENGTHLOG2SCALE+x} ]; then echo "int(r'${VIASH_PAR_SCOREGENOMICLENGTHLOG2SCALE//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'scoreDelOpen': $( if [ ! -z ${VIASH_PAR_SCOREDELOPEN+x} ]; then echo "int(r'${VIASH_PAR_SCOREDELOPEN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'scoreDelBase': $( if [ ! -z ${VIASH_PAR_SCOREDELBASE+x} ]; then echo "int(r'${VIASH_PAR_SCOREDELBASE//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'scoreInsOpen': $( if [ ! -z ${VIASH_PAR_SCOREINSOPEN+x} ]; then echo "int(r'${VIASH_PAR_SCOREINSOPEN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'scoreInsBase': $( if [ ! -z ${VIASH_PAR_SCOREINSBASE+x} ]; then echo "int(r'${VIASH_PAR_SCOREINSBASE//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'scoreStitchSJshift': $( if [ ! -z ${VIASH_PAR_SCORESTITCHSJSHIFT+x} ]; then echo "int(r'${VIASH_PAR_SCORESTITCHSJSHIFT//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'seedSearchStartLmax': $( if [ ! -z ${VIASH_PAR_SEEDSEARCHSTARTLMAX+x} ]; then echo "int(r'${VIASH_PAR_SEEDSEARCHSTARTLMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'seedSearchStartLmaxOverLread': $( if [ ! -z ${VIASH_PAR_SEEDSEARCHSTARTLMAXOVERLREAD+x} ]; then echo "float(r'${VIASH_PAR_SEEDSEARCHSTARTLMAXOVERLREAD//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'seedSearchLmax': $( if [ ! -z ${VIASH_PAR_SEEDSEARCHLMAX+x} ]; then echo "int(r'${VIASH_PAR_SEEDSEARCHLMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'seedMultimapNmax': $( if [ ! -z ${VIASH_PAR_SEEDMULTIMAPNMAX+x} ]; then echo "int(r'${VIASH_PAR_SEEDMULTIMAPNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'seedPerReadNmax': $( if [ ! -z ${VIASH_PAR_SEEDPERREADNMAX+x} ]; then echo "int(r'${VIASH_PAR_SEEDPERREADNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'seedPerWindowNmax': $( if [ ! -z ${VIASH_PAR_SEEDPERWINDOWNMAX+x} ]; then echo "int(r'${VIASH_PAR_SEEDPERWINDOWNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'seedNoneLociPerWindow': $( if [ ! -z ${VIASH_PAR_SEEDNONELOCIPERWINDOW+x} ]; then echo "int(r'${VIASH_PAR_SEEDNONELOCIPERWINDOW//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'seedSplitMin': $( if [ ! -z ${VIASH_PAR_SEEDSPLITMIN+x} ]; then echo "int(r'${VIASH_PAR_SEEDSPLITMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'seedMapMin': $( if [ ! -z ${VIASH_PAR_SEEDMAPMIN+x} ]; then echo "int(r'${VIASH_PAR_SEEDMAPMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'alignIntronMin': $( if [ ! -z ${VIASH_PAR_ALIGNINTRONMIN+x} ]; then echo "int(r'${VIASH_PAR_ALIGNINTRONMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'alignIntronMax': $( if [ ! -z ${VIASH_PAR_ALIGNINTRONMAX+x} ]; then echo "int(r'${VIASH_PAR_ALIGNINTRONMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'alignMatesGapMax': $( if [ ! -z ${VIASH_PAR_ALIGNMATESGAPMAX+x} ]; then echo "int(r'${VIASH_PAR_ALIGNMATESGAPMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'alignSJoverhangMin': $( if [ ! -z ${VIASH_PAR_ALIGNSJOVERHANGMIN+x} ]; then echo "int(r'${VIASH_PAR_ALIGNSJOVERHANGMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'alignSJstitchMismatchNmax': $( if [ ! -z ${VIASH_PAR_ALIGNSJSTITCHMISMATCHNMAX+x} ]; then echo "list(map(int, r'${VIASH_PAR_ALIGNSJSTITCHMISMATCHNMAX//\'/\'\"\'\"r\'}'.split(';')))"; else echo None; fi ),
  'alignSJDBoverhangMin': $( if [ ! -z ${VIASH_PAR_ALIGNSJDBOVERHANGMIN+x} ]; then echo "int(r'${VIASH_PAR_ALIGNSJDBOVERHANGMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'alignSplicedMateMapLmin': $( if [ ! -z ${VIASH_PAR_ALIGNSPLICEDMATEMAPLMIN+x} ]; then echo "int(r'${VIASH_PAR_ALIGNSPLICEDMATEMAPLMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'alignSplicedMateMapLminOverLmate': $( if [ ! -z ${VIASH_PAR_ALIGNSPLICEDMATEMAPLMINOVERLMATE+x} ]; then echo "float(r'${VIASH_PAR_ALIGNSPLICEDMATEMAPLMINOVERLMATE//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'alignWindowsPerReadNmax': $( if [ ! -z ${VIASH_PAR_ALIGNWINDOWSPERREADNMAX+x} ]; then echo "int(r'${VIASH_PAR_ALIGNWINDOWSPERREADNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'alignTranscriptsPerWindowNmax': $( if [ ! -z ${VIASH_PAR_ALIGNTRANSCRIPTSPERWINDOWNMAX+x} ]; then echo "int(r'${VIASH_PAR_ALIGNTRANSCRIPTSPERWINDOWNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'alignTranscriptsPerReadNmax': $( if [ ! -z ${VIASH_PAR_ALIGNTRANSCRIPTSPERREADNMAX+x} ]; then echo "int(r'${VIASH_PAR_ALIGNTRANSCRIPTSPERREADNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'alignEndsType': $( if [ ! -z ${VIASH_PAR_ALIGNENDSTYPE+x} ]; then echo "r'${VIASH_PAR_ALIGNENDSTYPE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'alignEndsProtrude': $( if [ ! -z ${VIASH_PAR_ALIGNENDSPROTRUDE+x} ]; then echo "r'${VIASH_PAR_ALIGNENDSPROTRUDE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'alignSoftClipAtReferenceEnds': $( if [ ! -z ${VIASH_PAR_ALIGNSOFTCLIPATREFERENCEENDS+x} ]; then echo "r'${VIASH_PAR_ALIGNSOFTCLIPATREFERENCEENDS//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'alignInsertionFlush': $( if [ ! -z ${VIASH_PAR_ALIGNINSERTIONFLUSH+x} ]; then echo "r'${VIASH_PAR_ALIGNINSERTIONFLUSH//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'peOverlapNbasesMin': $( if [ ! -z ${VIASH_PAR_PEOVERLAPNBASESMIN+x} ]; then echo "int(r'${VIASH_PAR_PEOVERLAPNBASESMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'peOverlapMMp': $( if [ ! -z ${VIASH_PAR_PEOVERLAPMMP+x} ]; then echo "float(r'${VIASH_PAR_PEOVERLAPMMP//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'winAnchorMultimapNmax': $( if [ ! -z ${VIASH_PAR_WINANCHORMULTIMAPNMAX+x} ]; then echo "int(r'${VIASH_PAR_WINANCHORMULTIMAPNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'winBinNbits': $( if [ ! -z ${VIASH_PAR_WINBINNBITS+x} ]; then echo "int(r'${VIASH_PAR_WINBINNBITS//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'winAnchorDistNbins': $( if [ ! -z ${VIASH_PAR_WINANCHORDISTNBINS+x} ]; then echo "int(r'${VIASH_PAR_WINANCHORDISTNBINS//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'winFlankNbins': $( if [ ! -z ${VIASH_PAR_WINFLANKNBINS+x} ]; then echo "int(r'${VIASH_PAR_WINFLANKNBINS//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'winReadCoverageRelativeMin': $( if [ ! -z ${VIASH_PAR_WINREADCOVERAGERELATIVEMIN+x} ]; then echo "float(r'${VIASH_PAR_WINREADCOVERAGERELATIVEMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'winReadCoverageBasesMin': $( if [ ! -z ${VIASH_PAR_WINREADCOVERAGEBASESMIN+x} ]; then echo "int(r'${VIASH_PAR_WINREADCOVERAGEBASESMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'chimOutType': $( if [ ! -z ${VIASH_PAR_CHIMOUTTYPE+x} ]; then echo "r'${VIASH_PAR_CHIMOUTTYPE//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'chimSegmentMin': $( if [ ! -z ${VIASH_PAR_CHIMSEGMENTMIN+x} ]; then echo "int(r'${VIASH_PAR_CHIMSEGMENTMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'chimScoreMin': $( if [ ! -z ${VIASH_PAR_CHIMSCOREMIN+x} ]; then echo "int(r'${VIASH_PAR_CHIMSCOREMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'chimScoreDropMax': $( if [ ! -z ${VIASH_PAR_CHIMSCOREDROPMAX+x} ]; then echo "int(r'${VIASH_PAR_CHIMSCOREDROPMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'chimScoreSeparation': $( if [ ! -z ${VIASH_PAR_CHIMSCORESEPARATION+x} ]; then echo "int(r'${VIASH_PAR_CHIMSCORESEPARATION//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'chimScoreJunctionNonGTAG': $( if [ ! -z ${VIASH_PAR_CHIMSCOREJUNCTIONNONGTAG+x} ]; then echo "int(r'${VIASH_PAR_CHIMSCOREJUNCTIONNONGTAG//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'chimJunctionOverhangMin': $( if [ ! -z ${VIASH_PAR_CHIMJUNCTIONOVERHANGMIN+x} ]; then echo "int(r'${VIASH_PAR_CHIMJUNCTIONOVERHANGMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'chimSegmentReadGapMax': $( if [ ! -z ${VIASH_PAR_CHIMSEGMENTREADGAPMAX+x} ]; then echo "int(r'${VIASH_PAR_CHIMSEGMENTREADGAPMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'chimFilter': $( if [ ! -z ${VIASH_PAR_CHIMFILTER+x} ]; then echo "r'${VIASH_PAR_CHIMFILTER//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'chimMainSegmentMultNmax': $( if [ ! -z ${VIASH_PAR_CHIMMAINSEGMENTMULTNMAX+x} ]; then echo "int(r'${VIASH_PAR_CHIMMAINSEGMENTMULTNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'chimMultimapNmax': $( if [ ! -z ${VIASH_PAR_CHIMMULTIMAPNMAX+x} ]; then echo "int(r'${VIASH_PAR_CHIMMULTIMAPNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'chimMultimapScoreRange': $( if [ ! -z ${VIASH_PAR_CHIMMULTIMAPSCORERANGE+x} ]; then echo "int(r'${VIASH_PAR_CHIMMULTIMAPSCORERANGE//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'chimNonchimScoreDropMin': $( if [ ! -z ${VIASH_PAR_CHIMNONCHIMSCOREDROPMIN+x} ]; then echo "int(r'${VIASH_PAR_CHIMNONCHIMSCOREDROPMIN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'chimOutJunctionFormat': $( if [ ! -z ${VIASH_PAR_CHIMOUTJUNCTIONFORMAT+x} ]; then echo "int(r'${VIASH_PAR_CHIMOUTJUNCTIONFORMAT//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'quantMode': $( if [ ! -z ${VIASH_PAR_QUANTMODE+x} ]; then echo "r'${VIASH_PAR_QUANTMODE//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'quantTranscriptomeBAMcompression': $( if [ ! -z ${VIASH_PAR_QUANTTRANSCRIPTOMEBAMCOMPRESSION+x} ]; then echo "int(r'${VIASH_PAR_QUANTTRANSCRIPTOMEBAMCOMPRESSION//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'quantTranscriptomeBan': $( if [ ! -z ${VIASH_PAR_QUANTTRANSCRIPTOMEBAN+x} ]; then echo "r'${VIASH_PAR_QUANTTRANSCRIPTOMEBAN//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'twopassMode': $( if [ ! -z ${VIASH_PAR_TWOPASSMODE+x} ]; then echo "r'${VIASH_PAR_TWOPASSMODE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'twopass1readsN': $( if [ ! -z ${VIASH_PAR_TWOPASS1READSN+x} ]; then echo "int(r'${VIASH_PAR_TWOPASS1READSN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'waspOutputMode': $( if [ ! -z ${VIASH_PAR_WASPOUTPUTMODE+x} ]; then echo "r'${VIASH_PAR_WASPOUTPUTMODE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'soloType': $( if [ ! -z ${VIASH_PAR_SOLOTYPE+x} ]; then echo "r'${VIASH_PAR_SOLOTYPE//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'soloCBwhitelist': $( if [ ! -z ${VIASH_PAR_SOLOCBWHITELIST+x} ]; then echo "r'${VIASH_PAR_SOLOCBWHITELIST//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'soloCBstart': $( if [ ! -z ${VIASH_PAR_SOLOCBSTART+x} ]; then echo "int(r'${VIASH_PAR_SOLOCBSTART//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'soloCBlen': $( if [ ! -z ${VIASH_PAR_SOLOCBLEN+x} ]; then echo "int(r'${VIASH_PAR_SOLOCBLEN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'soloUMIstart': $( if [ ! -z ${VIASH_PAR_SOLOUMISTART+x} ]; then echo "int(r'${VIASH_PAR_SOLOUMISTART//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'soloUMIlen': $( if [ ! -z ${VIASH_PAR_SOLOUMILEN+x} ]; then echo "int(r'${VIASH_PAR_SOLOUMILEN//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'soloBarcodeReadLength': $( if [ ! -z ${VIASH_PAR_SOLOBARCODEREADLENGTH+x} ]; then echo "int(r'${VIASH_PAR_SOLOBARCODEREADLENGTH//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'soloBarcodeMate': $( if [ ! -z ${VIASH_PAR_SOLOBARCODEMATE+x} ]; then echo "int(r'${VIASH_PAR_SOLOBARCODEMATE//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'soloCBposition': $( if [ ! -z ${VIASH_PAR_SOLOCBPOSITION+x} ]; then echo "r'${VIASH_PAR_SOLOCBPOSITION//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'soloUMIposition': $( if [ ! -z ${VIASH_PAR_SOLOUMIPOSITION+x} ]; then echo "r'${VIASH_PAR_SOLOUMIPOSITION//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'soloAdapterSequence': $( if [ ! -z ${VIASH_PAR_SOLOADAPTERSEQUENCE+x} ]; then echo "r'${VIASH_PAR_SOLOADAPTERSEQUENCE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'soloAdapterMismatchesNmax': $( if [ ! -z ${VIASH_PAR_SOLOADAPTERMISMATCHESNMAX+x} ]; then echo "int(r'${VIASH_PAR_SOLOADAPTERMISMATCHESNMAX//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'soloCBmatchWLtype': $( if [ ! -z ${VIASH_PAR_SOLOCBMATCHWLTYPE+x} ]; then echo "r'${VIASH_PAR_SOLOCBMATCHWLTYPE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'soloInputSAMattrBarcodeSeq': $( if [ ! -z ${VIASH_PAR_SOLOINPUTSAMATTRBARCODESEQ+x} ]; then echo "r'${VIASH_PAR_SOLOINPUTSAMATTRBARCODESEQ//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'soloInputSAMattrBarcodeQual': $( if [ ! -z ${VIASH_PAR_SOLOINPUTSAMATTRBARCODEQUAL+x} ]; then echo "r'${VIASH_PAR_SOLOINPUTSAMATTRBARCODEQUAL//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'soloStrand': $( if [ ! -z ${VIASH_PAR_SOLOSTRAND+x} ]; then echo "r'${VIASH_PAR_SOLOSTRAND//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'soloFeatures': $( if [ ! -z ${VIASH_PAR_SOLOFEATURES+x} ]; then echo "r'${VIASH_PAR_SOLOFEATURES//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'soloMultiMappers': $( if [ ! -z ${VIASH_PAR_SOLOMULTIMAPPERS+x} ]; then echo "r'${VIASH_PAR_SOLOMULTIMAPPERS//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'soloUMIdedup': $( if [ ! -z ${VIASH_PAR_SOLOUMIDEDUP+x} ]; then echo "r'${VIASH_PAR_SOLOUMIDEDUP//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'soloUMIfiltering': $( if [ ! -z ${VIASH_PAR_SOLOUMIFILTERING+x} ]; then echo "r'${VIASH_PAR_SOLOUMIFILTERING//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'soloOutFileNames': $( if [ ! -z ${VIASH_PAR_SOLOOUTFILENAMES+x} ]; then echo "r'${VIASH_PAR_SOLOOUTFILENAMES//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'soloCellFilter': $( if [ ! -z ${VIASH_PAR_SOLOCELLFILTER+x} ]; then echo "r'${VIASH_PAR_SOLOCELLFILTER//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'soloOutFormatFeaturesGeneField3': $( if [ ! -z ${VIASH_PAR_SOLOOUTFORMATFEATURESGENEFIELD3+x} ]; then echo "r'${VIASH_PAR_SOLOOUTFORMATFEATURESGENEFIELD3//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'soloCellReadStats': $( if [ ! -z ${VIASH_PAR_SOLOCELLREADSTATS+x} ]; then echo "r'${VIASH_PAR_SOLOCELLREADSTATS//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'stranded': $( if [ ! -z ${VIASH_PAR_STRANDED+x} ]; then echo "r'${VIASH_PAR_STRANDED//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'minimum_alignment_quality': $( if [ ! -z ${VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY+x} ]; then echo "int(r'${VIASH_PAR_MINIMUM_ALIGNMENT_QUALITY//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'type': $( if [ ! -z ${VIASH_PAR_TYPE+x} ]; then echo "r'${VIASH_PAR_TYPE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'id_attribute': $( if [ ! -z ${VIASH_PAR_ID_ATTRIBUTE+x} ]; then echo "r'${VIASH_PAR_ID_ATTRIBUTE//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'additional_attributes': $( if [ ! -z ${VIASH_PAR_ADDITIONAL_ATTRIBUTES+x} ]; then echo "r'${VIASH_PAR_ADDITIONAL_ATTRIBUTES//\'/\'\"\'\"r\'}'.split(';')"; else echo None; fi ),
  'add_chromosome_info': $( if [ ! -z ${VIASH_PAR_ADD_CHROMOSOME_INFO+x} ]; then echo "r'${VIASH_PAR_ADD_CHROMOSOME_INFO//\'/\'\"\'\"r\'}'.lower() == 'true'"; else echo None; fi ),
  'mode': $( if [ ! -z ${VIASH_PAR_MODE+x} ]; then echo "r'${VIASH_PAR_MODE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'non_unique': $( if [ ! -z ${VIASH_PAR_NON_UNIQUE+x} ]; then echo "r'${VIASH_PAR_NON_UNIQUE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'secondary_alignments': $( if [ ! -z ${VIASH_PAR_SECONDARY_ALIGNMENTS+x} ]; then echo "r'${VIASH_PAR_SECONDARY_ALIGNMENTS//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'supplementary_alignments': $( if [ ! -z ${VIASH_PAR_SUPPLEMENTARY_ALIGNMENTS+x} ]; then echo "r'${VIASH_PAR_SUPPLEMENTARY_ALIGNMENTS//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'counts_output_sparse': $( if [ ! -z ${VIASH_PAR_COUNTS_OUTPUT_SPARSE+x} ]; then echo "r'${VIASH_PAR_COUNTS_OUTPUT_SPARSE//\'/\'\"\'\"r\'}'.lower() == 'true'"; else echo None; fi )
}
meta = {
  'name': $( if [ ! -z ${VIASH_META_NAME+x} ]; then echo "r'${VIASH_META_NAME//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'functionality_name': $( if [ ! -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then echo "r'${VIASH_META_FUNCTIONALITY_NAME//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'resources_dir': $( if [ ! -z ${VIASH_META_RESOURCES_DIR+x} ]; then echo "r'${VIASH_META_RESOURCES_DIR//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'executable': $( if [ ! -z ${VIASH_META_EXECUTABLE+x} ]; then echo "r'${VIASH_META_EXECUTABLE//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'config': $( if [ ! -z ${VIASH_META_CONFIG+x} ]; then echo "r'${VIASH_META_CONFIG//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'temp_dir': $( if [ ! -z ${VIASH_META_TEMP_DIR+x} ]; then echo "r'${VIASH_META_TEMP_DIR//\'/\'\"\'\"r\'}'"; else echo None; fi ),
  'cpus': $( if [ ! -z ${VIASH_META_CPUS+x} ]; then echo "int(r'${VIASH_META_CPUS//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'memory_b': $( if [ ! -z ${VIASH_META_MEMORY_B+x} ]; then echo "int(r'${VIASH_META_MEMORY_B//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'memory_kb': $( if [ ! -z ${VIASH_META_MEMORY_KB+x} ]; then echo "int(r'${VIASH_META_MEMORY_KB//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'memory_mb': $( if [ ! -z ${VIASH_META_MEMORY_MB+x} ]; then echo "int(r'${VIASH_META_MEMORY_MB//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'memory_gb': $( if [ ! -z ${VIASH_META_MEMORY_GB+x} ]; then echo "int(r'${VIASH_META_MEMORY_GB//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'memory_tb': $( if [ ! -z ${VIASH_META_MEMORY_TB+x} ]; then echo "int(r'${VIASH_META_MEMORY_TB//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'memory_pb': $( if [ ! -z ${VIASH_META_MEMORY_PB+x} ]; then echo "int(r'${VIASH_META_MEMORY_PB//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'memory_kib': $( if [ ! -z ${VIASH_META_MEMORY_KIB+x} ]; then echo "int(r'${VIASH_META_MEMORY_KIB//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'memory_mib': $( if [ ! -z ${VIASH_META_MEMORY_MIB+x} ]; then echo "int(r'${VIASH_META_MEMORY_MIB//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'memory_gib': $( if [ ! -z ${VIASH_META_MEMORY_GIB+x} ]; then echo "int(r'${VIASH_META_MEMORY_GIB//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'memory_tib': $( if [ ! -z ${VIASH_META_MEMORY_TIB+x} ]; then echo "int(r'${VIASH_META_MEMORY_TIB//\'/\'\"\'\"r\'}')"; else echo None; fi ),
  'memory_pib': $( if [ ! -z ${VIASH_META_MEMORY_PIB+x} ]; then echo "int(r'${VIASH_META_MEMORY_PIB//\'/\'\"\'\"r\'}')"; else echo None; fi )
}
dep = {
  
}

## VIASH END

########################
### Helper functions ###
########################


def fetch_arguments_info(config: Dict[str, Any]) -> Dict[str, Any]:
    """Fetch arguments from config"""
    arguments = {
        arg["name"].removeprefix("-").removeprefix("-"): arg
        for group in config["argument_groups"]
        for arg in group["arguments"]
    }
    return arguments


def process_par(
    par: Dict[str, Any],
    arguments_info: Dict[str, Any],
    gz_args: List[str],
    temp_dir: Path,
) -> Dict[str, Any]:
    """
    Process the Viash par dictionary

    This turns file strings into Path objects and extracting gzipped files if need be.

    Parameters
    ----------
    par: The par dictionary created by Viash
    arguments_info: The arguments info Dictionary created by \`fetch_arguments_info\`
    gz_args: A list of argument keys which could be gzip files which need to be decompressed.
    temp_dir: A temporary directory in which to ungzip files
    """
    new_par = {}
    for key, value in par.items():
        arg_info = arguments_info[key]
        # turn file arguments into paths
        if value and arg_info["type"] == "file":
            is_multiple = isinstance(value, list)

            if is_multiple:
                value = [Path(val) for val in value]
            else:
                value = Path(value)

            if key in gz_args:
                print(f">> Checking compression of --{key}", flush=True)
                # turn value into list if need be
                if not is_multiple:
                    value = [value]

                # extract
                value = [extract_if_need_be(path, temp_dir) for path in value]

                # unlist if need be
                if not is_multiple:
                    value = value[0]

        new_par[key] = value
    return new_par


def generate_cmd_arguments(par, arguments_info, step_filter=None, flatten=False):
    """
    Generate command-line arguments by fetching the relevant args

    Parameters
    ----------
    par: The par dictionary created by Viash
    arguments_info: The arguments info Dictionary created by \`fetch_arguments_info\`
    step_filter: If provided,\`par\` will be filtered to only contain arguments for which
      argument.info.step == step_filter.
    flatten: If \`False\`, the command for an argument with multiple values will be
      \`["--key", "value1", "--key", "value2"]\`, otherwise \`["--key", "value1", "value2"]\`.
    """
    cmd_args = []

    for key, arg in arguments_info.items():
        arg_val = par.get(key)
        # The info key is always present (changed in viash 0.7.4)
        # in the parsed config (None if not specified in source config)
        info = arg["info"] or {}
        orig_arg = info.get("orig_arg")
        step = info.get("step")
        if arg_val and orig_arg and (not step_filter or step == step_filter):
            if not arg.get("multiple", False):
                arg_val = [arg_val]

            if arg["type"] in ["boolean_true", "boolean_false"]:
                # if argument is a boolean_true or boolean_false, simply add the flag
                arg_val = [orig_arg]
            elif orig_arg.startswith("-"):
                # if the orig arg flag is not a positional,
                # add the flag in front of each element and flatten
                if flatten:
                    arg_val = [str(x) for x in [orig_arg] + arg_val]
                else:
                    arg_val = [str(x) for val in arg_val for x in [orig_arg, val]]

            cmd_args.extend(arg_val)

    return cmd_args


def is_gz_file(path: Path) -> bool:
    """Check whether something is a gzip"""
    with open(path, "rb") as file:
        return file.read(2) == b"\\x1f\\x8b"


def extract_if_need_be(par_value: Path, temp_dir_path: Path) -> Path:
    """if {par_value} is a Path, extract it to a temp_dir_path and return the resulting path"""
    if par_value.is_file() and tarfile.is_tarfile(par_value):
        # Remove two extensions (if they exist)
        extaction_dir_name = Path(par_value.stem).stem
        unpacked_path = temp_dir_path / extaction_dir_name
        print(f"  Tar detected; extracting {par_value} to {unpacked_path}", flush=True)

        with tarfile.open(par_value, "r") as open_tar:
            members = open_tar.getmembers()
            root_dirs = [
                member
                for member in members
                if member.isdir() and member.name != "." and "/" not in member.name
            ]
            # if there is only one root_dir (and there are files in that directory)
            # strip that directory name from the destination folder
            if len(root_dirs) == 1:
                for mem in members:
                    mem.path = Path(*Path(mem.path).parts[1:])
            members_to_move = [mem for mem in members if mem.path != Path(".")]
            open_tar.extractall(unpacked_path, members=members_to_move)
        return unpacked_path

    elif par_value.is_file() and is_gz_file(par_value):
        # Remove extension (if it exists)
        extaction_file_name = Path(par_value.stem)
        unpacked_path = temp_dir_path / extaction_file_name
        print(f"  Gzip detected; extracting {par_value} to {unpacked_path}", flush=True)

        with gzip.open(par_value, "rb") as f_in:
            with open(unpacked_path, "wb") as f_out:
                shutil.copyfileobj(f_in, f_out)
        return unpacked_path

    else:
        return par_value


def load_star_reference(reference_index: str) -> None:
    """Load star reference index into memory."""
    subprocess.run(
        [
            "STAR",
            "--genomeLoad",
            "LoadAndExit",
            "--genomeDir",
            str(reference_index),
        ],
        check=True,
    )


def unload_star_reference(reference_index: str) -> None:
    """Remove star reference index from memory."""
    subprocess.run(
        [
            "STAR",
            "--genomeLoad",
            "Remove",
            "--genomeDir",
            str(reference_index),
        ],
        check=True,
    )


def star_and_htseq(
    group_id: str,
    r1_files: List[Path],
    r2_files: List[Path],
    temp_dir: Path,
    par: Dict[str, Any],
    arguments_info: Dict[str, Any],
    num_threads: int,
) -> Tuple[int, str]:
    star_output = par["output"] / "per" / group_id
    temp_dir_group = temp_dir / f"star_tmp_{group_id}"
    unsorted_bam = star_output / "Aligned.out.bam"
    sorted_bam = star_output / "Aligned.sorted.out.bam"
    counts_file = star_output / "htseq-count.txt"
    multiqc_path = star_output / "multiqc_data"

    print(f">> Running STAR for group '{group_id}' with command:", flush=True)
    star_output.mkdir(parents=True, exist_ok=True)
    temp_dir_group.parent.mkdir(parents=True, exist_ok=True)
    run_star(
        r1_files=r1_files,
        r2_files=r2_files,
        output_dir=star_output,
        temp_dir=temp_dir / f"star_tmp_{group_id}",
        par=par,
        arguments_info=arguments_info,
        num_threads=num_threads,
    )
    if not unsorted_bam.exists():
        return (1, f"Could not find unsorted bam at '{unsorted_bam}'")

    if par["run_htseq_count"]:
        print(
            f">> Running samtools sort for group '{group_id}' with command:", flush=True
        )
        run_samtools_sort(unsorted_bam, sorted_bam)
        if not sorted_bam.exists():
            return (1, f"Could not find sorted bam at '{unsorted_bam}'")

        print(
            f">> Running htseq-count for group '{group_id}' with command:", flush=True
        )
        run_htseq_count(sorted_bam, counts_file, par, arguments_info)
        if not counts_file.exists():
            return (1, f"Could not find counts at '{counts_file}'")

    if par["run_multiqc"]:
        run_multiqc(star_output)
        if not multiqc_path.exists():
            return (1, f"Could not find MultiQC output at '{multiqc_path}'")

    return (0, "")


def run_star(
    r1_files: List[Path],
    r2_files: List[Path],
    output_dir: Path,
    temp_dir: Path,
    par: Dict[str, Any],
    arguments_info: Dict[str, Any],
    num_threads: int,
) -> None:
    """Run star"""
    # process manual arguments
    r1_pasted = [",".join([str(r1) for r1 in r1_files])]
    r2_pasted = [",".join([str(r2) for r2 in r2_files])] if r2_files else []
    manual_par = {
        "--genomeDir": [par["reference_index"]],
        "--genomeLoad": ["LoadAndRemove"],
        "--runThreadN": [str(num_threads)],
        "--runMode": ["alignReads"],
        "--readFilesIn": r1_pasted + r2_pasted,
        # create a tempdir per group
        "--outTmpDir": [temp_dir],
        # make sure there is a trailing /
        "--outFileNamePrefix": [f"{output_dir}/"],
        # fix the outSAMtype to return unsorted BAM files
        "--outSAMtype": ["BAM", "Unsorted"],
    }
    manual_cmd = [str(x) for key, values in manual_par.items() for x in [key] + values]

    # process all passthrough star arguments
    par_cmd = generate_cmd_arguments(par, arguments_info, "star", flatten=True)

    # combine into one command and turn into strings
    cmd_args = [str(val) for val in ["STAR"] + manual_cmd + par_cmd]

    # run star
    subprocess.run(cmd_args, check=True)


def run_samtools_sort(unsorted_bam: Path, sorted_bam: Path) -> None:
    "Run samtools sort"
    cmd_args = [
        "samtools",
        "sort",
        "-o",
        sorted_bam,
        unsorted_bam,
    ]
    subprocess.run(cmd_args, check=True)


def run_htseq_count(
    sorted_bam: Path,
    counts_file: Path,
    par: Dict[str, Any],
    arguments_info: Dict[str, Any],
) -> None:
    """Run HTSeq count"""
    # process manual arguments
    manual_cmd = [sorted_bam, par["reference_gtf"]]

    # process all passthrough htseq arguments
    par_cmd = generate_cmd_arguments(par, arguments_info, "htseq")

    # combine into one command and turn into strings
    cmd_args = [str(val) for val in ["htseq-count"] + manual_cmd + par_cmd]

    # run htseq
    with open(counts_file, "w", encoding="utf-8") as file:
        subprocess.run(cmd_args, check=True, stdout=file)


def get_feature_info(reference_gtf) -> pd.DataFrame:
    filtered_result = []
    db = gffutils.create_db(reference_gtf, ":memory:")
    for item in db.all_features():
        item_tuple = item.astuple()
        # index 2 is the 'source', 3 is the feature type
        if item_tuple[3] == "gene" or item_tuple[2] == "ERCC":
            filtered_result.append(
                (
                    item.attributes["gene_id"][0],
                    "Gene Expression",
                    item.attributes["gene_name"][0],
                )
            )
    return pd.DataFrame(
        filtered_result, columns=["feature_id", "feature_type", "feature_name"]
    )


def run_multiqc(input_dir: Path) -> None:
    cmd_args = [
        "multiqc",
        str(input_dir),
        "--outdir",
        str(input_dir),
        "--no-report",
        "--force",
    ]

    # run multiqc
    subprocess.run(cmd_args, check=True)


########################
###    Main code     ###
########################


def main(par, meta):
    """Main function"""

    # check input arguments
    assert len(par["input_id"]) == len(par["input_r1"]), (
        "--input_r1 should have same length as --input_id"
    )
    if par["input_r2"]:
        assert len(par["input_id"]) == len(par["input_r2"]), (
            "--input_r2 should have same length as --input_id"
        )

    # read config arguments
    with open(meta["config"], "r", encoding="utf-8") as file:
        config = yaml.safe_load(file)

    # fetch all arguments from the config and turn it into a Dict[str, Argument]
    arguments_info = fetch_arguments_info(config)

    # temp_dir = "tmp/"
    with tempfile.TemporaryDirectory(
        prefix=f"{meta['name']}-", dir=meta["temp_dir"], ignore_cleanup_errors=True
    ) as temp_dir:
        temp_dir = Path(temp_dir)
        temp_dir.mkdir(parents=True, exist_ok=True)

        # turn file strings into Paths and decompress gzip if need be
        gz_args = ["input_r1", "input_r2", "reference_index", "reference_gtf"]
        par = process_par(par, arguments_info, gz_args, temp_dir)

        # make sure input_r2 has same length as input_r1
        if not par["input_r2"]:
            par["input_r2"] = [None for _ in par["input_r1"]]

        # group input_files by input_id
        print(">> Group by --input_id", flush=True)
        grouped_inputs = {}
        for group_id, file_r1, file_r2 in zip(
            par["input_id"], par["input_r1"], par["input_r2"]
        ):
            if group_id not in grouped_inputs:
                grouped_inputs[group_id] = ([], [])
            grouped_inputs[group_id][0].append(file_r1)
            if file_r2:
                grouped_inputs[group_id][1].append(file_r2)

        # create output dir if need be
        par["output"].mkdir(parents=True, exist_ok=True)

        # store features metadata
        feature_info = get_feature_info(str(par["reference_gtf"]))
        with open(par["output"] / "feature_info.tsv", "w", encoding="utf-8") as file:
            feature_info.to_csv(file, sep="\\t", index=False)

        # try:
        #     print(">> Loading genome in memory", flush=True)
        #     load_star_reference(par["reference_index"])

        cpus = meta.get("cpus", 1)
        num_items = len(grouped_inputs)
        pool_size = min(cpus, num_items)
        num_threads_per_task = math.ceil(cpus / pool_size)

        with Pool(pool_size) as pool:
            outs = pool.starmap(
                lambda group_id, files: star_and_htseq(
                    group_id=group_id,
                    r1_files=files[0],
                    r2_files=files[1],
                    temp_dir=temp_dir,
                    par=par,
                    arguments_info=arguments_info,
                    num_threads=num_threads_per_task,
                ),
                grouped_inputs.items(),
            )

        num_errored = 0
        for exit, msg in outs:
            if exit != 0:
                print(f"Error: {msg}")
                num_errored += 1

        pct_succeeded = 1.0 - num_errored / len(outs)
        print("------------------")
        print(f"Success rate: {math.ceil(pct_succeeded * 100)}%")

        assert pct_succeeded >= par["min_success_rate"], (
            f"Success rate should be at least {math.ceil(par['min_success_rate'] * 100)}%"
        )


if __name__ == "__main__":
    main(par, meta)
VIASHMAIN
python -B "\$tempscript" &
wait "\$!"

VIASHEOF


if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then
  # strip viash automount from file paths
  
  if [ ! -z "$VIASH_PAR_INPUT_R1" ]; then
    unset VIASH_TEST_INPUT_R1
    IFS=';'
    for var in $VIASH_PAR_INPUT_R1; do
      unset IFS
      if [ -z "$VIASH_TEST_INPUT_R1" ]; then
      VIASH_TEST_INPUT_R1="$(ViashDockerStripAutomount "$var")"
    else
      VIASH_TEST_INPUT_R1="$VIASH_TEST_INPUT_R1;""$(ViashDockerStripAutomount "$var")"
    fi
    done
    VIASH_PAR_INPUT_R1="$VIASH_TEST_INPUT_R1"
  fi
  if [ ! -z "$VIASH_PAR_INPUT_R2" ]; then
    unset VIASH_TEST_INPUT_R2
    IFS=';'
    for var in $VIASH_PAR_INPUT_R2; do
      unset IFS
      if [ -z "$VIASH_TEST_INPUT_R2" ]; then
      VIASH_TEST_INPUT_R2="$(ViashDockerStripAutomount "$var")"
    else
      VIASH_TEST_INPUT_R2="$VIASH_TEST_INPUT_R2;""$(ViashDockerStripAutomount "$var")"
    fi
    done
    VIASH_PAR_INPUT_R2="$VIASH_TEST_INPUT_R2"
  fi
  if [ ! -z "$VIASH_PAR_REFERENCE_INDEX" ]; then
    VIASH_PAR_REFERENCE_INDEX=$(ViashDockerStripAutomount "$VIASH_PAR_REFERENCE_INDEX")
  fi
  if [ ! -z "$VIASH_PAR_REFERENCE_GTF" ]; then
    VIASH_PAR_REFERENCE_GTF=$(ViashDockerStripAutomount "$VIASH_PAR_REFERENCE_GTF")
  fi
  if [ ! -z "$VIASH_PAR_OUTPUT" ]; then
    VIASH_PAR_OUTPUT=$(ViashDockerStripAutomount "$VIASH_PAR_OUTPUT")
  fi
  if [ ! -z "$VIASH_PAR_GENOMEFASTAFILES" ]; then
    unset VIASH_TEST_GENOMEFASTAFILES
    IFS=';'
    for var in $VIASH_PAR_GENOMEFASTAFILES; do
      unset IFS
      if [ -z "$VIASH_TEST_GENOMEFASTAFILES" ]; then
      VIASH_TEST_GENOMEFASTAFILES="$(ViashDockerStripAutomount "$var")"
    else
      VIASH_TEST_GENOMEFASTAFILES="$VIASH_TEST_GENOMEFASTAFILES;""$(ViashDockerStripAutomount "$var")"
    fi
    done
    VIASH_PAR_GENOMEFASTAFILES="$VIASH_TEST_GENOMEFASTAFILES"
  fi
  if [ ! -z "$VIASH_PAR_SJDBGTFFILE" ]; then
    VIASH_PAR_SJDBGTFFILE=$(ViashDockerStripAutomount "$VIASH_PAR_SJDBGTFFILE")
  fi
  if [ ! -z "$VIASH_PAR_READFILESMANIFEST" ]; then
    VIASH_PAR_READFILESMANIFEST=$(ViashDockerStripAutomount "$VIASH_PAR_READFILESMANIFEST")
  fi
  if [ ! -z "$VIASH_META_RESOURCES_DIR" ]; then
    VIASH_META_RESOURCES_DIR=$(ViashDockerStripAutomount "$VIASH_META_RESOURCES_DIR")
  fi
  if [ ! -z "$VIASH_META_EXECUTABLE" ]; then
    VIASH_META_EXECUTABLE=$(ViashDockerStripAutomount "$VIASH_META_EXECUTABLE")
  fi
  if [ ! -z "$VIASH_META_CONFIG" ]; then
    VIASH_META_CONFIG=$(ViashDockerStripAutomount "$VIASH_META_CONFIG")
  fi
  if [ ! -z "$VIASH_META_TEMP_DIR" ]; then
    VIASH_META_TEMP_DIR=$(ViashDockerStripAutomount "$VIASH_META_TEMP_DIR")
  fi
fi


# check whether required files exist
if [ ! -z "$VIASH_PAR_OUTPUT" ] && [ ! -e "$VIASH_PAR_OUTPUT" ]; then
  ViashError "Output file '$VIASH_PAR_OUTPUT' does not exist."
  exit 1
fi


exit 0
