Commit Graph
55 Commits
Author SHA1 Message Date
John Chilton c91a2eb339 Multi data parameter improvements.
Allow multiple collections to be fed to a multi data parameter in one reduction step. Fixes #750 and will really simplify certain classes of tools.

Rebased original with fixes for rerun of such reductions.

Manually tested workflow execution and everything seems fine. The workflow editor already thought this was possible, so that is another bug corrected by this enhancement.

To run the associated API test, execute the following command:

./run_tests.sh -with_framework_test_tools -api test/api/test_tools.py:ToolsTestCase.test_reduce_multiple_lists_on_multi_data

Conflicts:
	static/maps/mvc/dataset/dataset-choice.js.map
	static/maps/mvc/form/form-select-content.js.map
	static/scripts/mvc/form/form-select-content.js
2015-12-04 20:41:21 +00:00
Martin Cech b6f3783acd remove test_map_over_two_collections_legacy as it is obsolete 2015-10-15 11:29:06 -04:00
guerler 8cb894b34a Fix data library test case
Fix library data test case
2015-10-12 17:07:14 -04:00
Dannon Baker a2a4ce43ec Merge pull request #743 from jmchilton/cross_product_collection_mapping
Extend tool API to allow cross product mapping over collections.
2015-10-06 13:40:49 -04:00
John Chilton 5ff102507b Add regression test for issue in #798. 2015-09-25 14:29:05 +01:00
John Chilton 684be5f6a5 Functional test to verify RData is not decompressed in upload process. 2015-09-23 13:56:14 +01:00
John Chilton 87d5063a0d Implement min/max for multiple data input parameters. 2015-09-21 15:51:58 +01:00
John Chilton 45d5e29c1d Extend test_map_over_two_collections timeout.
May be the cause of intermittent test failure on jenkins (https://jenkins.galaxyproject.org/job/G-API/lastCompletedBuild/default/testReport/api.test_tools/ToolsTestCase/test_map_over_two_collections/).
2015-09-19 11:55:12 +01:00
John Chilton 84b5726ca9 Extend tool API to allow cross product mapping over collections.
By default if single data parameters are mapped over by collections, the collections are matched up (e.g. for two collections the items are paired off and two collections of dimension (N) will result in running N jobs and producing an (N) dimensional output for each define output). In the parameter meta value wrapper (where batch mode can be set with the ``batch`` flag), the linked flag is now respected for collection operations. If ``linked`` is ``False``, then the cross product of the inputs will be used to map over the tool. In the above simplest case, this would cause an NxN (``list:list``) collection to be created for each tool output.

This operation was previously available for individual datasets, but when supplied a collection it would not create an implicit collection pulling together all the relevant datasets with the correct structure - it would just run the jobs and leave the datasets uncollected. Now a collection with the correct structure and identifiers is created.

Limitations:
-----------------

This does not enable tool form support but the API for collections matches that for doing cross product operations over sets of individual datasets, so once support is added to the tool form for that collection support should be trivial.

Testing:
-----------------

The following test case has been extended to now ensure that an implicit collection is created and that it has the right dimensionality/structure and contents.

    ./run_tests.sh -with_framework_test_tools -api test/api/test_tools.py:ToolsTestCase.test_map_over_two_collections_unlinked
2015-09-18 09:47:44 +01:00
John Chilton 308a8e3737 Merge remote-tracking branch 'galaxyproject-careful/release_15.05' into dev
Conflicts:
	config/plugins/interactive_environments/ipython/config/ipython.ini.sample
2015-05-15 13:41:29 -04:00
John Chilton 4ad4688fde Fix label's on output collections.
Thanks to @kellrott for reporting the issue.

https://trello.com/c/Qc2A4rsw
2015-05-14 16:33:39 -04:00
guerler 5876e5f80c Revise library data parameter tests 2015-04-20 14:21:42 -04:00
John Chilton b1d3552be4 Add a library_data input test case and small fix. 2015-04-17 14:23:38 -04:00
John Chilton 4a56aeb7b0 test_tools.py enhancements... 2015-04-16 14:28:56 -04:00
John Chilton c983f029cc Merge pull request #8 from jmchilton/argument_name
Add argument to tool parameters.
2015-04-09 15:03:05 -05:00
John Chilton 7c319a1bcd More functional tests of output actions.
- Add example tool demonstrating/testing specifing format via conditional output actions.
 - Add API test testing mapping collections over tools without output action formatting.
 - Add API test testing more complex actions using the Cut1 tool.
2015-04-06 09:08:01 -04:00
John Chilton ce6b45613d Add argument to tool parameters.
- Expose via the API to help command-line construction.
 - Default the name of a parameter to be this (minus dashes) if name is not otherwise found.
2015-03-05 11:35:07 -05:00
John Chilton f8bfe89c42 Clarify failing test test_tools.py. 2015-03-02 22:39:58 -05:00
John Chilton 2f15eb0d78 Expose improved sample tracking to tools for implicit map/reduce ops.
Tools may now use $input.element_identifier during tool evalution for input 'data' parameters with the following semantics:

 - If the input was specified as a single dataset by the user - this just fallbacks to providing the $input.name.
 - If the input was mapped over a collection (to produce many jobs) or if the input is a 'multiple="true"' input that was provided a collection - the $input.element_identifier will be the element identifier for the corresponding collection item (generally much more useful the dataset name - since if preserved throughout workflows).

'data_collection' parameters already can access this kind of information - but it is something of a best practice to use simple 'data' parameters since they are compatible with more traditional un-collected datasets.

This commit really needs more comments - but Philip Mabon has been patiently waiting for this functionality for a long time.
2015-02-02 16:29:42 -05:00
John Chilton 4939c45e3d Test cases for select validation handling.
Normal selects seem to be prevented from execution with invalid parameter values, but not columns. Values are escaped properly so shell exploitation isn't the problem - but as a usability thing Galaxy should prevent execution and provide a warning message.
2015-01-27 12:14:56 -05:00
John Chilton 2cb7c8d73e More configurable format and metadata handling for output collections.
Imporvements to testing code.
2015-01-15 09:30:00 -05:00
John Chilton 4c5c8a47db Allow tools to output collections with a dynamic number of datasets.
Models:

Track whether dataset collections have been populated yet.

Dataset collections are still effectively immutable once populated - but dynamic output collections require them to be sort of like `final` fields in Java (analogy courtesy of JJ) - allowing them to be declared before they are initialized or populated. This is tracked by the `populated_state` field.

Tools:

Output collections can now describe `discover_datasets` elements just like datasets - except in this case instead of dynamically populating new datasets in the history - they will comprise the collection. `designation` has been reused to serve as the element_identifier for the collection element corresponding to the dataset.

See Pull Request 356 for more information on the discover_datasets tag https://bitbucket.org/galaxy/galaxy-central/pull-request/356/enhancements-for-runtime-discovered.

Workflows:

Update workflow execution and recovery for dynamic output collections.

Galaxy workflow data flow before collections

* - * - * - * - * - *

Galaxy worfklow data flow after collections (iteration 1)

* - * - * \
           * - * - *
* - * - * /         \
                     * - * - *
* - * - * \         /
           * - * - *
* - * - * /

Galaxy worfklow data flow after this commit

              / * - * \
         * - *         * - *
        /     \ * - * /     \
       /                     \
      /                       \
     /        / * - * \        \
* - * -- * - *         * - * -- * - *
     \        \ * - * /        /
      \                       /
       \                     /
        \     / * - * \     /
         * - *         * - *
              \ * - * /
2015-01-15 09:30:00 -05:00
John Chilton 44f7317fa5 Allow tools to output collections with static or determinable structure.
By "static" I mean tools such as a FASTQ de-interlacer that would produce a "paired" collection with two datasets everytime. By "determinable" I mean tools that perform N->N operations within the same job - such as a tool that needs to normalize a bunch of datasets all at once and not in separate jobs. (For N->N collection operations that should or can be done in N separate jobs tool authors should just write tools that operate over a dataset and produce a dataset and let the end-user 'map over' that operation.)

There are still large classes of operations where the structure of the output collection cannot be pre-determined - such as splitting files (e.g. bam files by read group) - that are not implemented in this commit.

Model:

The models have been updated to do a more thorough job of tracking collection outputs. Jobs just producing HistoryDatasetCollectionAssociations works fine for simple jobs producing collections - but you don't want to map a list over a tool that produces a pair and produce a bunch of pairs HDCAs and a list:pair HDCA- you just want a bunch of pieces and the one list:pair at that the top.

Workflow:

Workflows containing such operations can be executed - but the workflow editor has not been updated to handle this complexity (and it will require a significant overhaul) so such tools are not available in the workflow editor.

Tool Testing:

This commit also introduces a new tool XML syntax for describing tests on output collections. See files test/functional/tools/collection_creates_list.xml and test/functional/tools/collection_creates_pair.xml for examples.

Tests:

Includes two tools to test this - one that uses explicit pair output names and one that iterates over the structure of input list to produce an output list.

Includes several new tools API tests that test the tools described above via the API and implicit mapping over such tools. Includes two new workflow API tests - one that verifies a simple workflow with output collections works and one that verifies mapping over workflow steps in collections works.
2015-01-15 09:30:00 -05:00
John Chilton 7e45ca2a72 Allow multiple tools with the same id in ToolBox.
How to use:

 1.) Place multiple tools with different IDs in your tool conf.
 2.) ... ummm ... no step 2 - just use the tools.

