diff --git a/client/src/components/Tool/ToolFooter.vue b/client/src/components/Tool/ToolFooter.vue
index 6766a8ffa0f..d7775129712 100644
--- a/client/src/components/Tool/ToolFooter.vue
+++ b/client/src/components/Tool/ToolFooter.vue
@@ -40,7 +40,7 @@
diff --git a/lib/galaxy/tool_util/linters/general.py b/lib/galaxy/tool_util/linters/general.py
index eb3a98fd3b8..cd726fa9d37 100644
--- a/lib/galaxy/tool_util/linters/general.py
+++ b/lib/galaxy/tool_util/linters/general.py
@@ -237,7 +237,7 @@ class BioToolsValid(Linter):
_, tool_node = _tool_xml_and_root(tool_source)
xrefs = tool_source.parse_xrefs()
for xref in xrefs:
- if xref["reftype"] != "bio.tools":
+ if xref["type"] != "bio.tools":
continue
metadata_source = ApiBiotoolsMetadataSource()
if not metadata_source.get_biotools_metadata(xref["value"]):
diff --git a/lib/galaxy/tool_util/ontologies/ontology_data.py b/lib/galaxy/tool_util/ontologies/ontology_data.py
index 65343a803c3..89ee0e72999 100644
--- a/lib/galaxy/tool_util/ontologies/ontology_data.py
+++ b/lib/galaxy/tool_util/ontologies/ontology_data.py
@@ -53,7 +53,7 @@ class OntologyData(NamedTuple):
def biotools_reference(xrefs):
for xref in xrefs:
- if xref["reftype"] == "bio.tools":
+ if xref["type"] == "bio.tools":
return xref["value"]
return None
@@ -69,11 +69,11 @@ def expand_ontology_data(
tool_source: ToolSource, all_ids: List[str], biotools_metadata_source: Optional[BiotoolsMetadataSource]
) -> OntologyData:
xrefs = tool_source.parse_xrefs()
- has_biotools_reference = any(x["reftype"] == "bio.tools" for x in xrefs)
+ has_biotools_reference = any(x["type"] == "bio.tools" for x in xrefs)
if not has_biotools_reference:
for legacy_biotools_ref in legacy_biotools_external_reference(all_ids):
if legacy_biotools_ref is not None:
- xrefs.append({"value": legacy_biotools_ref, "reftype": "bio.tools"})
+ xrefs.append({"value": legacy_biotools_ref, "type": "bio.tools"})
edam_operations = tool_source.parse_edam_operations()
edam_topics = tool_source.parse_edam_topics()
diff --git a/lib/galaxy/tool_util/parser/cwl.py b/lib/galaxy/tool_util/parser/cwl.py
index 77066125dee..00ce4738eab 100644
--- a/lib/galaxy/tool_util/parser/cwl.py
+++ b/lib/galaxy/tool_util/parser/cwl.py
@@ -159,7 +159,7 @@ class CwlToolSource(ToolSource):
output.format = "expression.json"
output.change_format = []
output.format_source = None
- output.metadata_source = ""
+ output.metadata_source = None
output.parent = None
output.label = None
output.count = None
diff --git a/lib/galaxy/tool_util/parser/output_collection_def.py b/lib/galaxy/tool_util/parser/output_collection_def.py
index b588957d651..f5c279dd372 100644
--- a/lib/galaxy/tool_util/parser/output_collection_def.py
+++ b/lib/galaxy/tool_util/parser/output_collection_def.py
@@ -58,7 +58,7 @@ def dataset_collector_descriptions_from_elem(elem, legacy=True):
def dataset_collector_descriptions_from_output_dict(as_dict):
- discover_datasets_dicts = as_dict.get("discover_datasets", [])
+ discover_datasets_dicts = as_dict.get("discover_datasets") or []
if is_dict(discover_datasets_dicts):
discover_datasets_dicts = [discover_datasets_dicts]
dataset_collector_descriptions = dataset_collector_descriptions_from_list(discover_datasets_dicts)
diff --git a/lib/galaxy/tool_util/parser/output_objects.py b/lib/galaxy/tool_util/parser/output_objects.py
index 86a627d15de..090b38ac63b 100644
--- a/lib/galaxy/tool_util/parser/output_objects.py
+++ b/lib/galaxy/tool_util/parser/output_objects.py
@@ -175,24 +175,25 @@ class ToolOutput(ToolOutputBase):
hidden=self.hidden,
format=self.format,
format_source=self.format_source,
- metadata_source=self.metadata_source or None, # model is decorated as Optional
+ metadata_source=self.metadata_source,
discover_datasets=[d.to_model() for d in self.dataset_collector_descriptions],
+ from_work_dir=self.from_work_dir,
)
@staticmethod
def from_dict(name: str, output_dict: Dict[str, Any], app: Optional[ToolOutputActionApp] = None) -> "ToolOutput":
output = ToolOutput(name)
- output.format = output_dict.get("format", "data")
+ output.format = output_dict.get("format") or "data"
output.change_format = []
- output.format_source = output_dict.get("format_source", None)
- output.default_identifier_source = output_dict.get("default_identifier_source", None)
- output.metadata_source = output_dict.get("metadata_source", "")
- output.parent = output_dict.get("parent", None)
- output.label = output_dict.get("label", None)
+ output.format_source = output_dict.get("format_source")
+ output.default_identifier_source = output_dict.get("default_identifier_source")
+ output.metadata_source = output_dict.get("metadata_source")
+ output.parent = output_dict.get("parent")
+ output.label = output_dict.get("label")
output.count = output_dict.get("count", 1)
output.filters = []
- output.from_work_dir = output_dict.get("from_work_dir", None)
- output.hidden = output_dict.get("hidden", False)
+ output.from_work_dir = output_dict.get("from_work_dir")
+ output.hidden = output_dict.get("hidden") or False
# TODO: implement tool output action group fixes
if app is not None:
output.actions = ToolOutputActionGroup(app, None)
diff --git a/lib/galaxy/tool_util/parser/xml.py b/lib/galaxy/tool_util/parser/xml.py
index bbff153fd55..1b942b3070a 100644
--- a/lib/galaxy/tool_util/parser/xml.py
+++ b/lib/galaxy/tool_util/parser/xml.py
@@ -224,7 +224,7 @@ class XmlToolSource(ToolSource):
if xrefs is None:
return []
return [
- XrefDict(value=xref.text.strip(), reftype=str(xref.attrib["type"]))
+ XrefDict(value=xref.text.strip(), type=str(xref.attrib["type"]))
for xref in xrefs.findall("xref")
if xref.get("type") and xref.text
]
@@ -489,7 +489,7 @@ class XmlToolSource(ToolSource):
inherit_format = string_as_bool(collection_elem.get("inherit_format", None))
inherit_metadata = string_as_bool(collection_elem.get("inherit_metadata", None))
default_format_source = collection_elem.get("format_source", None)
- default_metadata_source = collection_elem.get("metadata_source", "")
+ default_metadata_source = collection_elem.get("metadata_source", None)
filters = collection_elem.findall("filter")
dataset_collector_descriptions = None
@@ -560,7 +560,7 @@ class XmlToolSource(ToolSource):
app: Optional[ToolOutputActionApp] = None,
default_format="data",
default_format_source=None,
- default_metadata_source="",
+ default_metadata_source=None,
expression_type=None,
):
from_expression = data_elem.get("from")
diff --git a/lib/galaxy/tool_util/parser/yaml.py b/lib/galaxy/tool_util/parser/yaml.py
index 3ae32c643f1..b2c734f7979 100644
--- a/lib/galaxy/tool_util/parser/yaml.py
+++ b/lib/galaxy/tool_util/parser/yaml.py
@@ -86,7 +86,7 @@ class YamlToolSource(ToolSource):
def parse_xrefs(self) -> List[XrefDict]:
xrefs = self.root_dict.get("xrefs", [])
- return [XrefDict(value=xref["value"], reftype=xref["type"]) for xref in xrefs if xref["type"]]
+ return [XrefDict(value=xref["value"], type=xref["type"]) for xref in xrefs if xref["type"]]
def parse_sanitize(self):
return self.root_dict.get("sanitize", True)
@@ -192,7 +192,7 @@ class YamlToolSource(ToolSource):
inherit_format = output_dict.get("inherit_format", None)
inherit_metadata = output_dict.get("inherit_metadata", None)
default_format_source = output_dict.get("format_source", None)
- default_metadata_source = output_dict.get("metadata_source", "")
+ default_metadata_source = output_dict.get("metadata_source", None)
filters = []
dataset_collector_descriptions = dataset_collector_descriptions_from_output_dict(output_dict)
diff --git a/lib/galaxy/tool_util_models/tool_outputs.py b/lib/galaxy/tool_util_models/tool_outputs.py
index 322f338aa06..0c686fdfaa3 100644
--- a/lib/galaxy/tool_util_models/tool_outputs.py
+++ b/lib/galaxy/tool_util_models/tool_outputs.py
@@ -33,6 +33,7 @@ class ToolOutputDataset(ToolOutputBaseModel):
format_source: Optional[str]
metadata_source: Optional[str]
discover_datasets: Optional[List["DatasetCollectionDescriptionT"]]
+ from_work_dir: Optional[str] = None
class ToolOutputCollectionStructure(BaseModel):
diff --git a/lib/galaxy/tool_util_models/tool_source.py b/lib/galaxy/tool_util_models/tool_source.py
index 487870895bd..d7bb207b58d 100644
--- a/lib/galaxy/tool_util_models/tool_source.py
+++ b/lib/galaxy/tool_util_models/tool_source.py
@@ -15,7 +15,7 @@ from typing_extensions import (
class XrefDict(TypedDict):
value: str
- reftype: str
+ type: str
class Citation(BaseModel):
diff --git a/lib/galaxy_test/api/test_tools.py b/lib/galaxy_test/api/test_tools.py
index bb7a2cb1330..59f34dd9b79 100644
--- a/lib/galaxy_test/api/test_tools.py
+++ b/lib/galaxy_test/api/test_tools.py
@@ -257,7 +257,7 @@ class TestToolsApi(ApiTestCase, TestsTools):
assert "xrefs" in get_json
assert len(get_json["xrefs"]) == 1
xref = get_json["xrefs"][0]
- assert xref["reftype"] == "bio.tools"
+ assert xref["type"] == "bio.tools"
assert xref["value"] == "bwa"
@skip_without_tool("test_data_source")
diff --git a/lib/tool_shed/webapp/frontend/src/components/pages/ToolVersionPage.vue b/lib/tool_shed/webapp/frontend/src/components/pages/ToolVersionPage.vue
index 1adaa1b5c52..7ebe291bc1b 100644
--- a/lib/tool_shed/webapp/frontend/src/components/pages/ToolVersionPage.vue
+++ b/lib/tool_shed/webapp/frontend/src/components/pages/ToolVersionPage.vue
@@ -156,11 +156,11 @@ const linkedFromOlderRevision = computed(() => {
- REFERENCE {{ xref.reftype }}
-
+ REFERENCE {{ xref.type }}
+
-
+
diff --git a/lib/tool_shed/webapp/frontend/src/schema/schema.ts b/lib/tool_shed/webapp/frontend/src/schema/schema.ts
index d78c4048d87..52b5aaaec81 100644
--- a/lib/tool_shed/webapp/frontend/src/schema/schema.ts
+++ b/lib/tool_shed/webapp/frontend/src/schema/schema.ts
@@ -2727,6 +2727,8 @@ export interface components {
format: string
/** Format Source */
format_source: string | null
+ /** From Work Dir */
+ from_work_dir?: string | null
/** Hidden */
hidden: boolean
/** Label */
@@ -3006,8 +3008,8 @@ export interface components {
}
/** XrefDict */
XrefDict: {
- /** Reftype */
- reftype: string
+ /** Type */
+ type: string
/** Value */
value: string
}
diff --git a/test/unit/tool_util/test_ontologies.py b/test/unit/tool_util/test_ontologies.py
index 5c1faca4771..15873910a77 100644
--- a/test/unit/tool_util/test_ontologies.py
+++ b/test/unit/tool_util/test_ontologies.py
@@ -87,7 +87,7 @@ def test_parse_edam_mapping_operations_legacy():
def test_parse_biotools_default_mapping():
test_source = get_test_tool_source(source_file_name="testtool.yml", source_contents=TOOL_YAML_NO_EXPLICIT_XREFS)
ontology_data = expand_ontology_data(test_source, ["cheetah_problem_unbound_var_input"], None)
- assert ontology_data.xrefs[0]["reftype"] == "bio.tools"
+ assert ontology_data.xrefs[0]["type"] == "bio.tools"
assert ontology_data.xrefs[0]["value"] == "bwa"
test_source = get_test_tool_source(source_file_name="testtool.yml", source_contents=TOOL_YAML_NO_EXPLICIT_XREFS)
diff --git a/test/unit/tool_util/test_parsing.py b/test/unit/tool_util/test_parsing.py
index 2c57377db14..8698be752fe 100644
--- a/test/unit/tool_util/test_parsing.py
+++ b/test/unit/tool_util/test_parsing.py
@@ -416,7 +416,7 @@ class TestXmlLoader(BaseLoaderTestCase):
def test_xrefs(self):
xrefs = self._tool_source.parse_xrefs()
- assert xrefs == [{"value": "bwa", "reftype": "bio.tools"}]
+ assert xrefs == [{"value": "bwa", "type": "bio.tools"}]
def test_exit_code(self):
tool_source = self._get_tool_source(
@@ -622,7 +622,7 @@ class TestYamlLoader(BaseLoaderTestCase):
def test_xrefs(self):
xrefs = self._tool_source.parse_xrefs()
- assert xrefs == [{"value": "bwa", "reftype": "bio.tools"}]
+ assert xrefs == [{"value": "bwa", "type": "bio.tools"}]
def test_sanitize(self):
assert self._tool_source.parse_sanitize() is True