Exemplo n.º 1
0
    def construct_tool_object(toolpath_object, *args, **kwargs):
        """Fix missing locations."""
        protocol = "file://"

        def addLocation(d):
            if "location" not in d and "path" in d:
                d["location"] = protocol + d["path"]

        visit_class(toolpath_object, ("File", "Directory"), addLocation)
        return workflow.default_make_tool(toolpath_object, *args, **kwargs)
Exemplo n.º 2
0
    def construct_tool_object(toolpath_object, *args, **kwargs):
        """Fix missing locations."""
        protocol = 'file://'

        def addLocation(d):
            if 'location' not in d and 'path' in d:
                d['location'] = protocol + d['path']

        visit_class(toolpath_object, ('File', 'Directory'), addLocation)
        return workflow.default_make_tool(toolpath_object, *args, **kwargs)
Exemplo n.º 3
0
def calrissian_make_tool(spec, loadingContext):
    """
    Construct a Process object from a CWL document loaded into spec
    :param spec:
    :param loadingContext:
    :return: For CommandLineTools, return our specialized subclass that can run on k8s.
    For other types of documents, return the CWL default_make_tool
    """
    if "class" in spec and spec["class"] == "CommandLineTool":
        return CalrissianCommandLineTool(spec, loadingContext)
    else:
        return default_make_tool(spec, loadingContext)
Exemplo n.º 4
0
def make_custom_tool(spec, loading_context, exec_profile_class, workflow_metadata):
    """
        custom tool maker: 
            only use ExecProfileCommandlineTool if spec if the spec is a "CommandLineTool",
            otherwise use the cwltool's standard tool maker
    """
    if "class" in spec and spec["class"] == "CommandLineTool":
        return ExecProfileCommandlineTool(
            spec, 
            loading_context, 
            exec_profile_class, 
            workflow_metadata
        )
    return default_make_tool(spec, loading_context)
Exemplo n.º 5
0
def make_tes_tool(spec, loading_context, url):
    if "class" in spec and spec["class"] == "CommandLineTool":
        return TESCommandLineTool(spec, loading_context, url)
    else:
        return default_make_tool(spec, loading_context)
Exemplo n.º 6
0
def make_tes_tool(spec, loading_context, url, remote_storage_url, token):
    """cwl-tes specific factory for CWL Process generation."""
    if "class" in spec and spec["class"] == "CommandLineTool":
        return TESCommandLineTool(spec, loading_context, url,
                                  remote_storage_url, token)
    return default_make_tool(spec, loading_context)
Exemplo n.º 7
0
 def make_tool(self, spec, loadingContext):
     """Make tool."""
     if "class" in spec and spec["class"] == "CommandLineTool":
         return self.make_exec_tool(spec, loadingContext)
     else:
         return default_make_tool(spec, loadingContext)