Skip to content
This repository was archived by the owner on Jun 9, 2020. It is now read-only.

Commit d7e45fb

Browse files
committed
Create EDAM objects
1 parent 17e5e87 commit d7e45fb

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

cwlgen/__init__.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class CommandLineTool(object):
4343
__CLASS__ = 'CommandLineTool'
4444

4545
def __init__(self, tool_id=None, base_command=None, label=None, doc=None,
46-
cwl_version=None, stdin=None, stderr=None, stdout=None):
46+
cwl_version=None, stdin=None, stderr=None, stdout=None, edam=None):
4747
'''
4848
:param tool_id: unique identifier for this tool
4949
:type tool_id: STRING
@@ -80,6 +80,7 @@ def __init__(self, tool_id=None, base_command=None, label=None, doc=None,
8080
self.outputs = [] # List of [CommandOutputParameter] objects
8181
self.baseCommand = base_command
8282
self.arguments = [] # List of [CommandLineBinding] objects
83+
self.edam = None
8384
self.doc = doc
8485
self.stdin = stdin
8586
self.stderr = stderr
@@ -98,6 +99,9 @@ def export(self, outfile=None):
9899
cwl_tool = {k: v for k, v in vars(self).items() if v is not None and\
99100
type(v) is str}
100101
cwl_tool['class'] = self.__CLASS__
102+
# EDAM ?
103+
if self.edam:
104+
cwl_tool['edam'] = self.edam.get_dict()
101105
# Treat doc for multiline writting
102106
if self.doc:
103107
cwl_tool['doc'] = literal(self.doc)
@@ -433,3 +437,18 @@ class Metadata(object):
433437
def __init__(self, **kwargs):
434438
for key, value in kwargs.items():
435439
setattr(self, key, value)
440+
441+
class Edam(object):
442+
"""
443+
Represent edam terms
444+
"""
445+
446+
def __init__(self):
447+
"""
448+
"""
449+
self.name = "edam"
450+
self.topics = []
451+
self.operations = []
452+
453+
def get_dict(self):
454+
return {'topics': self.topics, 'operations': self.operations}

cwlgen/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version_info = (0,2,3)
1+
version_info = (0,2,4)
22
__version__ = '.'.join(str(c) for c in version_info)

0 commit comments

Comments
 (0)