Skip to content

Commit

Permalink
Outline tracking alternative scatter types.
Browse files Browse the repository at this point in the history
Keeping this WIP for now since I guess it isn't needed for the GA4GH challenge.
  • Loading branch information
jmchilton committed Jul 30, 2017
1 parent 85a61ff commit 4856289
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/galaxy/managers/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@ def __module_from_dict( self, trans, steps, steps_by_external_id, step_dict, **k
step_input = model.WorkflowStepInput()
step_input.name = input_dict["name"]
step_input.merge_type = input_dict.get("merge_type", step_input.default_merge_type)
step_input.scatter_type = input_dict.get("scatter_type", step_input.default_scatter_type)
step.inputs.append(step_input)

# Create the model class for the step
Expand Down
2 changes: 2 additions & 0 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3953,12 +3953,14 @@ def log_str(self):
class WorkflowStepInput( object ):

default_merge_type = "merge_flattened"
default_scatter_type = "dotproduct"

def __init__( self ):
self.id = None
self.name = None
self.default_value = None
self.merge_type = self.default_merge_type
self.scatter_type = self.default_scatter_type


class WorkflowStepConnection( object ):
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/model/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@
Column( "workflow_step_id", Integer, ForeignKey( "workflow_step.id" ), index=True ),
Column( "name", Unicode( 255 ) ),
Column( "merge_type", TEXT ),
Column( "scatter_type", TEXT ),
Column( "default_value", JSONType ) )


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Column( "workflow_step_id", Integer, ForeignKey( "workflow_step.id" ), index=True ),
Column( "name", Unicode( 255 ) ),
Column( "merge_type", TEXT ),
Column( "scatter_type", TEXT ),
Column( "default_value", JSONType ),
)

Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/tools/cwl/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ def to_dict(self):
}
if "linkMerge" in self._cwl_input:
as_dict["merge_type"] = self._cwl_input["linkMerge"]
as_dict["scatter_method"] = self.step_proxy._step.tool["scatterMethod"]
return as_dict


Expand Down
6 changes: 6 additions & 0 deletions lib/galaxy/workflow/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,12 @@ def _find_collections_to_match( self, tool, progress, step ):
collections_to_match = matching.CollectionsToMatch()

def callback( input, prefixed_name, **kwargs ):
step_input = step.inputs_by_name[ prefixed_name ]
scatter_type = "dotproduct"
if step_input:
scatter_type = step_input.scatter_type
assert scatter_type == "dotproduct"

is_data_param = isinstance( input, DataToolParameter )
if is_data_param and not input.multiple:
data = progress.replacement_for_tool_input( step, input, prefixed_name )
Expand Down

0 comments on commit 4856289

Please sign in to comment.