comparison destinations_input_type.py @ 28:378ddb410225 draft

planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 4dc5751176d47d41fa1dec33eb443e335a1a316f
author workflow4metabolomics
date Fri, 26 Jul 2019 10:26:24 -0400
parents b62808a2a008
children
comparison
equal deleted inserted replaced
27:3bd53dcfa438 28:378ddb410225
1 from galaxy.jobs import JobDestination
2 import logging 1 import logging
3 import os 2
4 3
5 ''' 4 '''
6 This file must be placed in lib/galaxy/jobs/rules/ 5 This file must be placed in lib/galaxy/jobs/rules/
7 ''' 6 '''
8 7
8
9 def input_type(job): 9 def input_type(job):
10 ''' 10 '''
11 This function checks the input file format/extension and decide which destination in the job_conf.xml using 11 This function checks the input file format/extension and decide which
12 - If it's a zip file, we will launch the job in multi-thread mode (-pe thread 8) 12 destination in the job_conf.xml using
13 - If it's an individual file (mzxml, mzml, mzdata or netcdf), the job will use for instance (-pe thread 1) 13 - If it's a zip file, we will launch the job in multi-thread mode
14 (-pe thread 8)
15 - If it's an individual file (mzxml, mzml, mzdata or netcdf),
16 the job will use for instance (-pe thread 1)
14 ''' 17 '''
15 log = logging.getLogger(__name__) 18 log = logging.getLogger(__name__)
16 inp_data = dict( [ ( da.name, da.dataset ) for da in job.input_datasets ] ) 19 indata = 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 ] ) 20 indata.update([(da.name, da.dataset) for da in job.input_library_datasets])
18 input_extension = inp_data[ "input" ].extension 21 input_extension = indata["input"].extension
19 if 'input' in inp_data: 22 if 'input' in indata:
20 input_extension = inp_data[ "input" ].extension 23 input_extension = indata["input"].extension
21 log.debug("The input extension is %s" % input_extension) 24 log.debug("The input extension is %s" % input_extension)
22 if input_extension in ["mzxml","mzml","mzdata","netcdf"]: 25 if input_extension in ["mzxml", "mzml", "mzdata", "netcdf"]:
23 return 'thread1-mem_free8' 26 return 'thread1-mem_free8'
24 # zip file 27 # zip file
25 return 'thread8-mem_free16' 28 return 'thread8-mem_free16'