Skip to content
dickgroenenberg edited this page Jan 23, 2023 · 2 revisions

write to standard output (stdout)

Most tools on our Galaxy instance consist of a script (mostly Python,
occasionally R or other languages), a wrapper (.xml) for the visual
interface (to collect input/variables) and a bash shell script (.sh) to invoke
the command that will be send to the Python script and manage
temporary files/directories.

bash shell script (.sh)

When troubleshooting a tool it will be indispensible to know intermediate
output and positional arguments. Don't remove output location (comment out)
and show its path:
# rm -rf $outlocation
printf $outlocation
Show the contents of positional arguments:
printf "\n\$1 = %s\n\$2 = %s\n\$3 = %s\n\$4 = %s\n" "$1" "$2" "$3" "$4"
or if you have more than 10 positional arguments:
printf "\n\$1 = %s\n\$2 = %s\n\$3 = %s\n\$4 = %s\n\$5 = %s\n\$6 = %s\n\$7 = %s\n\$8 = %s\n\$9 = %s\n\$10 = %s\n\$11 = %s\n\$12 = %s\n\$13 = %s\n" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" "${10}" "${11}" "${12}" "${13}"
Create separators to structure stdout:
printf "\n\n\t stdout from galaxy-tool.sh\n" && printf '%.0s-' {1..100} && printf '\n'

python script ('tool' script)

Write variable, dictionary or result to stdout:
print("this is variable_q: ")
print(variable_q)

Clone this wiki locally