comparison trj.xml @ 16:32052c6c3310 draft default tip

planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/gromacs commit 4bffc6aa89cd0e6d6435a6e571b3836eaab076f1
author chemteam
date Mon, 24 Oct 2022 22:36:40 +0000
parents 72459c3ea5f6
children
comparison
equal deleted inserted replaced
15:4a303225d447 16:32052c6c3310
1 <tool id="gmx_trj" name="Modify/convert GROMACS trajectories" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@"> 1 <tool id="gmx_trj" name="Modify/convert and concatate GROMACS trajectories" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@" profile="21.09">
2 <description>using trjconv and trjcat</description> 2 <description>using trjconv and trjcat</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 <token name="@GALAXY_VERSION@">1</token> 5 <token name="@GALAXY_VERSION@">2</token>
6 <xml name="fit_when" token_option="none"> 6 <xml name="fit_when" token_option="none">
7 <when value="@OPTION@"> 7 <when value="@OPTION@">
8 <param name="index_fit" type="text" label="Index of group to use for fitting" help="Index of group to use for fitting - i.e. the group's position in the ndx file (using zero-based numbering, so the first group has index 0)."> 8 <param name="index_fit" type="text" label="Index of group to use for fitting" help="Index of group to use for fitting - i.e. the group's position in the ndx file (using zero-based numbering, so the first group has index 0).">
9 <validator type="regex" message="Only numeric values allowed">^[0-9]*$</validator> 9 <validator type="regex" message="Only numeric values allowed">^[0-9]*$</validator>
10 </param> 10 </param>
11 </when> 11 </when>
12 </xml> 12 </xml>
13 </macros> 13 </macros>
14 14 <expand macro="requirements"/>
15 <expand macro="requirements" />
16
17 <command detect_errors="exit_code"><![CDATA[ 15 <command detect_errors="exit_code"><![CDATA[
18 #if $trj.trj_op == 'trjcat': 16 #if $trj.trj_op == 'trjcat':
19 mkdir trajs && 17 mkdir trajs &&
20 #for $value, $file in enumerate($trj_input): 18 #set $file_count = 0 ## sets 1st input to 0
21 ln -s '$file' trajs/traj_${str(value).rjust(10, '0')}.${file.ext} && 19 #set $file_list = []
20 #for $file_count, $file in enumerate($trj_input): ## enumerates each input file, starting from 0
21 #set $filename = "trajs/traj_%i.%s" % ($file_count, $file.ext)
22 #silent $file_list.append($filename)
23 ln -s '$file' '$filename' &&
22 #end for 24 #end for
25
26 ## runs inputs from a repeat block. By choosing each input, this allows the user to select individual input files at a time, as well as ensure the proper order.
27 #for $traj_repeat in $trj.inputtrajs:
28 #for $file in $traj_repeat.trj_input:
29 #set $file_count = $file_count + 1 ## inputs from this repeat block will be numbered at + 1 ahead of inputs from first multiple select above
30 #set $filename = "trajs/traj_%i.%s" % ($file_count, $file.ext)
31 #silent $file_list.append($filename)
32 ln -s '$file' '$filename' &&
33 #end for
34 #end for
23 35
24 gmx trjcat 36 gmx trjcat
25 -f trajs/traj* ## here we assume that they all have the same ext, probably reasonable 37 -f
38 #for $filename in $file_list:
39 '$filename'
40 #end for
26 $trj.cat 41 $trj.cat
27 -e '$time.e' 42 -e '$time.e'
28 43
29 #elif $trj.trj_op == 'trjconv': 44 #elif $trj.trj_op == 'trjconv':
30 ln -s '$ndx_input' ./index.ndx && 45 ln -s '$ndx_input' ./index.ndx &&
56 -boxcenter $trj.boxcenter 71 -boxcenter $trj.boxcenter
57 -fit $trj.fit.fit 72 -fit $trj.fit.fit
58 #if $time.e != -1: 73 #if $time.e != -1:
59 -e '$time.e' 74 -e '$time.e'
60 #end if 75 #end if
76 #if $trj.skip:
77 -skip $trj.skip
78 #end if
61 #end if 79 #end if
62 80
63 -b '$time.b' 81 -b '$time.b'
64 -dt '$time.dt' 82 -dt '$time.dt'
65 -o ./output.${output_format} && 83 -o ./output.${output_format}
66 &>> verbose.txt 84 >> verbose.txt 2>&1
67 #if not $trj.sep: 85 #if not $trj.sep:
68 && 86 &&
69 mv ./output.${output_format} '$output' 87 mv ./output.${output_format} '$output'
70 #end if 88 #end if
71 ]]></command> 89 ]]></command>
72
73 <inputs> 90 <inputs>
74 <conditional name="trj"> 91 <conditional name="trj">
75 <param name="trj_op" type="select" label="Modify a trajectory or concatenate multiple trajectories?"> 92 <param name="trj_op" type="select" label="Modify a trajectory or concatenate multiple trajectories?">
76 <option value="trjconv">Modify (trjconv)</option> 93 <option value="trjconv">Modify (trjconv)</option>
77 <option value="trjcat">Concatenate (trjcat)</option> 94 <option value="trjcat">Concatenate (trjcat)</option>
78 </param> 95 </param>
79 <when value="trjconv"> 96 <when value="trjconv">
80 <param name="trj_input" type="data" format='xtc,trr,pdb,gro' label="Input trajectory" help="In XTC or TRR format; structure files with PDB or GRO format can also be used."/> 97 <param name="trj_input" type="data" format="xtc,trr,pdb,gro" label="Input trajectory" help="In XTC or TRR format; structure files with PDB or GRO format can also be used."/>
81 <param name="str_input" type="data" format='pdb,gro,tpr' label="Input structure" help="In PDB, GRO or TPR format."/> 98 <param name="str_input" type="data" format="pdb,gro,tpr" label="Input structure" help="In PDB, GRO or TPR format."/>
82 <param name="ndx_input" type="data" format='ndx' label="Index (NDX) file" optional="true" help="In NDX format. Optional."/> 99 <param name="ndx_input" type="data" format="ndx" label="Index (NDX) file" optional="true" help="In NDX format. Optional."/>
83 <param name="index_output" value="0" type="text" label="Index of group to save in the output" help="Index of group to save in the output - i.e. the group's position in the ndx file (using zero-based numbering, so the first group has index 0)."> 100 <param name="index_output" value="0" type="text" label="Index of group to save in the output" help="Index of group to save in the output - i.e. the group's position in the ndx file (using zero-based numbering, so the first group has index 0).">
84 <validator type="regex" message="Only numeric values allowed">^[0-9]*$</validator> 101 <validator type="regex" message="Only numeric values allowed">^[0-9]*$</validator>
85 </param> 102 </param>
86 <param name="index_center" type="text" label="Index of group for centering" optional="true" help="Index of group for centering - i.e. the group's position in the ndx file (using zero-based numbering, so the first group has index 0). Leave blank if centering is not required."> 103 <param name="index_center" type="text" label="Index of group for centering" optional="true" help="Index of group for centering - i.e. the group's position in the ndx file (using zero-based numbering, so the first group has index 0). Leave blank if centering is not required.">
87 <validator type="regex" message="Only numeric values allowed">^[0-9]*$</validator> 104 <validator type="regex" message="Only numeric values allowed">^[0-9]*$</validator>
89 <param name="sep" type="select" label="Write each trajectory frame to a separate GRO or PDB file?" help="Results will be stored as a Galaxy collection. Only has effect with PDB or GRO output, otherwise ignored"> 106 <param name="sep" type="select" label="Write each trajectory frame to a separate GRO or PDB file?" help="Results will be stored as a Galaxy collection. Only has effect with PDB or GRO output, otherwise ignored">
90 <option value="" selected="true">No</option> 107 <option value="" selected="true">No</option>
91 <option value="sep">Yes, write each frame separately</option> 108 <option value="sep">Yes, write each frame separately</option>
92 </param> 109 </param>
93 <conditional name="pbc"> 110 <conditional name="pbc">
94 <param name="pbc" type="select" label="PBC treatment" > 111 <param name="pbc" type="select" label="PBC treatment">
95 <option value="none">none</option> 112 <option value="none">none</option>
96 <option value="mol">mol</option> 113 <option value="mol">mol</option>
97 <option value="res">res</option> 114 <option value="res">res</option>
98 <option value="atom">atom</option> 115 <option value="atom">atom</option>
99 <option value="nojump">nojump</option> 116 <option value="nojump">nojump</option>
103 <when value="cluster"> 120 <when value="cluster">
104 <param name="index_cluster" type="text" label="Index of group to use for clustering" help="Index of group to use for clustering - i.e. the group's position in the ndx file (using zero-based numbering, so the first group has index 0)."> 121 <param name="index_cluster" type="text" label="Index of group to use for clustering" help="Index of group to use for clustering - i.e. the group's position in the ndx file (using zero-based numbering, so the first group has index 0).">
105 <validator type="regex" message="Only numeric values allowed">^[0-9]*$</validator> 122 <validator type="regex" message="Only numeric values allowed">^[0-9]*$</validator>
106 </param> 123 </param>
107 </when> 124 </when>
108 <when value="none" /> 125 <when value="none"/>
109 <when value="mol" /> 126 <when value="mol"/>
110 <when value="res" /> 127 <when value="res"/>
111 <when value="atom" /> 128 <when value="atom"/>
112 <when value="nojump" /> 129 <when value="nojump"/>
113 <when value="whole" /> 130 <when value="whole"/>
114 </conditional> 131 </conditional>
115 <param name="ur" type="select" label="Unit cell representation" help="Only has effect in combination with PBC treatment of mol, res or atom"> 132 <param name="ur" type="select" label="Unit cell representation" help="Only has effect in combination with PBC treatment of mol, res or atom">
116 <option value="rect" selected="true">rect</option> 133 <option value="rect" selected="true">rect</option>
117 <option value="tric">tric</option> 134 <option value="tric">tric</option>
118 <option value="compact">compact</option> 135 <option value="compact">compact</option>
119 </param> 136 </param>
120 <param name="boxcenter" type="select" label="Center for PBC and centering treatment" > 137 <param name="skip" type="integer" min="1" value="1" label="Number of frames to skip" help="This allows you to compress a trajectory file, by reducing the amount of frames written out into the new trajectory file."/>
138 <param name="boxcenter" type="select" label="Center for PBC and centering treatment">
121 <option value="rect">rect</option> 139 <option value="rect">rect</option>
122 <option value="tric" selected="true">tric</option> 140 <option value="tric" selected="true">tric</option>
123 <option value="zero">zero</option> 141 <option value="zero">zero</option>
124 </param> 142 </param>
125 <conditional name="fit"> 143 <conditional name="fit">
126 <param name="fit" type="select" label="Fit molecule to reference structure in the reference file?" > 144 <param name="fit" type="select" label="Fit molecule to reference structure in the reference file?">
127 <option value="none" selected="true">No fitting</option> 145 <option value="none" selected="true">No fitting</option>
128 <option value="rot+trans">rot+trans</option> 146 <option value="rot+trans">rot+trans</option>
129 <option value="rotxy+transxy">rotxy+transxy</option> 147 <option value="rotxy+transxy">rotxy+transxy</option>
130 <option value="translation">translation</option> 148 <option value="translation">translation</option>
131 <option value="transxy">transxy</option> 149 <option value="transxy">transxy</option>
138 <expand macro="fit_when" option="transxy"/> 156 <expand macro="fit_when" option="transxy"/>
139 <expand macro="fit_when" option="progressive"/> 157 <expand macro="fit_when" option="progressive"/>
140 </conditional> 158 </conditional>
141 </when> 159 </when>
142 <when value="trjcat"> 160 <when value="trjcat">
143 <param name="trj_input" type="data" format='xtc,trr' label="Input trajectories" help="In XTC or TRR format, but please do not mix the two. Please note that if you want to take order into account when concatenating, you must use a collection as input." multiple="true"/> 161 <param name="trj_input" type="data" format="xtc,trr" label="Input trajectories" help="In XTC or TRR format, but please do not mix the two. Please note that the order of concatenation is the same as the consecutive order of these selected inputs." multiple="true"/>
162 <repeat name="inputtrajs" title="Select input trajectories" min="0">
163 <param name="trj_input" type="data" format="xtc,trr" label="Input trajectories" help="In XTC or TRR format, but please do not mix the two. Please note that the order of concatenation is the same as the consecutive order of these selected inputs." multiple="true"/>
164 </repeat>
144 <param name="cat" type="boolean" label="Do not discard double time frames" truevalue="-cat" falsevalue="-nocat"/> 165 <param name="cat" type="boolean" label="Do not discard double time frames" truevalue="-cat" falsevalue="-nocat"/>
145 <param name="sep" type="hidden" value="" /> 166 <param name="sep" type="hidden" value=""/>
146 </when> 167 </when>
147 </conditional> 168 </conditional>
148 <param name="output_format" type="select" label="Output format" > 169 <param name="output_format" type="select" label="Output format">
149 <option value="xtc">XTC</option> 170 <option value="xtc">XTC</option>
150 <option value="trr">TRR</option> 171 <option value="trr">TRR</option>
151 <option value="pdb">PDB</option> 172 <option value="pdb">PDB</option>
152 <option value="gro">GRO</option> 173 <option value="gro">GRO</option>
153 </param> 174 </param>
154 <section title="Time" name='time' expanded="true"> 175 <section title="Time" name="time" expanded="true">
155 <param name="b" type="integer" label="Start time" help="Time (ps) of first frame to read from trajectory" value="0" min="0"/> 176 <param name="b" type="integer" label="Start time" help="Time (ps) of first frame to read from trajectory" value="0" min="0"/>
156 <param name="e" type="integer" label="End time" help="Time (ps) of last frame to read from trajectory" value="-1" min="-1"/> <!-- stupidly this has different default values for trjconv and trjcat --> 177 <param name="e" type="integer" label="End time" help="Time (ps) of last frame to read from trajectory" value="-1" min="-1"/>
157 <param name="dt" type="integer" label="Write frames at this time interval (ps)" help="Only write frame when t is exactly divisible by this value. Leave as 0 to record all frames." value="0" min="0"/> 178 <!-- stupidly this has different default values for trjconv and trjcat -->
179 <param name="dt" type="integer" label="Write frames at this time interval (ps)" help="Only write frame when t is exactly divisible by this value. Leave as 0 to record all frames." value="0" min="0"/>
158 </section> 180 </section>
159 <expand macro="log" /> 181 <expand macro="log"/>
160 </inputs> 182 </inputs>
161 <outputs> 183 <outputs>
162 <data name="output" format="xtc"> 184 <data name="output" format="xtc">
163 <filter>not trj.get("sep") or output_format in ["xtc", "trr"]</filter> 185 <filter>not trj.get("sep") or output_format in ["xtc", "trr"]</filter>
164 <change_format> 186 <change_format>
174 </collection> 196 </collection>
175 <collection type="list" name="pdb_frames" label="Trajectory frames"> 197 <collection type="list" name="pdb_frames" label="Trajectory frames">
176 <filter>trj.get("sep") and output_format == 'pdb'</filter> 198 <filter>trj.get("sep") and output_format == 'pdb'</filter>
177 <discover_datasets pattern="(?P&lt;designation&gt;^output[0-9]{9}\.pdb$)" ext="pdb"/> 199 <discover_datasets pattern="(?P&lt;designation&gt;^output[0-9]{9}\.pdb$)" ext="pdb"/>
178 </collection> 200 </collection>
179 <expand macro="log_outputs" /> 201 <expand macro="log_outputs"/>
180 </outputs> 202 </outputs>
181 <tests> 203 <tests>
182 <test> 204 <test>
183 <!-- gmx trjcat -f npt.xtc nvt.xtc -cat -o test.xtc --> 205 <!-- gmx trjcat -f npt.xtc nvt.xtc -cat -o test.xtc -->
184 <param name="trj_op" value="trjcat" /> 206 <param name="trj_op" value="trjcat"/>
185 <param name="trj_input" value="npt.xtc,nvt.xtc" /> 207 <param name="trj_input" value="npt.xtc,nvt.xtc"/>
186 <param name="b" value="0" /> 208 <param name="b" value="0"/>
187 <param name="e" value="-1" /> 209 <param name="e" value="-1"/>
188 <param name="dt" value="0" /> 210 <param name="dt" value="0"/>
189 <param name="cat" value="true" /> 211 <param name="cat" value="true"/>
212 <output name="output" file="trjcat.xtc" ftype="xtc"/>
213 </test>
214 <test>
215 <!-- gmx trjcat -f npt.xtc nvt.xtc -cat -o test.xtc -->
216 <conditional name="trj">
217 <param name="trj_op" value="trjcat"/>
218 <param name="trj_input" value="npt.xtc"/>
219 <repeat name="inputtrajs">
220 <param name="trj_input" value="nvt.xtc"/>
221 </repeat>
222 <param name="cat" value="true"/>
223 </conditional>
224 <param name="output_format" value="xtc"/>
225 <section name="time">
226 <param name="b" value="0"/>
227 <param name="e" value="-1"/>
228 <param name="dt" value="0"/>
229 </section>
190 <output name="output" file="trjcat.xtc" ftype="xtc"/> 230 <output name="output" file="trjcat.xtc" ftype="xtc"/>
191 </test> 231 </test>
192 <test> 232 <test>
193 <!-- echo '1 1' | gmx trjconv -f npt.xtc -s npt.tpr -n -center -pbc mol -ur compact -o npt_c.xtc --> 233 <!-- echo '1 1' | gmx trjconv -f npt.xtc -s npt.tpr -n -center -pbc mol -ur compact -o npt_c.xtc -->
194 <!-- <param name="trj_op" value="trjconv" /> --> 234 <!-- <param name="trj_op" value="trjconv" /> -->
195 <param name="trj_input" value="npt.xtc" /> 235 <param name="trj_input" value="npt.xtc"/>
196 <param name="str_input" value="npt.tpr" ftype="tpr"/> 236 <param name="str_input" value="npt.tpr" ftype="tpr"/>
197 <param name="ndx_input" value="index.ndx" /> 237 <param name="ndx_input" value="index.ndx"/>
198 <param name="b" value="0" /> 238 <param name="b" value="0"/>
199 <param name="e" value="-1" /> 239 <param name="e" value="-1"/>
200 <param name="dt" value="0" /> 240 <param name="dt" value="0"/>
201 <param name="index_output" value="1" /> 241 <param name="index_output" value="1"/>
202 <param name="index_center" value="1" /> 242 <param name="index_center" value="1"/>
203 <param name="pbc" value="mol" /> 243 <param name="pbc" value="mol"/>
204 <param name="ur" value="tric" /> 244 <param name="ur" value="tric"/>
205 <output name="output" file="trjconv.xtc" ftype="xtc"/> 245 <output name="output" file="trjconv.xtc" ftype="xtc"/>
206 </test> 246 </test>
207 <test> 247 <test>
248 <!-- testing skip -->
249 <!-- echo '1 1' | gmx trjconv -f npt.xtc -s npt.tpr -n -center -pbc mol -ur compact -skip 2 -o npt_c.xtc -->
250 <!-- <param name="trj_op" value="trjconv" /> -->
251 <param name="trj_input" value="npt.xtc"/>
252 <param name="str_input" value="npt.tpr" ftype="tpr"/>
253 <param name="ndx_input" value="index.ndx"/>
254 <param name="b" value="0"/>
255 <param name="e" value="-1"/>
256 <param name="dt" value="0"/>
257 <param name="index_output" value="1"/>
258 <param name="index_center" value="1"/>
259 <param name="pbc" value="mol"/>
260 <param name="ur" value="compact"/>
261 <param name="skip" value="2"/>
262 <output name="output" file="trjconv_skip2.xtc" ftype="xtc"/>
263 </test>
264 <test>
208 <!-- test sep flag --> 265 <!-- test sep flag -->
209 <param name="trj_input" value="npt.xtc" /> 266 <param name="trj_input" value="npt.xtc"/>
210 <param name="str_input" value="npt.tpr" ftype="tpr"/> 267 <param name="str_input" value="npt.tpr" ftype="tpr"/>
211 <param name="ndx_input" value="index.ndx" /> 268 <param name="ndx_input" value="index.ndx"/>
212 <param name="b" value="0" /> 269 <param name="b" value="0"/>
213 <param name="e" value="-1" /> 270 <param name="e" value="-1"/>
214 <param name="dt" value="0" /> 271 <param name="dt" value="0"/>
215 <param name="index_output" value="0" /> 272 <param name="index_output" value="0"/>
216 <param name="sep" value="sep" /> 273 <param name="sep" value="sep"/>
217 <param name="output_format" value="pdb" /> 274 <param name="output_format" value="pdb"/>
218 <output_collection name="pdb_frames" type="list"> 275 <output_collection name="pdb_frames" type="list">
219 <element name="output000000007.pdb" ftype="pdb" file="frame7.pdb"/> 276 <element name="output000000007.pdb" ftype="pdb" file="frame7.pdb"/>
220 </output_collection> 277 </output_collection>
221 </test> 278 </test>
222 </tests> 279 </tests>
248 305
249 - GROMACS trajectory or structure file (XTC, TRR, PDB, GRO) 306 - GROMACS trajectory or structure file (XTC, TRR, PDB, GRO)
250 307
251 308
252 ]]></help> 309 ]]></help>
253 <expand macro="citations" /> 310 <expand macro="citations"/>
254 </tool> 311 </tool>