Skip to content

Commit

Permalink
start (rudimentary) docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Sep 1, 2023
1 parent 6cb3919 commit 4cb7536
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/_writing_argparse.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Creating Galaxy tools from python scripts using argparse
========================================================

If a python script should be wrapped that creates its command line interface
using the argparse library, then planemo can generate a good starting point.

All you need to do is to pass the path to the python source file containing
the argparse definition. Lets use ``tests/data/autopygen/autopygen_end_to_end_sub.py``
from the planemo tests as an example:

::

$ planemo tool_init -i e2e -n e2e
--autopygen tests/data/autopygen/autopygen_end_to_end_sub.py
-- tool tool.xml

Here we only provided the ``id`` and ``name`` in addition to the python sources
and planemo creates a pretty tool xml files that can serve as a good starting point
to create a functional Galaxy tool in ``tool.xml``.
Additional information, e.g. requirements, help, etc, can and should be given with
additional parameters to planemo.

There are a few points that need to be edited in any case. Most importantly
since in most cases ``argparse`` does not distinguish between input and output
files all file parameters will be rendered as input parameters of the tool.

Please open an issue if you have ideas on how to improve the generated tools:
https://github.com/galaxyproject/planemo/issues


2 changes: 2 additions & 0 deletions docs/writing_standalone.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if you have not already installed it.
.. include:: _writing_parameters.rst
.. include:: _writing_scripts.rst
.. include:: _writing_suites.rst
.. include:: _writing_argparse.rst
.. include:: _writing_conclusion.rst

.. _Galaxy: http://galaxyproject.org/
Expand All @@ -21,3 +22,4 @@ if you have not already installed it.
.. _linuxbrew: https://github.com/Homebrew/linuxbrew
.. _Vagrant: https://www.vagrantup.com/
.. _Planemo: http://planemo.readthedocs.org/

0 comments on commit 4cb7536

Please sign in to comment.