FAQ

  1. How can I perform some debug logging within a code block?

    You can simply import the logging module within a code block. For example:

     1tools:
     2    default:
     3        cores: 2
     4        mem: cores * 3
     5        rules:
     6            - if: True
     7              execute: |
     8                import logging
     9                log = logging.getLogger(__name__)
    10                log.debug(f"Here's what the entity looks like: {entity}")
    
  2. How can I import custom libraries or code?

    As long as the code is available within Galaxy’s virtualenv or the python path, it can be imported like any other package. For example:

    1tools:
    2    default:
    3        cores: 2
    4        mem: cores * 3
    5        rules:
    6            - if: True
    7              execute: |
    8                import my_custom_module
    9                my_custom_module.my_func()