Skip to main content

Planemo

danger

This documentation was written for setting up Planemo on the Penn State University systems. Keep this in mind if you reference these instructions as they may be out of date.

Best Practices & Standards

Tool Development

Publishing to GALAXY Toolshed

Make sure you refer to the above links while writing tools and their xml wrappers. It will be easy to submit tools to Intergalactic Utilities Commission IUC, if you followed the above standards. emoji cheatsheet reference used in this documentation.

Install

  • Follow the instructions in the documentation to install on your machine.

Using Planemo

  • Three step process that every tool need to go through :

    • planemo lint <your_tool.xml>
    • planemo test <your_tool.xml> --galaxy_root=[path to your local galaxy instance] --test_data [path to the directory containing your testdata]
    • planemo serve <your_tool.xml> --galaxy_root=[path to your local galaxy instance]
  • If you don't want to use (or) don't have your local galaxy for testing, Planemo will download & spin-up a standalone galaxy to test your wrappers. make sure you installed Planemo within a python environment as instructed in installation documentation for Planemo.

  • Each of the above commands supports --help option. use it for the entire list of supported options.

  • If --no-xsd option is used for linting the tool wrapper,Planemo finds errors and warnings within your wrappers by ignoring the validation of correct XML schema. (read the documentation for more info, you might generally want to avoid using this option)

  • planemo test expects test data to be available in a folder named as test-data. you need to write tool specific tests and also provide test data for testing the wrapper, before running the command.

Writing functional tests for Tool Wrappers

References to writing proper tests

Flake8 & pycodestyle for python tools

  • Python scripts must conform to pep8 standards and also pass flake8, so that your tools pass the travisCI tests done by IUC.
  • pycodestyle is the utility to test your python scripts for pep8 coding standards
pycodestyle --show-pep8 --show-source --ignore=E501 <your_tool>.py
  • For the case of submitting and testing the pep8 conformations, the IUC ignores some of the minor errors , such as E501, E201, E202. Refer the below issue on IUC, on what was actually proposed. tools-iuc/issue/467

  • I would install flake8 and flake8-import-order to do a simple test to remove any errors that pop up after pep8. Below is the command to test the flake8 on the scripts within the current directory.

# installing flake8 and flake8-import-order
pip install flake8 flake8-import-order

# Testing for flake8 errors
flake8 --ignore=E201,E202,E501 --count .
  • flake8 documentation : here
  • flake8-import-order : here
  • pycodestyle documentation: here