view docking.xml @ 9:90ea16534012 draft default tip

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/autodock_vina commit 8ae58ec16b3b6d62b47022745211f11181ad78ea"
author bgruening
date Tue, 21 Dec 2021 14:18:33 +0000
parents 7a871df65202
children
line wrap: on
line source

<tool id="docking" name="VINA Docking" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@">
    <description>tool to perform protein-ligand docking with Autodock Vina</description>
    <macros>
        <token name="@TOOL_VERSION@">1.2.3</token>
        <token name="@GALAXY_VERSION@">0</token>
    </macros>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">vina</requirement>
        <requirement type="package" version="3.9">python</requirement>
        <requirement type="package" version="3.1.1">openbabel</requirement>
        <requirement type="package" version="20211022">parallel</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        #if $ligands.is_of_type("sdf")
            obabel -isdf '$ligands' -O ligand.pdbqt -m -p $ph_value &&
        #else
            ln -s '$ligands' ligand1.pdbqt &&
        #end if
        mkdir output &&
        ls ligand*.pdbqt | parallel --will-cite -j \${GALAXY_SLOTS:-1} $'OUTNAME={.}_docked && vina
            --receptor \'$receptor\'
            #if $flex:
                --flex \'$flex\'
            #end if
            --ligand {}
            --out ./\${OUTNAME}.pdbqt
            --cpu 1
            --verbosity 2
        #if $config_params.config_params == "vals":
                --center_x $config_params.center_x
                --center_y $config_params.center_y
                --center_z $config_params.center_z
                --size_x $config_params.size_x
                --size_y $config_params.size_y
                --size_z $config_params.size_z
                #if $config_params.exh != "":
                    --exhaustiveness $config_params.exh
                #end if
                #if $config_params.seed.seed == "true":
                    --seed $config_params.seed.seed_value
                #end if
        #else if $config_params.config_params == "file":
             --config $config_params.box
             #if $config_params.exh != "":
                 --exhaustiveness $config_params.exh
             #end if
        #end if
        #if $settings.scoring:
            --scoring \'$settings.scoring\'
        #end if
        #if $settings.num_modes:
            --num_modes \'$settings.num_modes\'
        #end if
        #if $settings.min_rmsd:
            --min_rmsd \'$settings.min_rmsd\'
        #end if
        #if $settings.energy_range:
            --energy_range \'$settings.energy_range\'
        #end if
        #if $output == "sdf":
            && python \'$__tool_directory__/convert_pdbqt_to_sdf.py\' ./\${OUTNAME}.pdbqt output/\${OUTNAME}.sdf
        #end if
        '
        #if $output == "pdbqt":
            && mv *docked.pdbqt output/
        #end if
    ]]></command>
    <inputs>
        <param type="data" name="receptor" format="pdbqt" label="Receptor" help="Select a receptor (PDBQT format). This can be prepared using the receptor preparation tool. If the 'Flexible side chains' option is chosen, it should contain only the rigid part of the receptor." />
        <param type="data" name="ligands" format="sdf,pdbqt"  label="Ligands" help="Select ligands (SDF format with multiple ligands or PDBQT format with single ligand)." />
        <param type="data" name="flex" format="pdbqt" optional="true" label="Flexible side chains" help="Part of the receptor which should be treated flexibly (PDBQT format)." />
        <param name="ph_value" type="float" value="7.4" min="0" max="14" label="Specify pH value for ligand protonation"
            help="Only used if the input is a SD file."/>
        <conditional name="config_params">
            <param name="config_params" type="select" label="Specify parameters">
                <option value="file">Upload a config file to specify parameters</option>
                <option value="vals">Specify values directly</option>
            </param>
            <when value="vals">
                <param type="float" name="center_x" label="x coordinate" help="x coordinate of the binding site." value="0"/>
                <param type="float" name="center_y" label="y coordinate" help="y coordinate of the binding site." value="0"/>
                <param type="float" name="center_z" label="z coordinate" help="z coordinate of the binding site." value="0"/>
                <param type="float" name="size_x" label="x size" help="Length of the binding site (Å) in the x direction." value="0"/>
                <param type="float" name="size_y" label="y size" help="Length of the binding site (Å) in the y direction." value="0"/>
                <param type="float" name="size_z" label="z size" help="Length of the binding site (Å) in the z direction." value="0"/>
                <param type="integer" name="exh" label="Exhaustiveness" optional="true"
                       help="Exhaustiveness of global search (optional - if not specified a default of 8 is used)"/>
                <conditional name="seed">
                    <param name="seed" type="boolean" label="Specify random seed for simulation reproducibility?"/>
                    <when value="true">
                        <param type="integer" name="seed_value" label="Random seed" help="Choose a seed value" value="1"/>
                    </when>
                    <when value="false"/>
                </conditional>
            </when>
            <when value="file">
                <param type="data" name="box" format="txt" label="Box configuration" help="Text file with the box configurations" />
                <param type="integer" name="exh" label="Exhaustiveness" optional="true"
                       help="Exhaustiveness of global search (optional - if not specified a default of 8 is used, if specified will override any value specified in the config file)"/>
            </when>
        </conditional>

        <section name="settings" title="Optional settings" expanded="true" help="All these settings can also be specified in the config file. Specifying them additionally here overrides the config file.">
            <param type="select" name="scoring" label="Scoring function" optional="true" help="Function to use for scoring the poses." value="vina">
                <option value="vina">vina</option>
                <option value="ad4">ad4</option>
                <option value="vinardo">vinardo</option>
            </param>
            <param type="integer" name="num_modes" optional="true" label="Number of poses" help="Maximum number of binding poses to generate (default 9)" />
            <param type="float" name="min_rmsd" optional="true" label="Minimum RMSD between output poses (default 1)" />
            <param type="float" name="energy_range" optional="true" label="Energy range" help="Maximum energy difference between the best binding mode and the worst one displayed (kcal/mol) (default 3)"/>
        </section>
        <param type="select" name="output" label="Output format" help="Format for the docking poses.">
            <option value="sdf" selected="true">SDF</option>
            <option value="pdbqt">PDBQT</option>
        </param>
    </inputs>
    <outputs>
        <collection name="sdf_outputs" type="list" label="Docked ligands for ${on_string}" >
            <discover_datasets pattern="__name_and_ext__" directory="output" visible="false" />
            <filter>output == "sdf"</filter>
        </collection>
        <collection name="pdbqt_outputs" type="list" label="Docked structures for ${on_string}" >
            <discover_datasets pattern="__name_and_ext__" directory="output" visible="false" />
            <filter>output == "pdbqt"</filter>
        </collection>
    </outputs>
    <tests>
        <test>
            <param name="receptor" value="protein.pdbqt"/>
            <param name="ligands" value="input_ligands.sdf"/>
            <param name="box" value="box.txt"/>
            <output_collection name="sdf_outputs" type="list" count="5">
                <!-- linesdiff because there is a time stamp for each of the 9 poses -->
                <element name="ligand1_docked" file="ligand1_docked.sdf" lines_diff="18"/>
                <element name="ligand2_docked" file="ligand2_docked.sdf" lines_diff="18"/>
                <!-- we check only the first 2 -->
            </output_collection>
        </test>

        <test>
            <param name="receptor" value="protein.pdbqt"/>
            <param name="ligands" value="input_ligand.pdbqt"/>
            <param name="box" value="box.txt"/>
            <output_collection name="sdf_outputs" type="list" count="1">
                <element name="ligand1_docked" file="ligand_docked.sdf" lines_diff="18"/>
            </output_collection>
        </test>

        <!-- test with optional params -->
        <test>
            <param name="receptor" value="protein.pdbqt"/>
            <param name="ligands" value="input_ligand.pdbqt"/>
            <param name="box" value="box.txt"/>
            <param name="scoring" value="vinardo"/>
            <param name="energy_range" value="5"/>
            <param name="num_modes" value="20"/>
            <param name="min_rmsd" value="0.5"/>
            <output_collection name="sdf_outputs" type="list" count="1">
                <element name="ligand1_docked" file="ligand_docked_opt.sdf" lines_diff="40"/>
            </output_collection>
        </test>

        <!-- TODO - this should be able to use the same output as the previous test but there is inconsistency in
        how the parameters are handled that needs to be resolved so we use a different output file to compare to. -->
        <test>
            <param name="receptor" value="protein.pdbqt"/>
            <param name="ligands" value="input_ligand.pdbqt"/>
            <param name="config_params" value="vals"/>
            <param name="center_x" value="36.454" />
            <param name="center_y" value="-43.608000000000004" />
            <param name="center_z" value="75.176" />
            <param name="size_x" value="18.768"  />
            <param name="size_y" value="10.205999999999996" />
            <param name="size_z" value="15.521999999999991" />
            <param name="seed" value="true" />
            <param name="seed_value" value="8" />
            <param name="exh" value="10" />
            <output_collection name="sdf_outputs" type="list" count="1">
                <element name="ligand1_docked" file="ligand_params.sdf" lines_diff="18"/>
            </output_collection>
        </test>

        <!-- flexible docking -->
        <test>
            <param name="receptor" value="protein_rigid.pdbqt"/>
            <param name="flex" value="protein_flex.pdbqt"/>
            <param name="ligands" value="input_ligands.sdf"/>
            <param name="config_params" value="vals"/>
            <param name="center_x" value="15.2" />
            <param name="center_y" value="53.9" />
            <param name="center_z" value="16.9" />
            <param name="size_x" value="20"  />
            <param name="size_y" value="20" />
            <param name="size_z" value="20" />
            <param name="seed" value="true" />
            <param name="seed_value" value="8" />
            <param name="exh" value="10" />
            <param name="output" value="pdbqt"/>
            <output_collection name="pdbqt_outputs" type="list" count="5">
                <element name="ligand1_docked" file="ligand1_docked_flex.pdbqt"/>
                <element name="ligand2_docked" file="ligand2_docked_flex.pdbqt"/>
                <!-- we check only the first 2 -->
            </output_collection>
        </test>
    </tests>
    <help><![CDATA[

This tool performs protein-ligand docking using the Autodock Vina program.

-----

.. class:: infomark

**Inputs**

The first two inputs required are files describing the receptor (in the pdbqt format) and ligands (in SDF of PDBQT format) respectively.
These files are produced by the receptor and ligand preparation tools.
If using PDBQT format for the ligands only a single ligand can be specified. If using SDF you can include multiple ligands
and those ligands are converted to individual PDBQT format files using openbabel as the first step of tool execution.
You can specify the pH for protonation by openbabel

VINA will dock each of the ligands in the SDF file sequentially. If there are a large number of ligands then first split
them into a collection of smaller files e.g. using the splitter tool. This allows each split chunk of molecules to be docked
as a separate task. The optimal size of the chunk will depend on the number of ligands and the capacity of the execution
environment.

In addition, parameters for docking must be defined. The Cartesian coordinates of the center of the binding site should
be provided, along with the size of the binding site along each dimension. Effectively, this defines a cuboidal volume in
which docking is performed. Alternatively, a config file can be uploaded containing this information - such a file can be
generated from the box parameter calculation file.


-----

.. class:: infomark

**Outputs**

SDF files are produced as output.
There is one file for each ligand in the input. Each entry in the file is a docked pose for that ligand.
The binding affinity scores are contained within the SDF file.::

    OpenBabel06171915303D

    23 23  0  0  0  0  0  0  0  0999 V2000
    66.9030   73.3450   36.0040 O   0  0  0  0  0  0  0  0  0  0  0  0
    66.8190   73.2170   37.2120 C   0  0  0  0  0  0  0  0  0  0  0  0
    66.0490   72.3370   37.8940 O   0  0  0  0  0  0  0  0  0  0  0  0
    66.2290   70.9500   37.5970 C   0  0  0  0  0  0  0  0  0  0  0  0
    67.2070   70.4140   38.6010 C   0  0  0  0  0  0  0  0  0  0  0  0
    68.5140   70.1440   38.3980 C   0  0  0  0  0  0  0  0  0  0  0  0
    69.2150   70.3400   37.0800 C   0  0  0  0  0  0  0  0  0  0  0  0
    69.3810   69.5970   39.5210 C   0  0  0  0  0  0  0  0  0  0  0  0
    68.7730   69.8280   40.9100 C   0  0  0  0  0  0  0  0  0  0  0  0
    69.3750   71.0120   41.6220 C   0  0  0  0  0  0  0  0  0  0  0  0
    68.7550   72.1570   41.9760 C   0  0  0  0  0  0  0  0  0  0  0  0
    67.3280   72.4970   41.6430 C   0  0  0  0  0  0  0  0  0  0  0  0
    69.4770   73.2270   42.7560 C   0  0  0  0  0  0  0  0  0  0  0  0
    67.5570   74.0540   38.1920 C   0  0  0  0  0  0  0  0  0  0  0  0
    66.9010   75.0480   38.9340 C   0  0  0  0  0  0  0  0  0  0  0  0
    67.6300   75.8170   39.8300 C   0  0  0  0  0  0  0  0  0  0  0  0
    68.9950   75.5990   39.9980 C   0  0  0  0  0  0  0  0  0  0  0  0
    69.6510   74.6060   39.2850 C   0  0  0  0  0  0  0  0  0  0  0  0
    68.9300   73.8240   38.3800 C   0  0  0  0  0  0  0  0  0  0  0  0
    67.0450   76.8040   40.5760 O   0  0  0  0  0  0  0  0  0  0  0  0
    67.5560   77.4980   40.9760 H   0  0  0  0  0  0  0  0  0  0  0  0
    69.7010   76.3670   40.8780 O   0  0  0  0  0  0  0  0  0  0  0  0
    69.2520   76.7930   41.5990 H   0  0  0  0  0  0  0  0  0  0  0  0
    1  2  2  0  0  0  0
    2  3  1  0  0  0  0
    2 14  1  0  0  0  0
    4  3  1  0  0  0  0
    4  5  1  0  0  0  0
    6  5  2  0  0  0  0
    6  8  1  0  0  0  0
    7  6  1  0  0  0  0
    8  9  1  0  0  0  0
    9 10  1  0  0  0  0
    10 11  2  0  0  0  0
    11 13  1  0  0  0  0
    12 11  1  0  0  0  0
    14 19  2  0  0  0  0
    14 15  1  0  0  0  0
    15 16  2  0  0  0  0
    16 17  1  0  0  0  0
    16 20  1  0  0  0  0
    17 22  1  0  0  0  0
    18 17  2  0  0  0  0
    19 18  1  0  0  0  0
    20 21  1  0  0  0  0
    22 23  1  0  0  0  0
    M  END
    >  <MODEL>
    1

    >  <REMARK>
    VINA RESULT:       0.0      0.000      0.000
    9 active torsions:
    status: ('A' for Active; 'I' for Inactive)
        1  A    between atoms: C_2  and  O_3 
        2  A    between atoms: C_2  and  C_14 
        3  A    between atoms: O_3  and  C_4 
        4  A    between atoms: C_4  and  C_5 
        5  A    between atoms: C_6  and  C_8 
        6  A    between atoms: C_8  and  C_9 
        7  A    between atoms: C_9  and  C_10 
        8  A    between atoms: C_16  and  O_17 
        9  A    between atoms: C_19  and  O_20 

    >  <TORSDO>
    F 9

    >  <SCORE>
    0.0

    >  <RMSD_LB>
    0.000

    >  <RMSD_UB>
    0.000

    ]]></help>
    <citations>
        <citation type="doi">10.1002/jcc.21334</citation>
        <citation type="doi">10.1021/acs.jcim.1c00203</citation>
    </citations>
</tool>