Then in the main switch statement I read all the extra switches (may be multiple arguments, so must be last in the line):
--extraSwitches)
shift
extraSwitches=$*
break;;
And then each program would add these switches to its own arguments, so I have this:
echo "
$HaplotypeCaller \
...
--GVCFGQBands 10 --GVCFGQBands 20 --GVCFGQBands 50 $extraSwitches\
It would be good for the user to be able to add additional switches for the programs to use without having to adjust the main pipeline script.
One way to do this would be to have the setup script set an export an environment variable with the switches.
Another way, which is what I did, was to pass an extra argument from the setup script:
EXTRASWITCHES="-U ALLOW_SEQ_DICT_INCOMPATIBILITY" bash ${pipeline} --mode gvcf --supportFrame ${supportFrame} --reference ${reference} --inputFormat STDFQ --extraID $extraID --projectID ${projectID} --extraSwitches $EXTRASWITCHES
Then in the main switch statement I read all the extra switches (may be multiple arguments, so must be last in the line): --extraSwitches) shift extraSwitches=$* break;;
And then each program would add these switches to its own arguments, so I have this: echo " $HaplotypeCaller \ ... --GVCFGQBands 10 --GVCFGQBands 20 --GVCFGQBands 50 $extraSwitches\
There may be more elegant solutions.