comparison hal_hal2fasta.xml @ 0:90503ee992eb draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/haltools commit 6244b9d15a5ad97ae20191e2f8fbafe2050c3cac
author iuc
date Fri, 06 Feb 2026 10:33:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:90503ee992eb
1 <tool id="hal_hal2fasta" name="hal2fasta" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2 <description>exports sequences from HAL to FASTA</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="requirements"/>
7 <expand macro="stdio"/>
8 <command detect_errors="aggressive"><![CDATA[
9 hal2fasta
10 #if $mode.export == 'default':
11 --start $mode.start
12 --length $mode.length
13 #else if $mode.export == '--sequence':
14 --sequence '$mode.sequence'
15 --start $mode.start
16 --length $mode.length
17 #else if $mode.export == '--subtree':
18 --subtree
19 #end if
20 --lineWidth $lineWidth
21 $upper
22 $ucscSequenceNames
23 '$input_hal' '$refGenome' > temp.fasta
24 #if $compression.type == 'gz':
25 && gzip -c temp.fasta > '$out_file'
26 #else if $compression.type == 'bz2':
27 && bzip2 -c temp.fasta > '$out_file'
28 #else:
29 && mv temp.fasta '$out_file'
30 #end if
31 ]]></command>
32 <inputs>
33 <expand macro="input_hal"/>
34 <expand macro="params_refGenome"/>
35 <conditional name="mode">
36 <param name="export" type="select" label="Export options">
37 <option value="default" selected="true">Export full reference genome (default)</option>
38 <option value="--sequence">Export a reference sequence (--sequence)</option>
39 <option value="--subtree">Export all genomes in the reference genome subtree (--subtree)</option>
40 </param>
41 <when value="default">
42 <expand macro="params_start"/>
43 <expand macro="params_length"/>
44 </when>
45 <when value="--subtree"/>
46 <when value="--sequence">
47 <expand macro="params_sequence"/>
48 <expand macro="params_start"/>
49 <expand macro="params_length"/>
50 </when>
51 </conditional>
52 <param argument="--upper" type="boolean" truevalue="--upper" falsevalue="" checked="false" label="Uppercase bases" help="Convert all bases to uppercase"/>
53 <param argument="--ucscSequenceNames" type="boolean" truevalue="--ucscSequenceNames" falsevalue="" checked="false" label="Use UCSC convention" help="Use the UCSC convention of Genome.Sequence for names. By default, only sequence names are used"/>
54 <param argument="--lineWidth" type="integer" min="1" value="80" label="Line width" help="Line width for output"/>
55 <expand macro="params_conditional_compression"/>
56 </inputs>
57 <outputs>
58 <data name="out_file" format="fasta" label="${tool.name} on ${on_string}: Genome FASTA">
59 <change_format>
60 <when input="compression.type" value="gz" format="fasta.gz"/>
61 <when input="compression.type" value="bz2" format="fasta.bz2"/>
62 </change_format>
63 </data>
64 </outputs>
65 <tests>
66 <test expect_num_outputs="1">
67 <param name="input_hal" value="halTest.hal"/>
68 <param name="refGenome" value="Genome_0"/>
69 <output name="out_file" ftype="fasta">
70 <assert_contents>
71 <has_line line=">Genome_0_seq"/>
72 <has_line line="CCCGTAACCCAATCCACGGTGCCGGCGGCGAGATGTATTGTCTGGGCGCAAAGCCATTTCGCCACCACATGCTGCGCGAC"/>
73 <has_n_lines n="23"/>
74 </assert_contents>
75 </output>
76 </test>
77 <test expect_num_outputs="1">
78 <param name="input_hal" value="halTest.hal"/>
79 <param name="refGenome" value="Genome_0"/>
80 <conditional name="compression">
81 <param name="type" value="gz"/>
82 </conditional>
83 <output name="out_file" ftype="fasta.gz" file="hal2fasta_output.fasta.gz"/>
84 </test>
85 <test expect_num_outputs="1">
86 <param name="input_hal" value="halTest.hal"/>
87 <param name="refGenome" value="Genome_0"/>
88 <conditional name="compression">
89 <param name="type" value="bz2"/>
90 </conditional>
91 <output name="out_file" ftype="fasta.bz2" file="hal2fasta_output.fasta.bz2"/>
92 </test>
93 <test expect_num_outputs="1">
94 <param name="input_hal" value="halTest.hal"/>
95 <param name="refGenome" value="Genome_0"/>
96 <param name="lineWidth" value="40"/>
97 <param name="upper" value="true"/>
98 <output name="out_file" ftype="fasta">
99 <assert_contents>
100 <has_line line=">Genome_0_seq"/>
101 <has_line line="TGCCGCGCGTGAGGTTGACACTCCGTTCGTGTTACATGTC"/>
102 <has_n_lines n="45"/>
103 </assert_contents>
104 </output>
105 </test>
106 <test expect_num_outputs="1">
107 <param name="input_hal" value="halTest.hal"/>
108 <param name="refGenome" value="Genome_0"/>
109 <conditional name="mode">
110 <param name="export" value="--sequence"/>
111 <param name="sequence" value="Genome_0_seq"/>
112 </conditional>
113 <output name="out_file" ftype="fasta">
114 <assert_contents>
115 <has_line line=">Genome_0_seq"/>
116 <has_line line="CCCGTAACCCAATCCACGGTGCCGGCGGCGAGATGTATTGTCTGGGCGCAAAGCCATTTCGCCACCACATGCTGCGCGAC"/>
117 <has_n_lines n="23"/>
118 </assert_contents>
119 </output>
120 </test>
121 <test expect_num_outputs="1">
122 <param name="input_hal" value="halTest.hal"/>
123 <param name="refGenome" value="Genome_0"/>
124 <conditional name="mode">
125 <param name="export" value="--subtree"/>
126 </conditional>
127 <output name="out_file" ftype="fasta">
128 <assert_contents>
129 <has_line line=">Genome_0_seq"/>
130 <has_line line=">Genome_1_seq"/>
131 <has_line line=">Genome_2_seq"/>
132 <has_line line=">Genome_3_seq"/>
133 <has_line line="CCCGTAACCCAATCCACGGTGCCGGCGGCGAGATGTATTGTCTGGGCGCAAAGCCATTTCGCCACCACATGCTGCGCGAC"/>
134 <has_n_lines n="226"/>
135 </assert_contents>
136 </output>
137 </test>
138 <test expect_num_outputs="1">
139 <param name="input_hal" value="halTest.hal"/>
140 <param name="refGenome" value="Genome_2"/>
141 <conditional name="mode">
142 <param name="export" value="--sequence"/>
143 <param name="sequence" value="Genome_2_seq"/>
144 <param name="start" value="50"/>
145 <param name="length" value="10"/>
146 </conditional>
147 <param name="ucscSequenceNames" value="true"/>
148 <output name="out_file" ftype="fasta">
149 <assert_contents>
150 <has_line line=">Genome_2.Genome_2_seq"/>
151 <has_line line="GAGGTTGACA"/>
152 <has_n_lines n="2"/>
153 </assert_contents>
154 </output>
155 </test>
156 <!--
157 Does not pass currently due to a bug - that was fixed but not avalaible as release yet (16.12.2025)
158 https://github.com/ComparativeGenomicsToolkit/hal/issues/324
159
160 <test expect_num_outputs="1">
161 <param name="input_hal" value="halTest.hal"/>
162 <param name="genome" value="Genome_0"/>
163 <conditional name="mode">
164 <param name="export" value="default"/>
165 <param name="start" value="50"/>
166 <param name="length" value="10"/>
167 </conditional>
168 <param name="ucscSequenceNames" value="true"/>
169 <output name="out_file" ftype="fasta">
170 <assert_contents>
171 <has_line line=">Genome_0.Genome_0_seq"/>
172 <has_line line="GAGGTTGACA"/>
173 </assert_contents>
174 </output>
175 </test>
176 -->
177 </tests>
178 <help><![CDATA[
179 hal2fasta exports sequence data from an input HAL file to an output FASTA file.
180 It can export a full genome, a single sequence of that genome, or all genomes in the entire subtree rooted of that genome.
181 When exporting the full genome or a single sequence of that genome, the exported range can be limited using start and length.
182 ]]></help>
183 <expand macro="citation"/>
184 <expand macro="creator"/>
185 </tool>