comparison destinations_input_type.py @ 33:f5d51091cf84 draft default tip

planemo upload for repository https://github.com/workflow4metabolomics/tools-metabolomics/ commit 2cb157bd9a8701a3d6874e084032cbd050b8953e
author workflow4metabolomics
date Mon, 11 Sep 2023 09:22:36 +0000
parents b02d1992a43a
children
comparison
equal deleted inserted replaced
32:b02d1992a43a 33:f5d51091cf84
1 import logging
2
3
4 '''
5 This file must be placed in lib/galaxy/jobs/rules/
6 '''
7
8
9 def input_type(job):
10 '''
11 This function checks the input file format/extension and decide which
12 destination in the job_conf.xml using
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)
17 '''
18 log = logging.getLogger(__name__)
19 indata = dict([(da.name, da.dataset) for da in job.input_datasets])
20 indata.update([(da.name, da.dataset) for da in job.input_library_datasets])
21 input_extension = indata["input"].extension
22 if 'input' in indata:
23 input_extension = indata["input"].extension
24 log.debug("The input extension is %s" % input_extension)
25 if input_extension in ["mzxml", "mzml", "mzdata", "netcdf"]:
26 return 'thread1-mem_free8'
27 # zip file
28 return 'thread8-mem_free16'