Mercurial > repos > richard-burhans > segalign
comparison segalign.xml @ 14:f9e91add973c draft
planemo upload for repository https://github.com/richard-burhans/galaxytools/tree/main/tools/segalign commit eb6ee047d39760f2596b6e343e2dc3898fafc5cd
author | richard-burhans |
---|---|
date | Mon, 29 Jul 2024 20:53:43 +0000 |
parents | e6fde4082c76 |
children | 99ee8d6f6815 |
comparison
equal
deleted
inserted
replaced
13:ae2cd39594eb | 14:f9e91add973c |
---|---|
6 <import>scoring_options.xml</import> | 6 <import>scoring_options.xml</import> |
7 <import>seeding_options.xml</import> | 7 <import>seeding_options.xml</import> |
8 <import>ungapped_extension_options.xml</import> | 8 <import>ungapped_extension_options.xml</import> |
9 <import>gapped_extension_options.xml</import> | 9 <import>gapped_extension_options.xml</import> |
10 <import>output_options.xml</import> | 10 <import>output_options.xml</import> |
11 <import>segalign_output_options.xml</import> | |
12 <import>system_options.xml</import> | 11 <import>system_options.xml</import> |
13 </macros> | 12 </macros> |
14 <expand macro="edam_ontology"/> | 13 <expand macro="edam_ontology"/> |
15 <expand macro="requirements"/> | 14 <expand macro="requirements"/> |
16 <required_files> | 15 <required_files> |
18 <include path="lastz-cmd.ini"/> | 17 <include path="lastz-cmd.ini"/> |
19 <include path="package_output.py"/> | 18 <include path="package_output.py"/> |
20 <include path="runner.py"/> | 19 <include path="runner.py"/> |
21 </required_files> | 20 </required_files> |
22 <command detect_errors="exit_code"><![CDATA[ | 21 <command detect_errors="exit_code"><![CDATA[ |
23 ## | 22 ## Convert input to 2bit for lastz ------------------------------------- |
24 ## https://www.gnu.org/software/coreutils/manual/html_node/nproc-invocation.html | |
25 ## | |
26 ## If the OMP_NUM_THREADS or OMP_THREAD_LIMIT environment variables | |
27 ## are set, then they will determine the minimum and maximum returned | |
28 ## value respectively. | |
29 ## | |
30 ## This is how you tame nproc(1) | |
31 ## | |
32 OMP_THREAD_LIMIT=\${GALAXY_SLOTS:-2} | |
33 | 23 |
34 ## Mode ---------------------------------------------------------------- | 24 mkdir -p "\$(pwd)/work" && |
25 faToTwoBit <(gzip -cdfq '$target') "\$(pwd)/work/ref.2bit" && | |
26 faToTwoBit <(gzip -cdfq '$query') "\$(pwd)/work/query.2bit" && | |
35 | 27 |
36 #if str($mode.mode_selector) == "segalign" | 28 ## explicitly calling python to bypass a pulsar bug |
37 #if str($mode.gapped_extension_options.nogapped) == "false" | 29 ## https://github.com/galaxyproject/pulsar/issues/341 |
38 mkdir -p "\$(pwd)/work" && | 30 python '$__tool_directory__/runner.py' |
39 faToTwoBit <(gzip -cdfq '$mode.target') "\$(pwd)/work/ref.2bit" && | 31 --output-type tarball |
40 faToTwoBit <(gzip -cdfq '$mode.query') "\$(pwd)/work/query.2bit" && | 32 --output-file '$segalign_output' |
41 #end if | 33 --diagonal-partition |
42 #if str($mode.diagonal_partition_options.diagonal_partition) == "true" | 34 --num-cpu \${GALAXY_SLOTS:-2} |
43 #set $segalign_mode = "segalign_diagonal_partition" | 35 --tool_directory '$__tool_directory__' |
44 ## explicitly calling python to bypass a pulsar bug | 36 '$target' |
45 ## https://github.com/galaxyproject/pulsar/issues/341 | 37 '$query' |
46 python '$__tool_directory__/runner.py' | |
47 --output-type tarball | |
48 --output-file '$segalign_diagonal_partition_output' | |
49 --diagonal-partition | |
50 --num-cpu \${GALAXY_SLOTS:-2} | |
51 --tool_directory '$__tool_directory__' | |
52 #else | |
53 #set $segalign_mode = "segalign" | |
54 python '$__tool_directory__/runner.py' | |
55 --output-type output | |
56 --output-file '$segalign_output' | |
57 --num-cpu \${GALAXY_SLOTS:-2} | |
58 --tool_directory '$__tool_directory__' | |
59 #end if | |
60 '$mode.target' | |
61 '$mode.query' | |
62 #else if str($mode.mode_selector) == "segalign_repeat_masker" | |
63 #set $segalign_mode = "segalign_repeat_masker" | |
64 run_segalign_repeat_masker | |
65 '$mode.seq_file' | |
66 --num_cpu \${GALAXY_SLOTS:-2} | |
67 #end if | |
68 | 38 |
69 ## Sequence Options ---------------------------------------------------- | 39 ## Sequence Options ---------------------------------------------------- |
70 | 40 |
71 --strand '$mode.sequence_options.strand_selector' | 41 --strand '$sequence_options.strand_selector' |
72 #if $segalign_mode == "segalign_repeat_masker" | |
73 --neighbor_proportion '$mode.sequence_options.neighbor_proportion' | |
74 #end if | |
75 | 42 |
76 ## Scoring Options ----------------------------------------------------- | 43 ## Scoring Options ----------------------------------------------------- |
77 | 44 |
78 #set $scoring_pathname = str($mode.scoring_options.scoring) | 45 #set $scoring_pathname = str($scoring_options.scoring) |
79 #if $scoring_pathname != "None": | 46 #if $scoring_pathname != "None": |
80 --scoring '$scoring_pathname' | 47 --scoring '$scoring_pathname' |
81 #end if | 48 #end if |
82 #if str($mode.scoring_options.ambiguous_selector) != "x" | 49 #if str($scoring_options.ambiguous_selector) != "x" |
83 #if str($mode.scoring_options.set_ambiguous_params_selector) == "true" | 50 #if str($scoring_options.set_ambiguous_params_selector) == "true" |
84 #set $argument_value = ','.join($mode.scoring_options.ambiguous_selector, $mode.scoring_options.ambiguous_reward, $mode.scoring_options.ambiguous_penalty) | 51 #set $argument_value = ','.join($scoring_options.ambiguous_selector, $scoring_options.ambiguous_reward, $scoring_options.ambiguous_penalty) |
85 --ambiguous '$argument_value' | 52 --ambiguous '$argument_value' |
86 #else | 53 #else |
87 --ambiguous '$ambiguous_selector' | 54 --ambiguous '$ambiguous_selector' |
88 #end if | 55 #end if |
89 #end if | 56 #end if |
90 | 57 |
91 ## Seeding Options ----------------------------------------------------- | 58 ## Seeding Options ----------------------------------------------------- |
92 | 59 |
93 #if str($mode.seeding_options.seed.seed_selector) == "custom" | 60 #if str($seeding_options.seed.seed_selector) == "custom" |
94 --seed '$mode.seeding_options.seed.custom_seed' | 61 --seed '$seeding_options.seed.custom_seed' |
95 #else | 62 #else |
96 --seed '$mode.seeding_options.seed.seed_selector' | 63 --seed '$seeding_options.seed.seed_selector' |
97 #end if | 64 #end if |
98 --step '$mode.seeding_options.step' | 65 --step '$seeding_options.step' |
99 #if str($mode.seeding_options.notransition) == "true" | 66 #if str($seeding_options.notransition) == "true" |
100 --notransition | 67 --notransition |
101 #end if | 68 #end if |
102 | 69 |
103 ## Ungapped Extension Options ------------------------------------------ | 70 ## Ungapped Extension Options ------------------------------------------ |
104 | 71 |
105 --xdrop '$mode.ungapped_extension_options.xdrop' | 72 --xdrop '$ungapped_extension_options.xdrop' |
106 --hspthresh '$mode.ungapped_extension_options.hspthresh' | 73 --hspthresh '$ungapped_extension_options.hspthresh' |
107 #if str($mode.ungapped_extension_options.noentropy) == "true" | 74 #if str($ungapped_extension_options.noentropy) == "true" |
108 --noentropy | 75 --noentropy |
109 #end if | 76 #end if |
110 | 77 |
111 ## Gapped Extension Options -------------------------------------------- | 78 ## Gapped Extension Options -------------------------------------------- |
112 | 79 |
113 #if $segalign_mode != "segalign_repeat_masker" | 80 --nogapped |
114 #if str($mode.gapped_extension_options.nogapped) == "true" | 81 --ydrop '$gapped_extension_options.ydrop' |
115 --nogapped | 82 #if str($gapped_extension_options.gappedthresh) != "" |
116 #end if | 83 --gappedthresh '$gapped_extension_options.gappedthresh' |
117 --ydrop '$mode.gapped_extension_options.ydrop' | 84 #end if |
118 #if str($mode.gapped_extension_options.gappedthresh) != "" | 85 #if str($gapped_extension_options.notrivial) == "true" |
119 --gappedthresh '$mode.gapped_extension_options.gappedthresh' | 86 --notrivial |
120 #end if | |
121 #if str($mode.gapped_extension_options.notrivial) == "true" | |
122 --notrivial | |
123 #end if | |
124 #end if | 87 #end if |
125 | 88 |
126 ## Output Options ----------------------------------------------------- | 89 ## Output Options ----------------------------------------------------- |
127 | 90 |
128 #if $segalign_mode != "segalign_repeat_masker" | 91 #if str($output_options.format.format_selector) == "bam" |
129 #if str($mode.output_options.format.format_selector) == "bam" | 92 --format '$output_options.format.bam_options' |
130 --format '$mode.output_options.format.bam_options' | 93 #else if str($output_options.format.format_selector) == "general_def" |
131 #else if str($mode.output_options.format.format_selector) == "general_def" | 94 --format general- |
132 --format general- | 95 #else if str($output_options.format.format_selector) == "maf" |
133 #else if str($mode.output_options.format.format_selector) == "general_full" | 96 --format '$output_options.format.maf_type' |
134 --format 'general-:${mode.output_options.format.fields}' | 97 #else if str($output_options.format.format_selector) == "blastn" |
135 #else if str($mode.output_options.format.format_selector) == "maf" | 98 --format=BLASTN- |
136 --format '$mode.output_options.format.maf_type' | 99 #else if str($output_options.format.format_selector) == "general_full" |
137 #else if str($mode.output_options.format.format_selector) == "blastn" | 100 --format 'general-:${output_options.format.fields}' |
138 --format=BLASTN- | 101 #else if str($output_options.format.format_selector) == "differences" |
139 #else if str($mode.output_options.format.format_selector) == "differences" | 102 --format=differences |
140 --format=differences | 103 #end if |
141 #end if | |
142 ## todo :: rplot, bam | 104 ## todo :: rplot, bam |
143 ## --action:target=multiple | 105 ## --action:target=multiple |
144 ## $output_format.rplot | 106 ## $output_format.rplot |
145 ## .if str( $output_format.out.format ) == "bam": | 107 ## #if str( $output_format.out.format ) == "bam": |
146 ## | samtools sort -@\${GALAXY_SLOTS:-2} -T "\${TMPDIR:-.}" -O bam -o '${output}' | 108 ## | samtools sort -@\${GALAXY_SLOTS:-2} -T "\${TMPDIR:-.}" -O bam -o '${output}' |
147 ## .else: | 109 ## #else: |
148 ## > '${output}' | 110 ## > '${output}' |
149 ## .end if | 111 ## #end if |
150 ## .if $output_format.rplot: | 112 ## #if $output_format.rplot: |
151 ## && | 113 ## && |
152 ## Rscript $r_plot > /dev/null 2>&1 | 114 ## Rscript $r_plot > /dev/null 2>&1 |
153 ## .end if | 115 ## #end if |
154 #else if $segalign_mode == "segalign_repeat_masker" | |
155 --M '$mode.output_options.M' | |
156 --output '$segalign_repeat_masker_output' | |
157 #end if | |
158 #if str($mode.output_options.markend) == "true" | |
159 --markend | |
160 #end if | |
161 | 116 |
162 ## System Options ----------------------------------------------------- | 117 ## System Options ----------------------------------------------------- |
163 | 118 |
164 --wga_chunk_size '$mode.system_options.wga_chunk_size' | 119 --wga_chunk_size '$system_options.wga_chunk_size' |
165 --lastz_interval_size '$mode.system_options.lastz_interval_size' | 120 --lastz_interval_size '$system_options.lastz_interval_size' |
166 --seq_block_size '$mode.system_options.seq_block_size' | 121 --seq_block_size '$system_options.seq_block_size' |
167 --num_gpu '$mode.system_options.num_gpu' | 122 --num_gpu '$system_options.num_gpu' |
168 #if str($mode.system_options.debug) == "true" | 123 #if str($system_options.debug) == "true" |
169 --debug | 124 --debug |
170 #end if | 125 #end if |
171 | 126 |
172 ## ------------------------------------------------------------------- | 127 ## Package Output ---------------------------------------------------- |
173 | 128 |
174 #if $segalign_mode == "segalign_diagonal_partition" | 129 && python '$__tool_directory__/package_output.py' |
175 && | |
176 python '$__tool_directory__/package_output.py' | |
177 --tool_directory '$__tool_directory__' | |
178 #end if | |
179 | 130 |
180 ]]></command> | 131 ]]></command> |
181 <inputs> | 132 <inputs> |
182 <conditional name="mode"> | 133 <param name="target" type="data" format="fasta,fasta.gz" label="Target sequence file in FASTA format"/> |
183 <param name="mode_selector" type="select" label="Choose the mode"> | 134 <param name="query" type="data" format="fasta,fasta.gz" label="Query sequence file in FASTA format"/> |
184 <option value="segalign" selected="true">SegAlign</option> | 135 <expand macro="sequence_options"/> |
185 <option value="segalign_repeat_masker">SegAlign repeat masker</option> | 136 <expand macro="scoring_options"/> |
186 </param> | 137 <expand macro="seeding_options"/> |
187 <when value="segalign"> | 138 <expand macro="ungapped_extension_options"/> |
188 <param name="target" type="data" format="fasta,fasta.gz" label="Target sequence file in FASTA format"/> | 139 <expand macro="gapped_extension_options"/> |
189 <param name="query" type="data" format="fasta,fasta.gz" label="Query sequence file in FASTA format"/> | 140 <expand macro="output_options"/> |
190 <expand macro="sequence_options"/> | 141 <expand macro="system_options"/> |
191 <expand macro="scoring_options"/> | |
192 <expand macro="seeding_options"/> | |
193 <expand macro="ungapped_extension_options"/> | |
194 <expand macro="gapped_extension_options"/> | |
195 <expand macro="output_options"> | |
196 <expand macro="segalign_output_options"/> | |
197 </expand> | |
198 <expand macro="system_options"/> | |
199 <section name="diagonal_partition_options" expanded="false" title="Diagonal Partition Options"> | |
200 <param argument="--diagonal_partition" type="boolean" value="false" label="Enable diagonal partition optimization"/> | |
201 </section> | |
202 </when> | |
203 <when value="segalign_repeat_masker"> | |
204 <param name="seq_file" type="data" format="fasta,fasta.gz" label="Sequence file in FASTA format"/> | |
205 <expand macro="sequence_options"> | |
206 <param argument="--neighbor_proportion" type="float" value="0.2" label="Proportion of neighbouring intervals to align the query interval to"/> | |
207 </expand> | |
208 <expand macro="scoring_options"/> | |
209 <expand macro="seeding_options"/> | |
210 <expand macro="ungapped_extension_options"/> | |
211 <expand macro="output_options"> | |
212 <param argument="--M" type="integer" value="1" max="255" label="report any position that is covered by at least this many alignments; the maximum allowed depth is 255"/> | |
213 </expand> | |
214 <expand macro="system_options"/> | |
215 </when> | |
216 </conditional> | |
217 </inputs> | 142 </inputs> |
218 <outputs> | 143 <outputs> |
219 <data name="segalign_output" format="tabular" label="SegAlign on ${on_string}"> | 144 <data name="segalign_output" format="tgz" from_work_dir="data_package.tgz" label="SegAlign on ${on_string}"/> |
220 <change_format> | |
221 <when input="mode.output_options.format.format_selector" value="bam" format="bam"/> | |
222 <when input="mode.output_options.format.format_selector" value="maf" format="maf"/> | |
223 <when input="mode.output_options.format.format_selector" value="differences" format="interval"/> | |
224 </change_format> | |
225 <filter>mode['mode_selector'] == 'segalign' and mode['diagonal_partition_options']['diagonal_partition'] is False</filter> | |
226 </data> | |
227 <data name="segalign_diagonal_partition_output" format="tgz" from_work_dir="data_package.tgz" label="SegAlign Diagonal Partition on ${on_string}"> | |
228 <filter>mode['mode_selector'] == 'segalign' and mode['diagonal_partition_options']['diagonal_partition'] is True</filter> | |
229 </data> | |
230 <data name="segalign_repeat_masker_output" format="tabular" label="SegAlign Repeat Masker on ${on_string}"> | |
231 <filter>mode['mode_selector'] == 'segalign_repeat_masker'</filter> | |
232 </data> | |
233 </outputs> | 145 </outputs> |
234 <tests> | 146 <tests> |
235 <test expect_num_outputs="1" expect_test_failure="true"> | 147 <test expect_num_outputs="1" expect_test_failure="true"> |
236 <param name="mode_selector" value="segalign"/> | |
237 <param name="target" value="hg38.chr20.chunk.fa.gz" ftype="fasta.gz"/> | 148 <param name="target" value="hg38.chr20.chunk.fa.gz" ftype="fasta.gz"/> |
238 <param name="query" value="mm39.chr2.chunk.fa.gz" ftype="fasta.gz"/> | 149 <param name="query" value="mm39.chr2.chunk.fa.gz" ftype="fasta.gz"/> |
239 <output name="segalign_output" decompress="true" file="segalign-output.maf.gz" ftype="maf"/> | 150 <output name="segalign_output" ftype="tgz"> |
240 </test> | |
241 <test expect_num_outputs="1" expect_test_failure="true"> | |
242 <param name="mode_selector" value="segalign_repeat_masker"/> | |
243 <param name="seq_file" value="hg38.chr20.chunk.fa.gz" ftype="fasta.gz"/> | |
244 <output name="segalign_repeat_masker_output" decompress="true" file="segalign-repeat-masker-output.tab.gz" ftype="tabular"/> | |
245 </test> | |
246 <test expect_num_outputs="1" expect_test_failure="true"> | |
247 <param name="mode_selector" value="segalign"/> | |
248 <param name="target" value="hg38.chr20.chunk.fa.gz" ftype="fasta.gz"/> | |
249 <param name="query" value="mm39.chr2.chunk.fa.gz" ftype="fasta.gz"/> | |
250 <param name="diagonal_partition" value="true"/> | |
251 <output name="segalign_diagonal_partition_output" ftype="tgz"> | |
252 <assert_contents> | 151 <assert_contents> |
253 <has_archive_member path="galaxy/commands.json"/> | 152 <has_archive_member path="galaxy/commands.json"/> |
254 </assert_contents> | 153 </assert_contents> |
255 </output> | 154 </output> |
256 </test> | 155 </test> |