Some small fixes. Lists of input files are handled differently than other lists.
Torsten Houwaart
9 years ago
24 | 24 | __all__ = [] |
25 | 25 | __version__ = 0.11 |
26 | 26 | __date__ = '2014-09-17' |
27 | __updated__ = '2014-09-17' | |
27 | __updated__ = '2015-01-16' | |
28 | 28 | |
29 | 29 | TYPE_TO_GALAXY_TYPE = {int: 'integer', float: 'float', str: 'text', bool: 'boolean', _InFile: 'data', |
30 | 30 | _OutFile: 'data', _Choices: 'select'} |
31 | 31 | COMMAND_REPLACE_PARAMS = {'threads': '\${GALAXY_SLOTS:-24} ', "processOption":"inmemory"} |
32 | SUPPORTED_FILE_TYPES = ["svg","jpg","png","fasta","HTML","mzXML","mzML","mgf","featureXML","XML","consensusXML","idXML","pepXML", "txt", "csv", "traML", "TraML", "mzq", "trafoXML", "tsv", "msp", "qcML"] | |
33 | FILE_TYPES_TO_GALAXY_DATA_TYPES = {'csv': 'tabular', 'XML':'xml', 'HTML':'html', 'traML':'traml', 'TraML':'traml', 'trafoXML':'trafoxml', 'tsv':'tabular', 'qcML':'qcml' } | |
32 | SUPPORTED_FILE_TYPES = ["svg","jpg","png","fasta","FASTA","HTML","mzXML","mzML","mgf","featureXML","xml","XML","consensusXML","idXML","pepXML", "txt", "csv", "traML", "TraML", "mzq", "trafoXML", "tsv", "msp", "qcML","obo","edta","ini","xsd"] | |
33 | FILE_TYPES_TO_GALAXY_DATA_TYPES = {'csv': 'tabular','edta': 'tabular', 'XML':'xml', 'HTML':'html', 'traML':'traml', 'TraML':'traml', 'trafoXML':'trafoxml', 'tsv':'tabular', 'qcML':'qcml', 'consensusXML':'consensusxml', 'mzML':'mzml', 'mzXML':'mzxml', 'featureXML':'featurexml', 'idXML':'idxml', 'pepXML':'pepxml', 'qcML':'qcml', 'FASTA':'fasta', 'ini':'txt', 'xsd':'txt'} | |
34 | 34 | |
35 | 35 | class CLIError(Exception): |
36 | 36 | '''Generic exception to raise and log different fatal errors.''' |
395 | 395 | |
396 | 396 | # logic for ITEMLISTs |
397 | 397 | if param.is_list: |
398 | command += "\n#if $" + repeat_galaxy_parameter_name + ":\n" | |
399 | command += "-" + str(param_name) + "\n" | |
400 | command += " #for token in $" + repeat_galaxy_parameter_name + ":\n" | |
401 | command += " #if \" \" in str(token):\n" | |
402 | command += " \"$token." + galaxy_parameter_name + "\"\n" | |
403 | command += " #else\n" | |
404 | command += " $token." + galaxy_parameter_name + "\n" | |
405 | command += " #end if\n" | |
406 | command += " #end for\n" | |
407 | command += "#end if\n" | |
398 | if param.type is _InFile: | |
399 | command += " #for token in $" + galaxy_parameter_name + ":\n" | |
400 | command += " $token\n" | |
401 | command += " #end for\n" | |
402 | else: | |
403 | command += "\n#if $" + repeat_galaxy_parameter_name + ":\n" | |
404 | command += "-" + str(param_name) + "\n" | |
405 | command += " #for token in $" + repeat_galaxy_parameter_name + ":\n" | |
406 | command += " #if \" \" in str(token):\n" | |
407 | command += " \"$token." + galaxy_parameter_name + "\"\n" | |
408 | command += " #else\n" | |
409 | command += " $token." + galaxy_parameter_name + "\n" | |
410 | command += " #end if\n" | |
411 | command += " #end for\n" | |
412 | command += "#end if\n" | |
408 | 413 | # logic for other ITEMs |
409 | 414 | else: |
410 | 415 | if param.advanced and param.type is not _OutFile: |
578 | 583 | parent_node = inputs_node |
579 | 584 | |
580 | 585 | # for lists we need a repeat tag |
581 | if param.is_list: | |
586 | if param.is_list and param.type is not _InFile: | |
582 | 587 | rep_node = SubElement ( parent_node, "repeat") |
583 | 588 | create_repeat_attribute_list(rep_node, param) |
584 | 589 | parent_node = rep_node |
633 | 638 | param_type = "boolean" |
634 | 639 | |
635 | 640 | if param.type is _InFile: |
636 | # assume it's just data unless restrictions are provided | |
637 | param_format = "data" | |
641 | # assume it's just text unless restrictions are provided | |
642 | param_format = "txt" | |
638 | 643 | if param.restrictions is not None: |
639 | 644 | # join all supported_formats for the file... this MUST be a _FileFormat |
640 | 645 | if type(param.restrictions) is _FileFormat: |
644 | 649 | #attribute_list["format"] = str(param_format) |
645 | 650 | param_node.attrib["type"] = "data" |
646 | 651 | param_node.attrib["format"] = param_format |
652 | # in the case of multiple input set multiple flag | |
653 | if param.is_list: | |
654 | param_node.attrib["multiple"]="true" | |
655 | ||
647 | 656 | else: |
648 | 657 | param_node.attrib["type"] = param_type |
649 | 658 |