view xtb_molecular_optimization.xml @ 1:cba7123c2741 draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/xtb commit 070a3fd9e44e71efcf7a4490d91d1cee5a4711ce
author recetox
date Tue, 18 Jun 2024 07:53:15 +0000
parents d5633eaf3552
children 6e1ef071fffc
line wrap: on
line source

<tool id="xtb_molecular_optimization" name="xtb molecular optimization" version="@TOOL_VERSION@+galaxy2" profile="21.09">
    <description>Semiempirical quantum mechanical molecular optimization method</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="creator"/>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">xtb</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        ln -s '${coordinates}' 'mol.${coordinates.ext}' &&
        xtb 'mol.${coordinates.ext}' --opt '${opt_level}' && 

        #if $replace_second_line == "FALSE":
        cp  'xtbopt.${coordinates.ext}' '${output}'
        #end if

        #if $replace_second_line == "TRUE":
        cp  'xtbopt.${coordinates.ext}' '${output}' &&
        awk 'NR==FNR{if(NR==2) line=$0; next} {if(FNR==2) print line; else print $0}' '${coordinates}' '${output}' > final &&
        mv final '${output}'
        #end if


    ]]></command>
    <inputs>
        <param label="Atomic coordinates file" type="data" name="coordinates" format="xyz" help="Initial atomic coordinates file to be optimized."/>
        <param type="select" label="Optimization Levels" name="opt_level" help="Geometry optimization convergence levels." >
            <option value="crude">crude</option>
            <option value="sloppy">sloppy</option>
            <option value="loose">loose</option>
            <option value="lax">lax</option>
            <option value="normal">normal</option>
            <option value="tight">tight</option>
            <option value="vtight">vtight</option>
            <option value="extreme">extreme</option>
        </param>
        <param type="boolean" name="replace_second_line" label = "Keep molecule name" truevalue="TRUE" falsevalue="FALSE" checked="false" help = "If YES, the molecule name from the coordinates file is preserved, if it exists. Otherwise, the energy, gnorm, and xtb version are printed." />
    </inputs>
    <outputs>
        <data name="output" format_source="coordinates"  />
    </outputs>
    <tests>
        <test>
            <param name="coordinates" value="initial_mol_molname.xyz" ftype="xyz"/>
            <param name="replace_second_line" value="TRUE" />
            <output name="output">
                <assert_contents>
                    <has_text text="Benzophenone"/>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="coordinates" value="initial_mol_molname.xyz" ftype="xyz"/>
            <param name="replace_second_line" value="FALSE" />
            <output name="output">
                <assert_contents>
                    <has_text text="energy"/>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="coordinates" value="initial_mol_no_molname.xyz" ftype="xyz"/>
            <param name="replace_second_line" value="TRUE" />
            <output name="output">
                <assert_contents>
                    <not_has_text text="energy"/>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="coordinates" value="initial_mol_no_molname.xyz" ftype="xyz"/>
            <param name="replace_second_line" value="FALSE" />
            <output name="output">
                <assert_contents>
                    <has_text text="energy"/>
                </assert_contents>
            </output>
        </test>
    </tests> 
    <help>
        <![CDATA[
        @HELP@
        ]]>
    </help>
    <citations>
        <citation type="doi">https://doi.org/10.1002/wcms.1493</citation>
    </citations>
</tool>