Implementation:

The Tool Shed allows tool lineages by assigning each tool version a GUID and tracking versions in a database. This
implementation works by simply allowing the ToolBox to contain multiple tools with the same ID and orders them by the version specified by the tool author.

To track enable this a second tool lineage has been introduced that just uses tool versions instead of a database (non-toolshed installed tools are not longer placed into the Tool Shed install database). The ToolBox has been updated to allow multiple versions per tool id (defaulting to the 'latest' version for all operations which do not specify a version). Both jobs and workflow steps would track tool versions but did not use that version when fetching tools from the Toolbox - these components have been updated to try to use the tool version.

Unit tests working through most of the ToolBox and tool panel have been added, as well as functional tests exercising the tools API and to ensure workflows now at least attempt to respect tool versions (still kind of silently switches versions in some cases). Manual tests against the new tool form seem to demonstrate the tool switching and tool re-running work with only minor changes to the tools API and the job handler.
2014-12-31 18:21:10 -05:00
John Chilton 2a23da50bd Test case for passing null to optional tool input. 2014-12-04 12:28:23 -05:00
John Chilton 12f8776908 Tool test - verify that if 'batch' meta-parameter is False - matching is not attempted. 2014-11-24 13:02:18 -05:00
John Chilton bf4be0e936 Tool API test for mixing batch and non-batch input datasets. 2014-11-24 12:56:05 -05:00
John Chilton 40497f4940 Tool test case demonstrating wrapping multiple data params in new meta-parameter wrapper.
./run_tests.sh -with_framework_test_tools -api test/api/test_tools.py:ToolsTestCase.test_multidata_param

