WorkflowConversion / CTDConverter

Series of python scripts to convert CTD files into other formats such as Galaxy, CWL
MIT License
5 stars 8 forks source link

Unable to parse CTD from Seqan 2.4.0 #35

Open mr-c opened 6 years ago

mr-c commented 6 years ago

Even when the missing ctdVersion is added, CTDOpts gets grumpy with empty values like this snippet from flexbar --write-ctd using Seqan 2.4.0

<ITEM name="barcode-tail-length" value="" type="int" description="Region size in tail trim-end modes. Default: barcode length." required="false" advanced="true" />
(ctd-converter) mcrusoe@mrcdev:~$ python ~/src/CTDConverter/convert.py cwl  -i ~/debian/flexbar/flexbar.ctd -o f.c
INFO: Using cwl converter
WARNING: Validation against a schema has not been enabled.
INFO: Parsing /home/mcrusoe/debian/flexbar/flexbar.ctd
Traceback (most recent call last):
  File "/home/mcrusoe/src/CTDConverter/convert.py", line 215, in main
    converter.get_preferred_file_extension())
  File "/home/mcrusoe/src/CTDConverter/common/utils.py", line 118, in parse_input_ctds
    parsed_ctds.append(ParsedCTD(CTDModel(from_file=input_ctd), input_ctd, output_file))
  File "/home/mcrusoe/miniconda2/envs/ctd-converter/lib/python2.7/site-packages/CTDopts/CTDopts.py", line 643, in __init__
    self._load_from_file(from_file)
  File "/home/mcrusoe/miniconda2/envs/ctd-converter/lib/python2.7/site-packages/CTDopts/CTDopts.py", line 688, in _load_from_file
    self.parameters = self._build_param_model(params_container_node, base=None)
  File "/home/mcrusoe/miniconda2/envs/ctd-converter/lib/python2.7/site-packages/CTDopts/CTDopts.py", line 708, in _build_param_model
    self._build_param_model(child, current_group)
  File "/home/mcrusoe/miniconda2/envs/ctd-converter/lib/python2.7/site-packages/CTDopts/CTDopts.py", line 713, in _build_param_model
    base.add(**setup)  # register parameter in model
  File "/home/mcrusoe/miniconda2/envs/ctd-converter/lib/python2.7/site-packages/CTDopts/CTDopts.py", line 564, in add
    self.parameters[name] = Parameter(name, self, **kwargs)
  File "/home/mcrusoe/miniconda2/envs/ctd-converter/lib/python2.7/site-packages/CTDopts/CTDopts.py", line 376, in __init__
    self._validate_numerical_defaults(default)
  File "/home/mcrusoe/miniconda2/envs/ctd-converter/lib/python2.7/site-packages/CTDopts/CTDopts.py", line 456, in _validate_numerical_defaults
    "default": ', '.join(map(str, errors_so_far))})
ModelParsingError: An error occurred while parsing the CTD file: Invalid default value(s) provided for parameter barcode-min-overlap of type <type 'int'>: ''
ERROR: There seems to be a problem with one of your input CTDs.
Traceback (most recent call last):
  File "/home/mcrusoe/src/CTDConverter/convert.py", line 272, in <module>
    sys.exit(main())
  File "/home/mcrusoe/src/CTDConverter/convert.py", line 234, in main
    utils.error("Reason: " + e.msg, 0)
AttributeError: 'ModelParsingError' object has no attribute 'msg'

Tagging in @h-2

chahuistle commented 6 years ago

Could you attach a sample input CTD and a command line that replicates this issue?

mr-c commented 6 years ago

@chahuistle Sure, see https://gist.github.com/mr-c/a37c1856b35693971781f70e68643113#file-flexbar-ctd

python ~/src/CTDConverter/convert.py cwl  -i flexbar.ctd -o flexbar.cwl