Mercurial > repos > earlhaminst > lotus2
comparison lotus2.xml @ 11:8f732780e0f3 draft
"planemo upload for repository https://github.com/TGAC/earlham-galaxytools/tree/master/tools/lotus2 commit 544a60608fa765463c1d805595a56b8a49a689ea"
author | earlhaminst |
---|---|
date | Tue, 08 Jun 2021 19:53:13 +0000 |
parents | 6d55d9464719 |
children | 3f3ee496acec |
comparison
equal
deleted
inserted
replaced
10:6d55d9464719 | 11:8f732780e0f3 |
---|---|
39 </requirements> | 39 </requirements> |
40 <version_command>lotus2 --version</version_command> | 40 <version_command>lotus2 --version</version_command> |
41 <command detect_errors="exit_code"><![CDATA[ | 41 <command detect_errors="exit_code"><![CDATA[ |
42 #import os.path | 42 #import os.path |
43 #import re | 43 #import re |
44 #def symlink_basename($f, $f_ext): | 44 #def symlink_basename($f): |
45 #set $fn = re.sub('[^\w\-_.]', '_', $f.element_identifier) | 45 #set $fn = re.sub('[^\w\-_.]', '_', $f.name) |
46 #if $fn.endswith('.gz'): | 46 ${fn}#slurp |
47 #set $fn = $fn[:-3] | |
48 #end if | |
49 #if $f_ext.startswith('fastq'): | |
50 #set $exts_to_drop = ('.fq', '.fastq', '.fastqsanger') | |
51 #elif $f_ext.startswith('fasta'): | |
52 #set $exts_to_drop = ('.fa', '.fasta', '.fna') | |
53 #else | |
54 #set $exts_to_drop = [] | |
55 #end if | |
56 #for $ext in $exts_to_drop: | |
57 #if $fn.endswith($ext): | |
58 #set $fn = $fn[:-len($ext)] | |
59 #break | |
60 #end if | |
61 #end for | |
62 $fn#slurp | |
63 #end def | 47 #end def |
64 | 48 |
65 mkdir input | 49 mkdir input |
66 && | 50 && |
67 #if $inputs.paired_or_single == 'single': | 51 #if $inputs.paired_or_single == 'single': |
68 #for $f in $inputs.input: | 52 #for $f in $inputs.input: |
69 #set $ext = $f.ext.replace('sanger', '') | 53 ln -s '$f' 'input/${symlink_basename($f)}' && |
70 ln -s '$f' 'input/${symlink_basename($f, $ext)}.${ext}' && | |
71 #end for | |
72 #elif $inputs.paired_or_single == 'paired': | |
73 #for i, f in enumerate($inputs.left_input): | |
74 #set ext = $f.ext.replace('sanger', '') | |
75 ln -s '$f' 'input/input${i}.1.${ext}' && | |
76 #end for | |
77 #for $i, $f in enumerate($inputs.right_input): | |
78 #set $ext = $f.ext.replace('sanger', '') | |
79 ln -s '$f' 'input/input${i}.2.${ext}' && | |
80 #end for | 54 #end for |
81 #else: | 55 #else: |
82 #for $f in $inputs.pair_input: | 56 #for $f in $inputs.pair_input: |
83 #set $ext = $f.forward.ext.replace('sanger', '') | 57 ln -s '$f.forward' 'input/${symlink_basename($f.forward.dataset)}' && |
84 ln -s '$f.forward' 'input/${symlink_basename($f, $ext)}.1.${ext}' && | 58 ln -s '$f.reverse' 'input/${symlink_basename($f.reverse.dataset)}' && |
85 #set $ext = $f.reverse.ext.replace('sanger', '') | |
86 ln -s '$f.reverse' 'input/${symlink_basename($f, $ext)}.2.${ext}' && | |
87 #end for | 59 #end for |
88 #end if | 60 #end if |
89 | 61 |
90 #if $tax_args.aligner_cond.taxAligner not in ('0', '3') and $tax_args.aligner_cond.refDB_cond.refDB == 'history': | 62 #if $tax_args.aligner_cond.taxAligner not in ('0', '3') and $tax_args.aligner_cond.refDB_cond.refDB == 'history': |
91 #set $ext = $tax_args.aligner_cond.refDB_cond.ref_fasta.ext | 63 #set $ext = $tax_args.aligner_cond.refDB_cond.ref_fasta.ext |
92 #set $ref_fasta_symlink = $symlink_basename($tax_args.aligner_cond.refDB_cond.ref_fasta, $ext) + '.' + $ext | 64 #set $ref_fasta_symlink = $symlink_basename($tax_args.aligner_cond.refDB_cond.ref_fasta, $ext) + '.' + $ext |
93 ln -s '$tax_args.aligner_cond.refDB_cond.ref_fasta' '$ref_fasta_symlink' && | 65 ln -s '$tax_args.aligner_cond.refDB_cond.ref_fasta' '$ref_fasta_symlink' && |
94 #end if | 66 #end if |
95 | 67 |
96 #if not $map: | 68 #if not $map: |
97 lotus2 -create_map mapping.txt -i input/ && | 69 cat '$generated_mapping' && |
98 cat mapping.txt && | 70 #set map = $generated_mapping |
99 #set map = 'mapping.txt' | |
100 #end if | 71 #end if |
101 | 72 |
102 lotus2 | 73 lotus2 |
103 -i input/ | 74 -i input/ |
104 -o output | 75 -o output |
190 | 161 |
191 zip -8 -r -v output.zip output/ | 162 zip -8 -r -v output.zip output/ |
192 && | 163 && |
193 exit \$EXIT_VALUE | 164 exit \$EXIT_VALUE |
194 ]]></command> | 165 ]]></command> |
195 | 166 <configfiles> |
167 <configfile name="generated_mapping"><![CDATA[#slurp | |
168 #import re | |
169 #def symlink_basename($f): | |
170 #set $fn = re.sub('[^\w\-_.]', '_', $f.name) | |
171 ${fn}#slurp | |
172 #end def | |
173 #SampleID fastqFile SequencingRun | |
174 #if $inputs.paired_or_single == 'single': | |
175 #for $i, $f in enumerate($inputs.input): | |
176 SMPL${i} ${symlink_basename($f)} a | |
177 #end for | |
178 #else: | |
179 #for $i, $f in enumerate($inputs.pair_input): | |
180 SMPL${i} ${symlink_basename($f.forward.dataset)},${symlink_basename($f.reverse.dataset)} a | |
181 #end for | |
182 #end if | |
183 ]]></configfile> | |
184 </configfiles> | |
196 <inputs> | 185 <inputs> |
197 <conditional name="inputs"> | 186 <conditional name="inputs"> |
198 <param name="paired_or_single" type="select" label="Single- or Paired-end data?"> | 187 <param name="paired_or_single" type="select" label="Single- or Paired-end data?"> |
199 <option value="single" selected="true">Single-end</option> | 188 <option value="single" selected="true">Single-end</option> |
200 <option value="paired_collection">Paired-end list</option> | 189 <option value="paired_collection">Paired-end list</option> |