Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scottx611x/td api fixes #1653

Merged
merged 13 commits into from
Apr 3, 2017
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -83,36 +83,55 @@ def handle(self, **options):
except KeyError:
# `parameters` aren't required for each workflow step
pass

for parameter in parameters:
# Check User-defined parameters in
# annotation data against the available
# parameters of the Workflow step's
# `tool_inputs`
if parameter["name"] not in step["tool_inputs"]:
raise CommandError(
"{} is not a valid parameter for {}".
format(
parameter["name"],
step["tool_id"]
else:
for parameter in parameters:
# Check User-defined parameters in
# annotation data against the available
# parameters of the Workflow step's
# `tool_inputs`
if parameter["name"] not in step["tool_inputs"]:
raise CommandError(
"{} is not a valid parameter for {}".
format(
parameter["name"],
step["tool_id"]
)
)
)
else:
parameter["galaxy_workflow_step"] = int(
step_index
)
workflow["annotation"]["parameters"]\
.append(parameter)
else:
parameter["galaxy_workflow_step"] = int(
step_index
)
workflow["annotation"]["parameters"]\
.append(parameter)
try:
output_files = step_annotation["output_files"]
except KeyError:
# `ouput_files` aren't required for each workflow step
# `output_files` aren't required for each workflow step
pass

for output_file in output_files:
workflow["annotation"]["output_files"].append(
output_file
)
else:
for output_file in output_files:
# Check User-defined output_files in
# annotation data against the available
# output_file of the Workflow step's
# `tool_inputs`
valid_output_names = []
for key in step["input_steps"].iterkeys():
valid_output_names.append(
step["input_steps"][key]["step_output"]
)
if output_file["name"] not in valid_output_names:
raise CommandError(
"`{}` is not a valid output file for {}. "
"Valid ouput_file names are: {}".format(
output_file["name"],
step["tool_id"],
valid_output_names
)
)
else:
workflow["annotation"]["output_files"].append(
output_file
)
try:
validate_tool_annotation(workflow)
except RuntimeError as e:
Expand Down
105 changes: 77 additions & 28 deletions refinery/tool_manager/schemas/FileRelationship.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,83 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"type": "object",
"required": [
"name",
"value_type",
"file_relationship"
],
"properties": {
"name": {
"type": "string"
},
"value_type": {
"type": "string",
"enum": [
"PAIR",
"LIST"
]
},
"input_files": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "InputFile.json#"
"oneOf": [
{
"required": [
"name",
"value_type",
"file_relationship"
],
"properties": {
"name": {
"type": "string"
},
"value_type": {
"type": "string",
"enum": [
"PAIR"
]
},
"input_files": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": {
"$ref": "InputFile.json#"
}
},
"file_relationship": {
"oneOf": [
{
"type": "object",
"$ref": "FileRelationship.json#"
},
{
"type": "object",
"additionalProperties": false,
"properties": {}
}
]
}
}
},
"file_relationship": {
"oneOf": [
{"type": "object", "$ref": "FileRelationship.json#"},
{"type": "object", "additionalProperties": false, "properties": {}}
]
{
"required": [
"name",
"value_type",
"file_relationship"
],
"properties": {
"name": {
"type": "string"
},
"value_type": {
"type": "string",
"enum": [
"LIST"
]
},
"input_files": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "InputFile.json#"
}
},
"file_relationship": {
"oneOf": [
{
"type": "object",
"$ref": "FileRelationship.json#"
},
{
"type": "object",
"additionalProperties": false,
"properties": {}
}
]
}
}
}
}

]
}
3 changes: 2 additions & 1 deletion refinery/tool_manager/schemas/ToolDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"type": "array",
"items": {
"$ref": "OutputFile.json#"
}
},
"minItems": 1
},
"parameters": {
"type": "array",
Expand Down