diff sim.xml @ 2:5642f48f5698 draft

"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tools/gromacs commit a71d03531d57b87b5e3ce40ee7d974fbe53a1dfa"
author chemteam
date Wed, 20 Nov 2019 11:13:22 -0500
parents ec3f665cca3e
children 4dba9a5b74fc
line wrap: on
line diff
--- a/sim.xml	Wed Oct 30 13:34:07 2019 -0400
+++ b/sim.xml	Wed Nov 20 11:13:22 2019 -0500
@@ -5,47 +5,48 @@
     </macros>
     <expand macro="requirements" />
     <command detect_errors="exit_code"><![CDATA[
-        #if $mdp.mdpfile == "custom":
-            ln -s '$mdp.mdp_input' ./md.mdp &&
+
+        #if $sets.mdp.mdpfile == "custom":
+            ln -s '$sets.mdp.mdp_input' ./md.mdp &&
         #end if
-        #if $mdp.mdpfile == "default":
+        #if $sets.mdp.mdpfile == "default":
             ln -s '$md' ./md.mdp &&
         #end if
 
         ln -s '$gro_input' ./inp.gro &&
         ln -s '$top_input' ./top_input.top &&
 
-        #if $posres.posres_bool == "true":
-            ln -s '$posres.itp_inp' ./posres.itp &&
-        #end if
-        
-        #if $cpt_inp.cpt_bool == "yes":
-            ln -s '$cpt_inp.cpt_in' ./inp.cpt &&
+        #if $inps.itp_in:
+            ln -s '$inps.itp_in' ./posres.itp &&
         #end if
 
-        #if $ndx_inp.ndx_bool == "yes":
-            ln -s '$ndx_inp.ndx_in' ./index.ndx &&
+        #if $inps.cpt_in:
+            ln -s '$inps.cpt_in' ./inp.cpt &&
+        #end if
+
+        #if $inps.ndx_in:
+            ln -s '$inps.ndx_in' ./index.ndx &&
         #end if
 
         gmx grompp 
             -f ./md.mdp 
             -c ./inp.gro 
-            #if $cpt_inp.cpt_bool == "yes":
-                -t ./inp.cpt 
+            #if $inps.cpt_in:
+                -t ./inp.cpt
             #end if
-            #if $posres.posres_bool == "true":
+            #if $inps.itp_in:
                 -r ./inp.gro
             #end if
-            #if $ndx_inp.ndx_bool == "true":
+            #if $inps.ndx_in:
                 -n ./index.ndx
             #end if
             -p ./top_input.top 
             -o outp.tpr &>> verbose.txt &&
-        
-        
+
+
         gmx mdrun -deffnm outp &>> verbose.txt
  
-        #if $str == 'pdb' or $str == 'both'
+        #if $outps.str == 'pdb' or $outps.str == 'both'
             && gmx editconf -f outp.gro -o outp.pdb &>> verbose.txt
         #end if
 
@@ -55,42 +56,44 @@
         <configfiles>
             <!-- .mdp file for the gromacs simulation -->
             <configfile name="md">
-                #if $mdp.mdpfile == 'default':
+                #if $sets.mdp.mdpfile == 'default':
                     title    = OPLS Lysozyme MD simulation 
                     ; Run parameters
-                    integrator  = $mdp.integrator    ; leap-frog integrator
-                    nsteps    = $mdp.md_steps  ; 2 * 500000 = 1000 ps (1 ns)
-                    dt        = $mdp.step_length    ; 2 fs
+                    integrator  = $sets.mdp.integrator    ; leap-frog integrator
+                    nsteps    = $sets.mdp.md_steps  ; 2 * 500000 = 1000 ps (1 ns)
+                    dt        = $sets.mdp.step_length    ; 2 fs
                     ; Output control
-                    nstxout            = $mdp.write_freq    ; save coordinates every 10.0 ps
-                    nstvout            = $mdp.write_freq    ; save velocities every 10.0 ps
-                    nstenergy          = $mdp.write_freq    ; save energies every 10.0 ps
-                    nstlog            = $mdp.write_freq    ; update log file every 10.0 ps
-                    nstxout-compressed  = $mdp.write_freq      ; save compressed coordinates every 10.0 ps
+                    nstxout            = $sets.mdp.write_freq    ; save coordinates every 10.0 ps
+                    nstvout            = $sets.mdp.write_freq    ; save velocities every 10.0 ps
+                    nstenergy          = $sets.mdp.write_freq    ; save energies every 10.0 ps
+                    nstlog            = $sets.mdp.write_freq    ; update log file every 10.0 ps
+                    nstxout-compressed  = $sets.mdp.write_freq      ; save compressed coordinates every 10.0 ps
                                                     ; nstxout-compressed replaces nstxtcout
                     compressed-x-grps   = System    ; group(s) to write to the compressed trajectory file
                     ; Bond parameters
-                    continuation          = $cpt_inp.cpt_bool    ; Restarting after NPT 
+                    #if $inps.cpt_in:
+                    continuation          = yes    ; Restarting after NPT 
+                    #end if
                     constraint_algorithm    = lincs      ; holonomic constraints 
-                    constraints              = $mdp.constraints  ; all bonds (even heavy atom-H bonds) constrained
+                    constraints              = $sets.mdp.constraints  ; all bonds (even heavy atom-H bonds) constrained
                     lincs_iter              = 1        ; accuracy of LINCS
                     lincs_order              = 4        ; also related to accuracy
                     ; Neighborsearching
-                    cutoff-scheme   = $mdp.cutoffscheme
+                    cutoff-scheme   = $sets.mdp.cutoffscheme
                     ns_type        = grid    ; search neighboring grid cells
                     nstlist        = 10      ; 20 fs, largely irrelevant with Verlet scheme
-                    rcoulomb      = $mdp.rcoulomb    ; Short-range electrostatic cut-off
-                    rlist       = $mdp.rlist ; Cut-off distance for the short-range neighbor list.
-                    rvdw        = $mdp.rvdw    ; Short-range Van der Waals cut-off
+                    rcoulomb      = $sets.mdp.rcoulomb    ; Short-range electrostatic cut-off
+                    rlist       = $sets.mdp.rlist ; Cut-off distance for the short-range neighbor list.
+                    rvdw        = $sets.mdp.rvdw    ; Short-range Van der Waals cut-off
                     ; Electrostatics
-                    coulombtype      = $mdp.coulombtype    ; method for electrostatics calculations e.g. PME
+                    coulombtype      = $sets.mdp.coulombtype    ; method for electrostatics calculations e.g. PME
                     pme_order      = 4        ; cubic interpolation
                     fourierspacing  = 0.16    ; grid spacing for FFT
                     ; Temperature coupling is on
                     tcoupl    = V-rescale              ; modified Berendsen thermostat
                     tc-grps    = Protein Non-Protein  ; two coupling groups - more accurate
                     tau_t    = 0.1    0.1          ; time constant, in ps
-                    ref_t    = $mdp.temperature $mdp.temperature           ; reference temperature, one for each group, in K
+                    ref_t    = $sets.mdp.temperature $sets.mdp.temperature           ; reference temperature, one for each group, in K
                     ; Periodic boundary conditions
                     pbc    = xyz    ; 3-D PBC
                     ; Dispersion correction
@@ -98,11 +101,11 @@
                     ; Velocity generation
                     gen_vel    = no    ; Velocity generation is off
                 #end if
-                #if $posres.posres_bool == "true":
+                #if $inps.itp_in:
                     define    = -DPOSRES  ; position restrain the protein
                     refcoord_scaling  = com
                 #end if
-                #if $ensemble == "nvt":
+                #if $sets.ensemble == "nvt":
                     pcoupl    = no     ; no pressure coupling in NVT
                 #else: 
                     ; Pressure coupling is on
@@ -119,101 +122,168 @@
     <inputs>
         <param argument="gro_input" type="data" format='gro' label="GRO structure file"/>
         <param argument="top_input" type="data" format='top' label="Topology (TOP) file"/>
-        <conditional name="cpt_inp">
-            <param name="cpt_bool" type="select" label="Use a checkpoint (CPT) file" help="CPT file from a previous MD run">
-                <option value="yes">Continue simulation from a CPT file</option>
-                <option value="no" selected="true">No CPT input</option>
-            </param>
-            <when value="yes">
-                <param argument="cpt_in" type="data" format='cpt' label="Checkpoint file"/>
-            </when>
-            <when value="no"/>
-        </conditional>
-        <param name="cpt_out" type="select" label="Produce a checkpoint (CPT) file" help="Produce CPT file for a subsequent MD run">
-            <option value="true">Produce CPT output</option>
-            <option value="false" selected="true">No CPT output</option>
-        </param>
+
+        <section name="inps" title="Inputs" expanded="false">
+        
+            <!-- CPT inp -->
+            <!-- <conditional name="cpt_inp">
+                <param name="cpt_bool" type="select" label="Use a checkpoint (CPT) file" help="CPT file from a previous MD run">
+                    <option value="yes">Continue simulation from a CPT file</option>
+                    <option value="no" selected="true">No CPT input</option>
+                </param>
+                <when value="yes">
+                    <param argument="cpt_in" type="data" format='cpt' label="Checkpoint file"/>
+                </when>
+                <when value="no"/>
+            </conditional> -->
+            
+            <param argument="cpt_in" type="data" format='cpt' label="Checkpoint (CPT) file" optional="true" help="CPT file from a previous MD run. Leave empty if no checkpoint should be used."/>
 
-        <conditional name="posres">
-            <param name="posres_bool" type="select" label="Apply position restraints" help="Used e.g. for equilibration of solvent around a protein" value="false">
-                <option value="true">Apply position restraints</option>
-                <option value="false" selected="true">No position restraints</option>
+            <!-- ITP inp -->
+            <!-- <conditional name="posres">
+                <param name="posres_bool" type="select" label="Apply position restraints" help="Used e.g. for equilibration of solvent around a protein" value="false">
+                    <option value="true">Apply position restraints</option>
+                    <option value="false" selected="true">No position restraints</option>
+                </param>
+                <when value="true">
+                    <param argument="itp_in" type="data" format='itp' label="Position restraint (ITP) file"/>
+                </when>
+                <when value="false"/>
+            </conditional> -->
+
+            <param argument="itp_in" type="data" format='itp' label="Position restraint (ITP) file" optional="true" help="Apply position restraints using a ITP file. Leave empty if no position restraints should be used."/>
+
+            <!-- NDX inp -->
+            <!-- <conditional name="ndx_inp">
+                <param name="ndx_bool" type="select" label="Use a custom index (ndx) file" help="Use an index file specifying custom atom groups.">
+                    <option value="true">Use custom index file</option>
+                    <option value="false" selected="true">Use default generated group</option>
+                </param>
+                <when value="true">
+                    <param argument="ndx_in" type="data" format='ndx' label="Index file"/>
+                </when>
+                <when value="false"/>
+            </conditional> -->
+
+            <param argument="ndx_in" type="data" format='ndx' label="Index (ndx) file" optional="true" help="Use an index file specifying custom atom groups. Leave empty to use default generated group"/>
+
+        </section>
+
+        <section name="outps" title="Outputs" expanded="false">
+            <!-- TRAJ out -->
+            <param argument="traj" type="select" label="Trajectory output">
+                <option value='none'>Return no trajectory output</option>
+                <option value='xtc'>Return .xtc file (reduced precision)</option>
+                <option value='trr'>Return .trr file (full precision)</option>
+                <option value='both'>Return both .xtc and .trr files</option>
             </param>
-            <when value="true">
-                <param argument="itp_inp" type="data" format='itp' label="Position restraint (ITP) file"/>
-            </when>
-            <when value="false"/>
-        </conditional>
 
-        <conditional name="ndx_inp">
-            <param name="ndx_bool" type="select" label="Use a custom index (ndx) file" help="Use an index file specifying custom atom groups.">
-                <option value="yes">Use custom index file</option>
-                <option value="no" selected="true">Use default generated group</option>
+            <!-- STR out -->
+            <param argument="str" type="select" label="Structure output">
+                <option value='none'>Return no structure output</option>
+                <option value='gro'>Return .gro file</option>
+                <option value='pdb'>Return .pdb file</option>
+                <option value='both'>Return both .gro and .pdb files</option>
+            </param>
+            
+            <!-- CPT out -->
+            <param name="cpt_out" type="select" label="Produce a checkpoint (CPT) file" help="Produce CPT file for a subsequent MD run">
+                <option value="true">Produce CPT output</option>
+                <option value="false" selected="true">No CPT output</option>
+            </param>
+
+            <!-- EDR out -->
+            <param name="edr_out" type="select" label="Produce an energy (EDR) file" help="Produce file containing energies associated with the simulation">
+                <option value="true">Produce EDR output</option>
+                <option value="false" selected="true">No EDR output</option>
             </param>
-            <when value="yes">
-                <param argument="ndx_in" type="data" format='txt' label="Index file"/>
-            </when>
-            <when value="no"/>
-        </conditional>
 
+            <!-- XVG out -->
+            <param name="xvg_out" type="select" label="Produce XVG output" help="Produce tabular XVG file (e.g. forces from pulling simulations)" >
+                <option value="true">Produce XVG output</option>
+                <option value="false" selected="true">No XVG output</option>
+            </param>
+        
+        </section>
 
-        <param name="ensemble" label="Ensemble" type="select" help="NVT ensemble (constant number of particles, volume and temperature) or NPT ensemble (constant number of particles, pressure and temperature)">
-            <option value="nvt">Isothermal-isochoric ensemble (NVT)</option>
-            <option value="npt">Isothermal-isobaric ensemble (NPT)</option>
-        </param>
+        <section name="sets" title="Settings" expanded="false">
+            <!-- other ... -->
+            <param name="ensemble" label="Ensemble" type="select" help="NVT ensemble (constant number of particles, volume and temperature) or NPT ensemble (constant number of particles, pressure and temperature)">
+                <option value="nvt">Isothermal-isochoric ensemble (NVT)</option>
+                <option value="npt">Isothermal-isobaric ensemble (NPT)</option>
+            </param>
 
-        <expand macro="md_inputs"/>
+            <expand macro="md_inputs"/>
+        </section>
+
+        <expand macro="log" />
+
     </inputs>
     <outputs>
         <data name="output1" format="gro" from_work_dir="outp.gro">
-            <filter>str == 'gro' or str == 'both'</filter>
+            <filter>outps.str == 'gro' or outps.str == 'both'</filter>
         </data>
         <data name="output2" format="pdb" from_work_dir="outp.pdb">
-            <filter>str == 'pdb' or str == 'both'</filter>
+            <filter>outps.str == 'pdb' or outps.str == 'both'</filter>
         </data>
         <data name="output3" format="trr" from_work_dir="outp.trr">
-            <filter>traj == 'trr' or traj == 'both'</filter>
+            <filter>outps.traj == 'trr' or outps.traj == 'both'</filter>
         </data>
         <data name="output4" format="xtc" from_work_dir="outp.xtc">
-            <filter>traj == 'xtc' or traj == 'both'</filter>
+            <filter>outps.traj == 'xtc' or outps.traj == 'both'</filter>
         </data>
         <data name="output5" format="cpt" from_work_dir="outp.cpt">
-            <filter>cpt_out</filter>
+            <filter>outps.cpt_out == 'true'</filter>
+        </data>
+        <data name="output6" format="edr" from_work_dir="outp.edr">
+            <filter>outps.edr_out == 'true'</filter>
         </data>
+        <collection name="output7" type="list">
+            <discover_datasets pattern="(?P&lt;designation&gt;.*)\.xvg" visible="true" directory="." />
+            <filter>outps.xvg_out == 'true'</filter>
+        </collection>
 
-        <data name="report" format="txt" from_work_dir="verbose.txt">
-            <filter>capture_log</filter>
-        </data>
+        <expand macro="log_outputs" />
     </outputs>
 
     <tests>
         <test>
             <param name="gro_input" value="npt.gro" />
             <param name="top_input" value="topol_solv.top" />
-            <param name="cpt_bool" value="yes" />
+            <!-- <param name="cpt_bool" value="yes" /> -->
             <param name="cpt_in" value="npt.cpt" />
             <param name="mdpfile" value="custom" />
             <param name="mdp_input" value="md.mdp" />
-            <param name="ndx_bool" value="no" />
+            <!-- <param name="ndx_bool" value="false" /> -->
             <param name="traj" value="trr"/>
             <param name="str" value="gro"/>
             <param name="ensemble" value="npt" />
-            <param name="posres_bool" value="false" />
+            <!-- <param name="posres_bool" value="false" /> -->
             <output name="output1" file="md_0_1.gro" ftype="gro" compare="sim_size"/>
             <output name="output3" file="md_0_1.trr" ftype="trr" compare="sim_size"/>
+            <!-- <output name="output1" ftype="gro">
+                <assert_contents>
+                    <has_size value="2647999" />
+                </assert_contents>
+            </output>
+            <output name="output3" ftype="trr">
+                <assert_contents>
+                    <has_size value="10132584" />
+                </assert_contents>
+            </output> -->
         </test>
 
         <test>
             <param name="gro_input" value="npt.gro" />
             <param name="top_input" value="topol_solv.top" />
-            <param name="cpt_bool" value="yes" />
+            <!-- <param name="cpt_bool" value="yes" /> -->
             <param name="cpt_in" value="npt.cpt" />
-            <param name="ndx_bool" value="no" />
+            <!-- <param name="ndx_bool" value="false" /> -->
             <param name="traj" value="trr"/>
             <param name="str" value="both"/>
             <expand macro="test_params"/>
             <param name="ensemble" value="npt" />
-            <param name="posres_bool" value="false" />
+            <!-- <param name="posres_bool" value="false" /> -->
             <output name="output1" file="md_0_1.gro" ftype="gro" compare="sim_size"/>
             <output name="output2" file="md_0_1.pdb" ftype="pdb" compare="sim_size"/>
             <output name="output3" file="md_0_1.trr" ftype="trr" compare="sim_size"/>
@@ -222,15 +292,15 @@
         <test>
             <param name="gro_input" value="npt.gro" />
             <param name="top_input" value="topol_solv.top" />
-            <param name="cpt_bool" value="yes" />
+            <!-- <param name="cpt_bool" value="yes" /> -->
             <param name="cpt_in" value="npt.cpt" />
-            <param name="ndx_bool" value="yes" />
+            <!-- <param name="ndx_bool" value="true" /> -->
             <param name="ndx_in" value="index.ndx" />
             <param name="traj" value="trr"/>
             <param name="str" value="both"/>
             <expand macro="test_params"/>
             <param name="ensemble" value="npt" />
-            <param name="posres_bool" value="false" />
+            <!-- <param name="posres_bool" value="false" /> -->
             <output name="output1" file="md_0_1.gro" ftype="gro" compare="sim_size"/>
             <output name="output2" file="md_0_1.pdb" ftype="pdb" compare="sim_size"/>
             <output name="output3" file="md_0_1.trr" ftype="trr" compare="sim_size"/>
@@ -239,11 +309,11 @@
         <test>
             <param name="gro_input" value="em.gro" />
             <param name="top_input" value="topol_solv.top" />
-            <param name="posres_bool" value="true" />
-            <param name="itp_inp" value="posres.itp" />
-            <param name="cpt_bool" value="no" />
+            <!-- <param name="posres_bool" value="true" /> -->
+            <param name="itp_in" value="posres.itp" />
+            <!-- <param name="cpt_bool" value="no" /> -->
             <param name="cpt_out" value="true" />
-            <param name="ndx_bool" value="no" />
+            <!-- <param name="ndx_bool" value="false" /> -->
             <param name="traj" value="xtc"/>
             <param name="str" value="pdb"/>
             <param name="ensemble" value="nvt" />