Mercurial > repos > dcouvin > resfinder
comparison resfinder/scripts/wdl/resfinder.wdl @ 0:a16d245332d6 draft default tip
Uploaded
author | dcouvin |
---|---|
date | Wed, 08 Dec 2021 01:46:07 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a16d245332d6 |
---|---|
1 workflow Resistance { | |
2 File inputSamplesFile | |
3 Array[Array[File]] inputSamples = read_tsv(inputSamplesFile) | |
4 | |
5 String outputDir | |
6 Float geneCov | |
7 Float geneID | |
8 Float pointCov | |
9 Float pointID | |
10 String python | |
11 String kma | |
12 String blastn | |
13 String resfinder | |
14 String resDB | |
15 String pointDB | |
16 | |
17 scatter (sample in inputSamples) { | |
18 call ResFinder { | |
19 input: inputSample=sample, | |
20 outputRoot=outputDir, | |
21 geneCov=geneCov, | |
22 geneID=geneID, | |
23 pointCov=pointCov, | |
24 pointID=pointID, | |
25 python=python, | |
26 kma=kma, | |
27 blastn=blastn, | |
28 resfinder=resfinder, | |
29 resDB=resDB, | |
30 pointDB=pointDB | |
31 } | |
32 } | |
33 } | |
34 | |
35 task ResFinder { | |
36 | |
37 Array[String] inputSample | |
38 Float geneCov | |
39 Float geneID | |
40 Float pointCov | |
41 Float pointID | |
42 String python | |
43 String kma | |
44 String blastn | |
45 String resfinder | |
46 String resDB | |
47 String pointDB | |
48 | |
49 String inputPath1 = inputSample[0] | |
50 String inputPath2 = inputSample[1] | |
51 String species = inputSample[2] | |
52 String inputType = inputSample[3] | |
53 | |
54 String outputRoot | |
55 String filename = basename(inputPath1) | |
56 String out_dir_name = "${outputRoot}/${filename}.rf_out" | |
57 | |
58 command { | |
59 | |
60 set +u | |
61 module unload mgmapper metabat fastqc | |
62 module unload ncbi-blast perl | |
63 source /home/projects/cge/apps/env/rf4_env/bin/activate | |
64 module load perl | |
65 module load ncbi-blast/2.8.1+ | |
66 | |
67 mkdir ${out_dir_name} | |
68 | |
69 inputArgs="" | |
70 pointArgs="" | |
71 | |
72 if [ "${species}" = "other" ] && [ "${inputType}" = "paired" ] | |
73 then | |
74 inputArgs+="-ifq ${inputPath1} ${inputPath2}" | |
75 elif [ "${inputType}" = "paired" ] | |
76 then | |
77 inputArgs+="-ifq ${inputPath1} ${inputPath2}" | |
78 pointArgs+="--point --db_path_point ${pointDB} --min_cov_point ${pointCov} --threshold_point ${pointID}" | |
79 elif [ "${species}" = "other"] && [ "${inputType}" = "assembly" ] | |
80 then | |
81 inputArgs+="-ifa ${inputPath1}" | |
82 elif [ "${inputType}" = "assembly" ] | |
83 then | |
84 inputArgs+="-ifa ${inputPath1}" | |
85 pointArgs+="--point --db_path_point ${pointDB} --min_cov_point ${pointCov} --threshold_point ${pointID}" | |
86 fi | |
87 | |
88 ${python} ${resfinder} \ | |
89 $inputArgs \ | |
90 --blastPath ${blastn} \ | |
91 --kmaPath ${kma} \ | |
92 --species "${species}" \ | |
93 --db_path_res ${resDB} \ | |
94 --acquired \ | |
95 --acq_overlap 30 \ | |
96 --min_cov ${geneCov} \ | |
97 --threshold ${geneID} \ | |
98 -o ${out_dir_name} \ | |
99 $pointArgs | |
100 } | |
101 output { | |
102 File rf_out = "${out_dir_name}/std_format_under_development.json" | |
103 } | |
104 runtime { | |
105 walltime: "1:00:00" | |
106 cpu: 2 | |
107 memory: "4 GB" | |
108 queue: "cge" | |
109 } | |
110 } |