comparison destinations_input_type.py @ 12:15646e937936 draft

planemo upload for repository https://github.com/workflow4metabolomics/xcms commit a6f5f18b3d6130f7d7fbb9f2df856838c6217797
author lecorguille
date Fri, 07 Apr 2017 07:35:01 -0400
parents
children c934dd5c49a9
comparison
equal deleted inserted replaced
11:91311aa08cdc 12:15646e937936
1 from galaxy.jobs import JobDestination
2 import logging
3 import os
4
5 '''
6 This file must be placed in lib/galaxy/jobs/rules/
7 '''
8
9 def input_type(job):
10 '''
11 This function checks the input file format/extension and decide which destination in the job_conf.xml using
12 - If it's a zip file, we will launch the job in multi-thread mode (-pe thread 8)
13 - If it's an individual file (mzxml, mzml, mzdata or netcdf), the job will use for instance (-pe thread 1)
14 '''
15 log = logging.getLogger(__name__)
16 inp_data = dict( [ ( da.name, da.dataset ) for da in job.input_datasets ] )
17 inp_data.update( [ ( da.name, da.dataset ) for da in job.input_library_datasets ] )
18 input_extension = inp_data[ "input" ].extension
19 log.debug("The input extension is %s" % input_extension)
20 if input_extension in ["mzxml","mzml","mzdata","netcdf"]:
21 return 'thread1-men_free10'
22 else: # zip file
23 return 'thread4-men_free10'