Planemo
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
- Galaxy XML Tags
- What is Planemo ?
- Building Galaxy Tools Using Planemo
- Galaxy Development Training Slides
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,
Planemowill download & spin-up a standalone galaxy to test your wrappers. make sure you installedPlanemowithin a python environment as instructed in installation documentation forPlanemo.Each of the above commands supports
--helpoption. use it for the entire list of supported options.If
--no-xsdoption is used forlintingthe tool wrapper,Planemofinds 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 testexpects test data to be available in a folder named astest-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
Using
reStructuredTextto formathelpsection within the tool wrapper - documentationUse the online restructedText editor to write and format your content under
<help> </help>section for the wrapper.planemo creates a
tool_test_output.htmlfile to showing the errors and debugging information if tools fail otherwise, shows the test output.planemo servelets you visualize the tools wrapper in GALAXY instance once it passes the tests.
Flake8 & pycodestyle for python tools
- Python scripts must conform to
pep8standards and also passflake8, so that your tools pass thetravisCItests done byIUC. pycodestyleis 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 .