comparison dram_merge_annotations.xml @ 0:2675f8d7b2a5 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dram commit df10ba86507266a6a6f83c9bbefb7191a41b46f5
author iuc
date Sat, 10 Dec 2022 21:14:28 +0000
parents
children 96c0067106ec
comparison
equal deleted inserted replaced
-1:000000000000 0:2675f8d7b2a5
1 <tool id="dram_merge_annotations" name="DRAM merge multiple annotations" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2 <description>into a single set</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="requirements"/>
7 <command detect_errors="exit_code"><![CDATA[
8 ## DRAM expects a specific file name for each file in the set.
9 #set annotations_file_name = 'annotations.tsv'
10 #set genbank_file_name = 'genbank'
11 #set trnas_file_name = 'trnas.tsv'
12 #set rrnas_file_name = 'rrnas.tsv'
13 #set scaffolds_file_name = 'scaffolds.fna'
14 #set genes_gff_file_name = 'genes.gff'
15 #set genes_fna_file_name = 'genes.fna'
16 #set genes_faa_file_name = 'genes.faa'
17
18 ## DRAM expects each annotation set to be in a different directory.
19 #set input_dirs = list()
20 #for $index, $item in enumerate($annotations_collection):
21 #set dir_name = 'input_dir_' + str($index)
22 mkdir '$dir_name' &&
23 ln -s '$item' '$dir_name/$annotations_file_name' &&
24 ln -s '$genbank_collection[$index]' '$dir_name/$genbank_file_name' &&
25 #if $trnas_collection:
26 ln -s '$trnas_collection[$index]' '$dir_name/$trnas_file_name' &&
27 #end if
28 #if $rrnas_collection
29 ln -s '$rrnas_collection[$index]' '$dir_name/$rrnas_file_name' &&
30 #end if
31 ln -s '$scaffolds_collection[$index]' '$dir_name/$scaffolds_file_name' &&
32 ln -s '$genes_gff_collection[$index]' '$dir_name/$genes_gff_file_name' &&
33 ln -s '$genes_fna_collection[$index]' '$dir_name/$genes_fna_file_name' &&
34 ln -s '$genes_faa_collection[$index]' '$dir_name/$genes_faa_file_name' &&
35 $input_dirs.append($dir_name)
36 #end for
37
38 DRAM.py merge_annotations
39 --input_dirs 'input_dir*'
40 --output_dir 'output_dir'
41 && test -f 'output_dir/genes.faa' && mv 'output_dir/genes.faa' '$output_genes_faa' || echo 'No genes.faa output produced'
42 && test -f 'output_dir/genes.fna' && mv 'output_dir/genes.fna' '$output_genes_fna' || echo 'No genes.fna output produced'
43 && test -f 'output_dir/genes.gff' && mv 'output_dir/genes.gff' '$output_genes_gff' || echo 'No genes.gff output produced'
44 && test -f 'output_dir/scaffolds.fna' && mv 'output_dir/scaffolds.fna' '$output_scaffolds_fna' || echo 'No scaffolds.fna output produced'
45 #if $rrnas_collection:
46 && test -f 'output_dir/rrnas.tsv' && mv 'output_dir/rrnas.tsv' '$output_rrnas' || echo 'No rrnas.tsv output produced'
47 #end if
48 #if $trnas_collection:
49 && test -f 'output_dir/trnas.tsv' && mv 'output_dir/trnas.tsv' '$output_trnas' || echo 'No trnas.tsv output produced'
50 #end if
51 && test -f 'output_dir/annotations.tsv' && mv 'output_dir/annotations.tsv' '$output_annotations' || echo 'No annotations.tsv output produced'
52 ]]></command>
53 <inputs>
54 <param name="annotations_collection" type="data_collection" format="tabular" collection_type="list" label="Collection of annotation files"/>
55 <param name="genbank_collection" type="data_collection" format="genbank" collection_type="list" label="Collection of genbank files"/>
56 <param name="trnas_collection" type="data_collection" format="tabular" collection_type="list" optional="true" label="Collection of trna files"/>
57 <param name="rrnas_collection" type="data_collection" format="tabular" collection_type="list" optional="true" label="Collection of rrna files"/>
58 <param name="scaffolds_collection" type="data_collection" format="fasta" collection_type="list" label="Collection of scaffolds files"/>
59 <param name="genes_gff_collection" type="data_collection" format="gff3" collection_type="list" label="Collection of genes.gff files"/>
60 <param name="genes_fna_collection" type="data_collection" format="fasta" collection_type="list" label="Collection of genes.fna files"/>
61 <param name="genes_faa_collection" type="data_collection" format="fasta" collection_type="list" label="Collection of genes.faa files"/>
62 </inputs>
63 <outputs>
64 <data name="output_genes_faa" format="fasta" label="${tool.name} on ${on_string}: genes.faa"/>
65 <data name="output_genes_fna" format="fasta" label="${tool.name} on ${on_string}: genes.fna"/>
66 <data name="output_genes_gff" format="gff3" label="${tool.name} on ${on_string}: genes.gff"/>
67 <data name="output_scaffolds_fna" format="fasta" label="${tool.name} on ${on_string}: scaffolds"/>
68 <data name="output_rrnas" format="tabular" label="${tool.name} on ${on_string}: rrnas">
69 <filter>rrnas_collection</filter>
70 </data>
71 <data name="output_trnas" format="tabular" label="${tool.name} on ${on_string}: trnas">
72 <filter>trnas_collection</filter>
73 </data>
74 <!-- DRAM just copies the genbank files to a directory -->
75 <collection name="output_genbank" type="list" label="${tool.name} on ${on_string}: genbank">
76 <discover_datasets pattern="__name__" ext="genbank" directory="output_dir/genbank"/>
77 </collection>
78 <data name="output_annotations" format="tabular" label="${tool.name} on ${on_string}: annotations"/>
79 </outputs>
80 <tests>
81 <!--
82 These tests succeed, but the outputs are empty because the DRAM
83 database is not available in the test environment.
84 -->
85 <test expect_num_outputs="8">
86 <param name="annotations_collection">
87 <collection type="list">
88 <element name="annotated1" value="annotated1.tabular"/>
89 <element name="annotated2" value="annotated2.tabular"/>
90 </collection>
91 </param>
92 <param name="genbank_collection">
93 <collection type="list">
94 <element name="annotated1" value="annotated1.genbank"/>
95 <element name="annotated2" value="annotated2.genbank"/>
96 </collection>
97 </param>
98 <param name="trnas_collection">
99 <collection type="list">
100 <element name="annotated1" value="annotated1_trnas.tabular"/>
101 <element name="annotated2" value="annotated2_trnas.tabular"/>
102 </collection>
103 </param>
104 <param name="rrnas_collection">
105 <collection type="list">
106 <element name="annotated1" value="annotated1_rrnas.tabular"/>
107 <element name="annotated2" value="annotated2_rrnas.tabular"/>
108 </collection>
109 </param>
110 <param name="scaffolds_collection">
111 <collection type="list">
112 <element name="annotated1" value="annotated1_scaffold.fasta"/>
113 <element name="annotated2" value="annotated2_scaffold.fasta"/>
114 </collection>
115 </param>
116 <param name="genes_gff_collection">
117 <collection type="list">
118 <element name="annotated1" value="annotated1.gff"/>
119 <element name="annotated2" value="annotated2.gff"/>
120 </collection>
121 </param>
122 <param name="genes_fna_collection">
123 <collection type="list">
124 <element name="annotated1" value="annotated1_genes_fna.fasta"/>
125 <element name="annotated2" value="annotated2_genes_fna.fasta"/>
126 </collection>
127 </param>
128 <param name="genes_faa_collection">
129 <collection type="list">
130 <element name="annotated1" value="annotated1_genes_faa.fasta"/>
131 <element name="annotated2" value="annotated2_genes_faa.fasta"/>
132 </collection>
133 </param>
134 <output name="output_annotations">
135 <assert_contents>
136 <has_n_lines n="530" delta="1"/>
137 </assert_contents>
138 </output>
139 <output_collection name="output_genbank" type="list" count="2">
140 <element name="annotation_0.gbk" ftype="genbank">
141 <assert_contents>
142 <has_text text="LOCUS"/>
143 </assert_contents>
144 </element>
145 <element name="annotation_1.gbk" ftype="genbank">
146 <assert_contents>
147 <has_text text="LOCUS"/>
148 </assert_contents>
149 </element>
150 </output_collection>
151 <output name="output_trnas">
152 <assert_contents>
153 <has_n_lines n="8" delta="1"/>
154 </assert_contents>
155 </output>
156 <output name="output_rrnas">
157 <assert_contents>
158 <has_n_lines n="3" delta="1"/>
159 </assert_contents>
160 </output>
161 <output name="output_scaffolds_fna">
162 <assert_contents>
163 <has_n_lines n="4" delta="1"/>
164 </assert_contents>
165 </output>
166 <output name="output_genes_gff">
167 <assert_contents>
168 <has_n_lines n="23" delta="1"/>
169 </assert_contents>
170 </output>
171 <output name="output_genes_fna">
172 <assert_contents>
173 <has_n_lines n="26" delta="1"/>
174 </assert_contents>
175 </output>
176 <output name="output_genes_faa">
177 <assert_contents>
178 <has_n_lines n="26" delta="1"/>
179 </assert_contents>
180 </output>
181 </test>
182 </tests>
183 <help>
184 **What it does**
185
186 @WHATITDOESHEADER@
187
188 This tool accepts collections of the components of a DRAM annotations (i.e., annotations, genbank files, GFF files, tRNAs,
189 rRNas, etc) and, except for the genbank files which remain a collection, merges the set of files for each component into
190 a single file.
191
192 @WHATITDOESFOOTER@
193 </help>
194 <expand macro="citations"/>
195 </tool>