Permalink
Browse files

Implement a planemo tool_factory command to launch the tool factory.

Works with all the same options as planemo serve - for instance planemo --install_galaxy tool_factory will download the latest tip of Galaxy and serve the tool factory from that.

This commit includes the most recent tool factory 2 code base ripped from tools-iuc (https://github.com/galaxyproject/tools-iuc/tree/master/tools/tool_factory_2 with the modifications from galaxyproject/tools-iuc#48).

This is very experimental - I can get the tool factory to show and run - but my tests never seem to produce output.
  • Loading branch information...
jmchilton committed Feb 15, 2015
1 parent badc25f commit 9e746b455e3b15219878cddcdeda722979639401
@@ -21,5 +21,6 @@ documentation describes these commands.
.. include:: commands/shed_upload.rst
.. include:: commands/syntax.rst
.. include:: commands/test.rst
.. include:: commands/tool_factory.rst
.. include:: commands/tool_init.rst
.. include:: commands/travis_init.rst
@@ -0,0 +1,40 @@

``tool_factory`` command
===============================

This section is auto-generated from the help text for the planemo command
``tool_factory``. This help message can be generated with ``planemo tool_factory
--help``.

**Usage**::

planemo tool_factory [OPTIONS]

**Help**

(Experimental) Launch Galaxy with the Tool Factory 2 available.

For more information about the Galaxy Tool Factory see the publication
Creating reusable tools from scripts: the Galaxy Tool Factory by Lazarus
et. al. (10.1093/bioinformatics/bts573). Available at
http://www.ncbi.nlm.nih.gov/pubmed/23024011.

**Options**::


--galaxy_root DIRECTORY Root of development galaxy directory to
execute command with.
--install_galaxy Download and configure a disposable copy of
Galaxy from github.
--test_data DIRECTORY test-data directory to for specified
tool(s).
--dependency_resolvers_config_file PATH
Dependency resolver configuration for Galaxy
to target.
--job_config_file PATH Job configuration file for Galaxy to target.
--tool_dependency_dir DIRECTORY
Tool dependency dir for Galaxy to target.
--brew_dependency_resolution Configure Galaxy to use plain brew
dependency resolution.
--help Show this message and exit.
@@ -0,0 +1,29 @@
import os

import click
from planemo.cli import pass_context
from planemo import options
from planemo import galaxy_serve


@click.command('tool_factory')
@options.galaxy_root_option()
@options.install_galaxy_option()
@options.test_data_option()
@options.dependency_resolvers_option()
@options.job_config_option()
@options.tool_dependency_dir_option()
@options.brew_dependency_resolution()
@pass_context
def cli(ctx, **kwds):
"""(Experimental) Launch Galaxy with the Tool Factory 2 available.
For more information about the Galaxy Tool Factory see the publication
Creating reusable tools from scripts: the Galaxy Tool Factory by Lazarus
et. al. (10.1093/bioinformatics/bts573). Available at
http://www.ncbi.nlm.nih.gov/pubmed/23024011.
"""
# TODO: de-duplicate option handling with cmd_serve.
mod_dir = os.path.dirname(__file__)
tf_dir = os.path.join(mod_dir, '..', '..', 'tool_factory_2')
galaxy_serve.serve(ctx, os.path.abspath(tf_dir), **kwds)
@@ -191,6 +191,7 @@ def config_join(*args):
if preseeded_database:
env["GALAXY_TEST_DB_TEMPLATE"] = os.path.abspath(database_location)
env["GALAXY_TEST_UPLOAD_ASYNC"] = "false"
env["GALAXY_DEVELOPMENT_ENVIRONMENT"] = "1"
web_config = __sub(WEB_SERVER_CONFIG_TEMPLATE, template_args)
open(config_join("galaxy.ini"), "w").write(web_config)
tool_conf_contents = __sub(TOOL_CONF_TEMPLATE, template_args)
@@ -42,6 +42,9 @@
'planemo_ext.galaxy.tools.deps.resolvers',
'planemo_ext.galaxy.util',
],
data_files=[('tool_factory_2', ['tool_factory_2/rgToolFactory2.xml',
'tool_factory_2/rgToolFactory2.py',
'tool_factory_2/getlocalrpackages.py'])],
entry_points='''
[console_scripts]
planemo=planemo.cli:planemo

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,16 @@
toolfactory_2
=============

This is an upgrade to the tool factory but with added parameters
(optionally editable in the generated tool form - otherwise fixed) and
multiple input files.

Any number of parameters up to the limit of your patience with repeat groups
These are optionally editable by the user - names cannot be changed so
no overwriting $JAVA_HOME_DIR or else permanently fixed and not editable at run time.

Any number of input files can be passed to your script, but of course it
has to deal with them. Both path and metadata name are supplied either in the environment
(bash/sh) or as command line parameters (python,perl,rscript) that need to be parsed and
dealt with in the script.

Oops, something went wrong.

0 comments on commit 9e746b4

Please sign in to comment.