diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 593cff06836..76cc24fb09f 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -444,6 +444,7 @@ class Tool( object, Dictifiable ): raise Exception( "Missing tool 'version' for tool with id '%s' at '%s'" % (self.id, tool_source) ) self.edam_operations = tool_source.parse_edam_operations() + self.edam_topics = tool_source.parse_edam_topics() # Support multi-byte tools self.is_multi_byte = tool_source.parse_is_multi_byte() @@ -1542,6 +1543,7 @@ class Tool( object, Dictifiable ): tool_dict = super( Tool, self ).to_dict() tool_dict["edam_operations"] = self.edam_operations + tool_dict["edam_topics"] = self.edam_topics # Fill in ToolShedRepository info if hasattr(self, 'tool_shed') and self.tool_shed: diff --git a/lib/galaxy/tools/parser/xml.py b/lib/galaxy/tools/parser/xml.py index a8a77ac34db..9e7bd292fc5 100644 --- a/lib/galaxy/tools/parser/xml.py +++ b/lib/galaxy/tools/parser/xml.py @@ -84,6 +84,12 @@ class XmlToolSource(ToolSource): return [] return [ edam_op.text for edam_op in edam_ops.findall("edam_operation") ] + def parse_edam_topics(self): + edam_topics = self.root.find("edam_topics") + if edam_topics is None: + return [] + return [ edam_topic.text for edam_topic in edam_topics.findall("edam_topic") ] + def parse_description(self): return xml_text(self.root, "description") diff --git a/lib/galaxy/tools/parser/yaml.py b/lib/galaxy/tools/parser/yaml.py index 0310ce3057a..785fc59e5c4 100644 --- a/lib/galaxy/tools/parser/yaml.py +++ b/lib/galaxy/tools/parser/yaml.py @@ -36,6 +36,9 @@ class YamlToolSource(ToolSource): def parse_edam_operations(self): return self.root_dict.get("edam_operations", []) + def parse_edam_topics(self): + return self.root_dict.get("edam_topics", []) + def parse_is_multi_byte(self): return self.root_dict.get("is_multi_byte", self.default_is_multi_byte) diff --git a/test/functional/tools/simple_constructs.yml b/test/functional/tools/simple_constructs.yml index 05030d22fdb..cc8be9de356 100644 --- a/test/functional/tools/simple_constructs.yml +++ b/test/functional/tools/simple_constructs.yml @@ -6,6 +6,9 @@ description: Simple constructs edam_operations: - operation_0004 - operation_0336 +edam_topics: + - topic_0003 + - topic_3372 command: > echo "$booltest" >> $out_file1; diff --git a/tools/stats/gsummary.xml b/tools/stats/gsummary.xml index cf31c55529b..6517badea1c 100644 --- a/tools/stats/gsummary.xml +++ b/tools/stats/gsummary.xml @@ -1,5 +1,8 @@ for any numerical column + + topic_2269 + gsummary.py $input $out_file1 "$cond"