mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Add EDAM topics to tools and expose in API
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@ description: Simple constructs
|
||||
edam_operations:
|
||||
- operation_0004
|
||||
- operation_0336
|
||||
edam_topics:
|
||||
- topic_0003
|
||||
- topic_3372
|
||||
command:
|
||||
>
|
||||
echo "$booltest" >> $out_file1;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<tool id="Summary_Statistics1" name="Summary Statistics" version="1.1.0">
|
||||
<description>for any numerical column</description>
|
||||
<edam_topics>
|
||||
<edam_topic>topic_2269</edam_topic>
|
||||
</edam_topics>
|
||||
<command interpreter="python">gsummary.py $input $out_file1 "$cond"</command>
|
||||
<inputs>
|
||||
<param format="tabular" name="input" type="data" label="Summary statistics on" help="Dataset missing? See TIP below"/>
|
||||
|
||||
Reference in New Issue
Block a user