-
Notifications
You must be signed in to change notification settings - Fork 524
Expand file tree
/
Copy pathdeacon_datamanager.xml
More file actions
210 lines (210 loc) · 9.67 KB
/
Copy pathdeacon_datamanager.xml
File metadata and controls
210 lines (210 loc) · 9.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<tool id="deacon_build_database" name="Deacon" tool_type="manage_data" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
<description>database builder</description>
<macros>
<!-- on update run a local test setting `test` to something else than "true" -->
<token name="@TOOL_VERSION@">0.12.0</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@PROFILE@">26.0</token>
</macros>
<requirements>
<requirement type="package" version="@TOOL_VERSION@">deacon</requirement>
<requirement type="package" version="1.6.1">zenodo_get</requirement>
<requirement type="package" version="1.25.0">wget</requirement>
<requirement type="package" version="8.21.0">curl</requirement>
</requirements>
<command detect_errors="exit_code"><![CDATA[
mkdir -p '$out_file.extra_files_path' &&
#if $test != "true"
#if $input.is_select == "prebuilt"
#if $download == "human"
zenodo_get 17288185 -m -g "*.idx" -o '$out_file.extra_files_path' &&
#else
zenodo_get 17699167 -m -g "*.idx" -o '$out_file.extra_files_path' &&
#end if
#else if $input.is_select == "url"
if curl -sfI "$link" >&2; then
wget -P '$out_file.extra_files_path' '$link';
else
echo "Remote file does not exist" >&2 ;
exit 1 ;
fi &&
#else
if curl -sfI "$link" >&2; then
wget -P '$out_file.extra_files_path' '$link' ;
deacon index build '${link.split('/')[-1]}' -o '${file_name}.idx' ;
mv '${file_name}.idx' '$out_file.extra_files_path' ;
else
echo "Remote file does not exist" >&2 ;
exit 1 ;
fi &&
#end if
#else
touch '$out_file.extra_files_path'/test.idx &&
#end if
cp '$dmjson' '$out_file'
]]></command>
<configfiles>
<configfile name="dmjson"><![CDATA[
#from datetime import datetime
#set time=datetime.now().strftime("%Y-%m-%d")
{
"data_tables":{
"deacon":[
{
#if $input.is_select == "prebuilt"
#if $download == "human"
"path":"panhuman-1.k31w15.idx",
#else
"path":"panmouse-1.k31w15.idx",
#end if
#else if $input.is_select == "url"
"path":"${link.split('/')[-1]}",
#else
"path":"${file_name}.idx",
#end if
"dbkey":"",
#if $input.is_select == "prebuilt"
#if $download == "human"
"name":"panhuman-1 (k=31, w=15)",
#else
"name":"panmouse-1 (k=31, w=15, e=0.5)",
#end if
#else
"name":"$name",
#end if
#if $input.is_select == "prebuilt"
"version":"@TOOL_VERSION@",
#else
"version":"$version",
#end if
#if $input.is_select == "prebuilt"
"value":"prebuilt-${time}",
#else
"value":"custom-${time}",
#end if
"format_version":"3",
#if $input.is_select == "prebuilt"
"note":"Prebuilt index files from the devs of deacon"
#else
"note":"$note"
#end if
}
]
}
}]]>
</configfile>
</configfiles>
<inputs>
<conditional name="input">
<param name="is_select" type="select" label="Choose how to add data to the DM">
<option value="url">Copy an index file from an URL</option>
<option value="prebuilt" selected="true">Download a prebuilt file</option>
<option value="fasta">Download a fasta file and build index file from it</option>
</param>
<when value="prebuilt">
<param name="download" type="select" label="Select which prebuilt should be downloaded" help="See help section for more information">
<option value="human">panhuman-1 (k=31, w=15)</option>
<option value="mouse">panmouse-1 (k=31, w=15, e=0.5)</option>
</param>
</when>
<when value="url">
<param name="link" type="text" label="Input the URL to download a index file"/>
<param name="name" type="text" label="Set the name for the entry in the DM" help="For an example look in the name of the prebuilt files. Also add in brackets the values used for building the file!"/>
<param name="version" type="text" label="Which version was used to build the file to copy" help="State the tool version used to build the index file"/>
<param name="note" type="text" label="Add a note" help="Here some notes can be set for example from where the data comes, who created the data and so on"/>
</when>
<when value="fasta">
<param name="file_name" type="text" label="Enter filename" help="Please enter the name of the file which will be downloaded without the extension" />
<param name="link" type="text" label="Input the URL to download a fasta file for using it to build an index file"/>
<param name="name" type="text" label="Set the name for the entry in the DM" help="For an example look in the name of the prebuilt files. Also add in brackets the values used for building the file!"/>
<param name="version" type="text" label="Which version was used to build the file to copy" help="State the tool version used to build the index file"/>
<param name="note" type="text" label="Add a note" help="Here some notes can be set for example from where the data comes, who created the data and so on"/>
</when>
</conditional>
<param name="test" type="hidden"/>
</inputs>
<outputs>
<data name="out_file" format="data_manager_json" />
</outputs>
<tests>
<test expect_num_outputs="1">
<conditional name="input">
<param name="is_select" value="prebuilt"/>
<param name="download" value="human"/>
</conditional>
<param name="test" value="true"/>
<output name="out_file">
<assert_contents>
<has_text text='"format_version":"3"'/>
<has_text text='"name":"panhuman-1 (k=31, w=15)"'/>
</assert_contents>
</output>
</test>
<test expect_num_outputs="1">
<conditional name="input">
<param name="is_select" value="url"/>
<param name="link" value="https://zenodo.org/records/17288185/files/panhuman-1.k31w15.idx"/>
<param name="name" value="panhuman-1 (k=31, w=15)"/>
<param name="version" value="0.12.0"/>
<param name="note" value="test"/>
</conditional>
<param name="test" value="true"/>
<output name="out_file">
<assert_contents>
<has_text text='"format_version":"3"'/>
<has_text text='"name":"panhuman-1 (k=31, w=15)"'/>
</assert_contents>
</output>
</test>
<test expect_num_outputs="1">
<conditional name="input">
<param name="is_select" value="fasta"/>
<param name="file_name" value="panhuman-1.k31w15_test"/>
<param name="link" value="https://zenodo.org/records/17288185/files/panhuman-1.k31w15.fasta"/>
<param name="name" value="panhuman-1 (k=31, w=15)"/>
<param name="version" value="0.12.0"/>
<param name="note" value="test"/>
</conditional>
<param name="test" value="true"/>
<output name="out_file">
<assert_contents>
<has_text text='"format_version":"3"'/>
<has_text text='"name":"panhuman-1 (k=31, w=15)"'/>
</assert_contents>
</output>
</test>
<test expect_exit_code="1" expect_failure="true">
<conditional name="input">
<param name="is_select" value="fasta"/>
<param name="file_name" value="panhuman-1.k31w15_test"/>
<param name="link" value="https://zenodo.org/records/17288185/files/panhuman-1.k31w15adasdasd.fasta"/>
<param name="name" value="panhuman-1 (k=31, w=15)"/>
<param name="version" value="0.12.0"/>
<param name="note" value="test"/>
</conditional>
<param name="test" value="false"/>
<assert_stderr>
<has_text text="Remote file does not exist"/>
</assert_stderr>
</test>
<test expect_exit_code="1" expect_failure="true">
<conditional name="input">
<param name="is_select" value="url"/>
<param name="link" value="https://zenodo.org/records/17288185/files/panhuman-1.k31w15adasdasd.fasta"/>
<param name="name" value="panhuman-1 (k=31, w=15)"/>
<param name="version" value="0.12.0"/>
<param name="note" value="test"/>
</conditional>
<param name="test" value="false"/>
<assert_stderr>
<has_text text="Remote file does not exist"/>
</assert_stderr>
</test>
</tests>
<help><![CDATA[
Download prebuilt index files for deacon or download other index files made for deacon via url.
]]></help>
<citations>
<citation type="doi">10.1101/2025.06.09.658732</citation>
</citations>
</tool>