Codebase list ctdconverter / 6057ef0
Some small fixes. Lists of input files are handled differently than other lists. Torsten Houwaart 9 years ago
1 changed file(s) with 25 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
2424 __all__ = []
2525 __version__ = 0.11
2626 __date__ = '2014-09-17'
27 __updated__ = '2014-09-17'
27 __updated__ = '2015-01-16'
2828
2929 TYPE_TO_GALAXY_TYPE = {int: 'integer', float: 'float', str: 'text', bool: 'boolean', _InFile: 'data',
3030 _OutFile: 'data', _Choices: 'select'}
3131 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'}
3434
3535 class CLIError(Exception):
3636 '''Generic exception to raise and log different fatal errors.'''
395395
396396 # logic for ITEMLISTs
397397 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"
408413 # logic for other ITEMs
409414 else:
410415 if param.advanced and param.type is not _OutFile:
578583 parent_node = inputs_node
579584
580585 # for lists we need a repeat tag
581 if param.is_list:
586 if param.is_list and param.type is not _InFile:
582587 rep_node = SubElement ( parent_node, "repeat")
583588 create_repeat_attribute_list(rep_node, param)
584589 parent_node = rep_node
633638 param_type = "boolean"
634639
635640 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"
638643 if param.restrictions is not None:
639644 # join all supported_formats for the file... this MUST be a _FileFormat
640645 if type(param.restrictions) is _FileFormat:
644649 #attribute_list["format"] = str(param_format)
645650 param_node.attrib["type"] = "data"
646651 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
647656 else:
648657 param_node.attrib["type"] = param_type
649658