Skip to content

Commit 9e746b4

Browse files
committed
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.
1 parent badc25f commit 9e746b4

18 files changed

Lines changed: 2485 additions & 0 deletions

docs/commands.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ documentation describes these commands.
2121
.. include:: commands/shed_upload.rst
2222
.. include:: commands/syntax.rst
2323
.. include:: commands/test.rst
24+
.. include:: commands/tool_factory.rst
2425
.. include:: commands/tool_init.rst
2526
.. include:: commands/travis_init.rst

docs/commands/tool_factory.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
``tool_factory`` command
3+
===============================
4+
5+
This section is auto-generated from the help text for the planemo command
6+
``tool_factory``. This help message can be generated with ``planemo tool_factory
7+
--help``.
8+
9+
**Usage**::
10+
11+
planemo tool_factory [OPTIONS]
12+
13+
**Help**
14+
15+
(Experimental) Launch Galaxy with the Tool Factory 2 available.
16+
17+
For more information about the Galaxy Tool Factory see the publication
18+
Creating reusable tools from scripts: the Galaxy Tool Factory by Lazarus
19+
et. al. (10.1093/bioinformatics/bts573). Available at
20+
http://www.ncbi.nlm.nih.gov/pubmed/23024011.
21+
22+
**Options**::
23+
24+
25+
--galaxy_root DIRECTORY Root of development galaxy directory to
26+
execute command with.
27+
--install_galaxy Download and configure a disposable copy of
28+
Galaxy from github.
29+
--test_data DIRECTORY test-data directory to for specified
30+
tool(s).
31+
--dependency_resolvers_config_file PATH
32+
Dependency resolver configuration for Galaxy
33+
to target.
34+
--job_config_file PATH Job configuration file for Galaxy to target.
35+
--tool_dependency_dir DIRECTORY
36+
Tool dependency dir for Galaxy to target.
37+
--brew_dependency_resolution Configure Galaxy to use plain brew
38+
dependency resolution.
39+
--help Show this message and exit.
40+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import os
2+
3+
import click
4+
from planemo.cli import pass_context
5+
from planemo import options
6+
from planemo import galaxy_serve
7+
8+
9+
@click.command('tool_factory')
10+
@options.galaxy_root_option()
11+
@options.install_galaxy_option()
12+
@options.test_data_option()
13+
@options.dependency_resolvers_option()
14+
@options.job_config_option()
15+
@options.tool_dependency_dir_option()
16+
@options.brew_dependency_resolution()
17+
@pass_context
18+
def cli(ctx, **kwds):
19+
"""(Experimental) Launch Galaxy with the Tool Factory 2 available.
20+
21+
For more information about the Galaxy Tool Factory see the publication
22+
Creating reusable tools from scripts: the Galaxy Tool Factory by Lazarus
23+
et. al. (10.1093/bioinformatics/bts573). Available at
24+
http://www.ncbi.nlm.nih.gov/pubmed/23024011.
25+
"""
26+
# TODO: de-duplicate option handling with cmd_serve.
27+
mod_dir = os.path.dirname(__file__)
28+
tf_dir = os.path.join(mod_dir, '..', '..', 'tool_factory_2')
29+
galaxy_serve.serve(ctx, os.path.abspath(tf_dir), **kwds)

planemo/galaxy_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def config_join(*args):
191191
if preseeded_database:
192192
env["GALAXY_TEST_DB_TEMPLATE"] = os.path.abspath(database_location)
193193
env["GALAXY_TEST_UPLOAD_ASYNC"] = "false"
194+
env["GALAXY_DEVELOPMENT_ENVIRONMENT"] = "1"
194195
web_config = __sub(WEB_SERVER_CONFIG_TEMPLATE, template_args)
195196
open(config_join("galaxy.ini"), "w").write(web_config)
196197
tool_conf_contents = __sub(TOOL_CONF_TEMPLATE, template_args)

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
'planemo_ext.galaxy.tools.deps.resolvers',
4343
'planemo_ext.galaxy.util',
4444
],
45+
data_files=[('tool_factory_2', ['tool_factory_2/rgToolFactory2.xml',
46+
'tool_factory_2/rgToolFactory2.py',
47+
'tool_factory_2/getlocalrpackages.py'])],
4548
entry_points='''
4649
[console_scripts]
4750
planemo=planemo.cli:planemo

tool_factory_2/LICENSE

Lines changed: 504 additions & 0 deletions
Large diffs are not rendered by default.

tool_factory_2/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
toolfactory_2
2+
=============
3+
4+
This is an upgrade to the tool factory but with added parameters
5+
(optionally editable in the generated tool form - otherwise fixed) and
6+
multiple input files.
7+
8+
Any number of parameters up to the limit of your patience with repeat groups
9+
These are optionally editable by the user - names cannot be changed so
10+
no overwriting $JAVA_HOME_DIR or else permanently fixed and not editable at run time.
11+
12+
Any number of input files can be passed to your script, but of course it
13+
has to deal with them. Both path and metadata name are supplied either in the environment
14+
(bash/sh) or as command line parameters (python,perl,rscript) that need to be parsed and
15+
dealt with in the script.
16+

0 commit comments

Comments
 (0)