-
Notifications
You must be signed in to change notification settings - Fork 525
Expand file tree
/
Copy pathdeacon_datamanager.xml
More file actions
178 lines (178 loc) · 8.38 KB
/
Copy pathdeacon_datamanager.xml
File metadata and controls
178 lines (178 loc) · 8.38 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
<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>
</requirements>
<command detect_errors="exit_code"><![CDATA[
mkdir -p '$out_file.extra_files_path' &&
#if $test != "true"
#if $input.is_select == "prebuild"
#if $download == "human"
wget -P '$out_file.extra_files_path' 'https://zenodo.org/records/17288185/files/panhuman-1.k31w15.idx' &&
#else
wget -P '$out_file.extra_files_path' 'https://objectstorage.uk-london-1.oraclecloud.com/n/lrbvkel2wjot/b/human-genome-bucket/o/deacon/3/panmouse-1.k31w15.idx' &&
#end if
#else if $input.is_select == "url"
wget -P '$out_file.extra_files_path' '$link' &&
#else
wget '$link' &&
deacon index build '${link.split('/')[-1]}' -o '${file_name}.idx' &&
mv '${file_name}.idx' '$out_file.extra_files_path' &&
#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 == "prebuild"
#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 == "prebuild"
#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 == "prebuild"
"version":"@TOOL_VERSION@",
#else
"version":"$version",
#end if
#if $input.is_select == "prebuild"
"value":"prebuilt-${time}",
#else
"value":"custom-${time}",
#end if
#if $input.is_select == "prebuild"
"format_version":"3",
#else
"format_version":"$format_version",
#end if
#if $input.is_select == "prebuild"
"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="prebuild" selected="true">Download a prebuilt file</option>
<option value="fasta">Download a fasta file and build index file from it</option>
</param>
<when value="prebuild">
<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="format_version" type="text" label="Set the index format version" help="The current index format version for Deacon v.@TOOL_VERSION@ is 3"/>
<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 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="format_version" type="text" label="Set the index format version" help="The current index format version for Deacon v.@TOOL_VERSION@ is 3"/>
<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="prebuild"/>
<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="format_version" value="3"/>
<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="format_version" value="3"/>
<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>
</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>