It was what was requested, but I am not sure I love this behavior - seems like for consistency that should maybe be a list of lists? I can see the other side of the argument though.
2014-09-26 09:29:53 -04:00
John Chilton adb5d76da5 Tool API test submitting multiple select checkboxes as a list of values.
Run with:

./run_tests.sh -with_framework_test_tools -api test/api/test_tools.py:ToolsTestCase.test_multi_select_as_list
2014-09-24 20:08:03 -04:00
John Chilton 80993e03b1 PEP-8 fix. 2014-09-16 11:57:48 -04:00
John Chilton b1a8d0dd16 Add tools test for data_collection input parameter specification. 2014-09-16 11:57:48 -04:00
John Chilton a1b72d5bf0 Redo API for subcollection mapping steps in tools.
Like the reductions - was previously constrained by sequeezing these values into simple strings - now the tool form will target the API I think this expanded version is a little more straight-forward (though verbose). Adds consistency with rest of the tool form API changes.
2014-09-16 11:57:48 -04:00
John Chilton 864ab4b70c Simplified dataset collection reductions via API.
Old tool form needed to encode every value as a string so I had done "__collection_reduction__|<hdca_id>" to distinguish that value from an "<hda_id>" - since hdca and hdas can have the same encoded ids. The new tool form API is going to use the API which allows for richer object representations - so {"src": "hda", "id": "<hda_id>"} versus {"src": "hdca", "id": "<hdca_id>"} should be enough to distinguish between passing an HDA and an HDCA to a multiple input data parameter.
2014-09-16 11:57:48 -04:00
John Chilton 2ff5b08411 Allow mixing batch multi-running of collections and individual datasets.
I wouldn't really recommend doing this per se - but probably don't want to prevent it either.
2014-09-16 11:57:48 -04:00
John Chilton 3c4e100b13 Overhaul multi-run and collection multi-run tool API jobs.
Adding consistency allowing each parameter to be wrapped in a object describing the meta-properties of the submitting value - this was requested by Sam to make the new tool form easier to manage, it makes multi-running properties work for non-data parameters, and allows linked/unlinked specification of parameters.
2014-09-16 11:57:48 -04:00
John Chilton f4ea8b0f56 Allow sending singleton lists of datasets to single dataset parameters via API tool submission.
Request from Sam.
2014-09-16 11:57:48 -04:00
John Chilton 21f4d49a9e Synchronize validation of workflows between web and API controllers.
Reduces code duplication and does more correct checking of workflow step replacement parameters. More parameter checking functional tests.
2014-09-10 11:51:10 -04:00
John Chilton 6b31f7ba5d Improved API collection workflow run testing.
Remove some duplication between workflow and tool testing code.
2014-07-29 11:55:46 -04:00
John Chilton 336aa4c31a Fix API tests for 879c485...
Which made tool multirun link/match instead cross producting (will someday figure a terminology for this :)).
2014-07-25 11:51:11 -05:00
John Chilton 8e6bcf72c7 Merged in jmchilton/galaxy-central-fork-1 (pull request #387)
Recursive Tool Parameter Dictification
2014-05-15 13:43:43 -05:00
John Chilton d7b4b36756 Change paired collections terminology from left/right to forward/reverse.
If you have paired datasets in your database they will no longer work - send me an e-mail and I can give you an SQL update statement.
2014-05-15 13:01:36 -05:00
John Chilton 3109f70c3a Allow more typical expanded HDCA value with src when mapping over collection via API.
Flat ID still used by GUI - but when coming through API this is probably the better choice.
2014-05-11 13:56:49 -05:00
John Chilton 9256b438de Improvements to to_dict for Conditional tool parameters.
Expand out nested test_param parameter and cases.
2014-05-08 17:55:00 -05:00
John Chilton b36fdcb022 Improvements to to_dict for Repeat tool parameters.
Expand out nested parameters and more information about the repeat itself.
2014-05-08 17:55:00 -05:00
John Chilton 2f8970a6a7 Bugfix: Rework collection matching logic so it properly matches combined collection/subcollection mapping.
With functional test to verify it works end-to-end with tool execution and unit tests to verify different kinds of collection combinations.
2014-05-07 15:39:03 -05:00
John Chilton 6a4c14e6d2 Simpler, more powerful subcollection mapping.
Collections can be mapped over 'data' parameters and sufficiently nested collections can be mapped over 'data_collection' parameters (for instance a list of 5 pairs can be supplied to a tool taking in a pair and 5 jobs will be executed). I (perhaps poorly) term these concepts collection mapping and subcollection mapping.

Prior to this changeset - the API for doing collection 'mapping' and 'subcollection mapping' was somewhat more divergent and the tool execution code explicitly forbid doing both kinds of mappings in the same tool execution even if the effective collections could be matched (e.g. it could not map a 'data' parameter over a list of 5 datasets and a pair parameter a list of 5 pairs in the same execution).

This changeset should remedy this - as long as the effective collection mappings can match up such jobs should be possible. The workflow editor (and I think runner) already thought this was possible, so this changeset reduces the tool-workflow impedance mismatch - an existing problem exacerbated by recent dataset collections introduction.

This all needs much more testing - test workflows execute this way, functional test of a tool execution that combines collection mapping and subcollection mapping, etc....
2014-05-07 11:29:51 -05:00
John Chilton 1359c4a780 Improve API test skipping when required tools are absent.
Replace ad-hoc tools API test method for skipping tests with a more general purpose decorator. Use new decorator to specify required tools for workflow tests.
2014-05-07 00:24:00 -05:00
John Chilton e0ee48c7bd Fix bug in test/api/test_tools.py. 2014-05-06 13:52:49 -05:00
John Chilton 3cdf45e847 Move dataset colleciton test populator. 2014-05-06 13:52:49 -05:00
John Chilton 704446ea24 Dataset collections - tools API returns implicitly created collections.
Use improvements to write better functional tests, ensure element identifiers preserved.
2014-05-06 08:54:31 -05:00