hmenager / workflow-is-cwl

This repository contains CWL descriptions of the various tools which will allow you to build workflows for the annotation of transcripts
https://www.elixir-europe.org/
0 stars 0 forks source link

galaxy+cwltool - BUSCO #9

Closed ghost closed 6 years ago

ghost commented 6 years ago
hints:
  - class: gx:interface
    gx:inputs:
      - gx:name: blastSingleCore
        gx:type: boolean
        gx:optional: True
      - gx:name: cpu
        gx:type: integer
        gx:optional: True
      - gx:name: evalue
        gx:type: float
        gx:optional: True
      - gx:name: force
        gx:type: boolean
        gx:optional: True
      - gx:name: help
        gx:type: boolean
        gx:optional: True
      - gx:name: lineage
        gx:type: directory
      - gx:name: long
        gx:type: boolean
        gx:optional: True
      - gx:name: mode
        gx:type: text
      - gx:name: outputName
        gx:type: text
      - gx:name: quiet
        gx:type: boolean
        gx:optional: True
      - gx:name: regionLimit
        gx:type: integer
        gx:optional: True
      - gx:name: restart
        gx:type: boolean
        gx:optional: True
      - gx:name: sequenceFile
        gx:format: txt
        gx:type: data
      - gx:name: species
        gx:type: text
        gx:optional: True
      - gx:name: tarzip
        gx:type: boolean
        gx:optional: True
      - gx:name: tempPath
        gx:type: directory
        gx:optional: True
      - gx:name: version
        gx:type: boolean
        gx:optional: True
ghost commented 6 years ago
Traceback (most recent call last):
  File "lib/galaxy/tools/__init__.py", line 482, in __init__
    self.parse(tool_source, guid=guid, dynamic=dynamic)
  File "lib/galaxy/tools/__init__.py", line 2467, in parse
    super(CwlCommandBindingTool, self).parse(tool_source, **kwds)
  File "lib/galaxy/tools/__init__.py", line 767, in parse
    self.parse_inputs(tool_source)
  File "lib/galaxy/tools/__init__.py", line 990, in parse_inputs
    inputs = self.parse_input_elem(page_source, enctypes)
  File "lib/galaxy/tools/__init__.py", line 1174, in parse_input_elem
    param = self.parse_param_elem(input_source, enctypes, context)
  File "lib/galaxy/tools/__init__.py", line 1187, in parse_param_elem
    param = ToolParameter.build(self, input_source)
  File "lib/galaxy/tools/parameters/basic.py", line 247, in build
    raise ValueError("Tool parameter '%s' uses an unknown type '%s'" % (param_name, param_type))
ValueError: Tool parameter 'lineage' uses an unknown type 'directory'
galaxy.tools.toolbox.base ERROR 2018-07-27 07:13:15,042 [p:5741,w:0,m:0] [MainThread] Error reading tool from path: ../../workflow-is-cwl_herve/tools/BUSCO/BUSCO-v3.cwl
Traceback (most recent call last):
  File "lib/galaxy/tools/toolbox/base.py", line 591, in _load_tool_tag_set
    tool = self.load_tool(concrete_path, use_cached=False)
  File "lib/galaxy/tools/toolbox/base.py", line 775, in load_tool
    tool = self.create_tool(config_file=config_file, repository_id=repository_id, guid=guid, **kwds)
  File "lib/galaxy/tools/__init__.py", line 279, in create_tool
    return self._create_tool_from_source(tool_source, config_file=config_file, **kwds)
  File "lib/galaxy/tools/__init__.py", line 282, in _create_tool_from_source
    return create_tool_from_source(self.app, tool_source, **kwds)
  File "lib/galaxy/tools/__init__.py", line 231, in create_tool_from_source
    tool = ToolClass(config_file, tool_source, app, **kwds)
  File "lib/galaxy/tools/__init__.py", line 487, in __init__
    raise e
ValueError: Tool parameter 'lineage' uses an unknown type 'directory'
ghost commented 6 years ago

In "BUSCO-v3.cwl" file, the argument "lineage" has the type "Directory". I.e. this argument expects a path to an existing directory (containing files and subdirectories).

E.g.

inputs:
  - id: lineage
    type: Directory

This mecanism doesn't work directly with the galaxy history system.

To make this work with the galaxy history system, one design may be:

  1. the "lineage" directory is zipped in one file (before creating the job in galaxy)
  2. the "lineage" textbox is set with the zip file (when creating the job in galaxy)
  3. the zip file is extracted in a temporary directory (at runtime)
  4. the "lineage" argument is set with the path to the temporary directory (at runtime)

An example directory for the "lineage" argument is available in the workflow-is-cwl/tools/BUSCO/test-input directory:

$ ls workflow-is-cwl/tools/BUSCO/test-input/example/
ancestral  ancestral_variants  dataset.cfg  hmms  lengths_cutoff  prfl  scores_cutoff

Resources

https://galaxyproject.org/data-libraries/

https://github.com/common-workflow-language/galaxy/commit/929d04443fd86f6282a2348f8b057685b4a0b50a
ghost commented 6 years ago

Directory support has been added using a temporary hack to cast tar file into CWL Directory type.

8fcf88706d64ef19abbbf42aab2d9fdf58026c94

bbfa1b05a6c0bfcff860fb30b2408ebe1f8696d2

Galaxy repo 22cc09f47ad5aed788fb10d6622102fcfe87b1b7