view msmetaenhancer.xml @ 15:560053b805d2 draft default tip

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/msmetaenhancer commit a57d984a9850c1faa44b6948981eb1303881ba9c
author recetox
date Thu, 14 Aug 2025 12:44:57 +0000
parents 646ef66527da
children
line wrap: on
line source

<tool id="msmetaenhancer" name="MSMetaEnhancer" version="@TOOL_VERSION@+galaxy2" profile="23.0">
    <description>collect and convert chemical identifiers in tables or MS libraries</description>

    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="creator"/>
    <xrefs>
        <xref type="bio.tools">msmetaenhancer</xref>
    </xrefs>

    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">msmetaenhancer</requirement>
    </requirements>

    <required_files>
        <include path="msmetaenhancer_wrapper.py"/>
    </required_files>

    <command detect_errors="aggressive"><![CDATA[
        python3 '${__tool_directory__}/msmetaenhancer_wrapper.py'
        --input_file '$input_file'
        #if $input_file.ext == "tabular":
        --file_format 'tsv'
        #else
        --file_format '$input_file.ext'
        #end if
        --output_file '$output_file'
        #if $options.logging.output_log == "TRUE":
        --log_file '$log_file'
        --log_level '$options.logging.log_level'
        #end if
        #if len($ordered_jobs) != 0:
            #set ordered_jobs = ",".join([str($job.ordered_jobs_select) for $job in $ordered_jobs]) + ","
        #else:
            #set ordered_jobs = ""
        #end if
        #if $jobs != 'None':
            #set random_jobs = str($jobs)
        #else:
            #set random_jobs = ""
        #end if
        #set all_jobs = str($ordered_jobs) + str($random_jobs)
        --jobs '$all_jobs'
    ]]> </command>

    <environment_variables>
        <environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable>
        <environment_variable name="XDG_CACHE_HOME">\$_GALAXY_JOB_TMP_DIR</environment_variable>
    </environment_variables>

    <inputs>
        <param label="Input spectra dataset" name="input_file" type="data" format="msp,mgf,json,csv,tabular,xlsx" />

        <repeat name="ordered_jobs" title="Ordered conversions">
            <param name="ordered_jobs_select" type="select" label="Available conversions" multiple="false" optional="true">
                <expand macro="job_options" />
            </param>
        </repeat>

        <param name="jobs" type="select" label="Other conversions" multiple="true" optional="true">
            <expand macro="job_options" />
        </param>

        <section name="options" title="Options">
            <conditional name="logging">
                <param label="Save the log file" name="output_log" type="select" help="Preserve a log with details about the annotation process.">
                    <option value="FALSE" selected="true">FALSE</option>
                    <option value="TRUE">TRUE</option>
                </param>
                <when value="TRUE">
                    <param name="log_level" type="select" label="Log level"
                           help="Severity of log messages  present in the log file.">
                        <option value="error">ERROR</option>
                        <option value="warning">WARNING</option>
                        <option value="info" selected="true">INFO</option>
                    </param>
                </when>
                <when value="FALSE"></when>
            </conditional>
        </section>
    </inputs>

    <outputs>
        <data label="MSMetaEnhancer on ${on_string}" name="output_file" format_source="input_file">
            <change_format>
                <when input="input_file.ext" value="csv" format="tabular" />
                <when input="input_file.ext" value="tsv" format="tabular" />
                <when input="input_file.ext" value="xlsx" format="tabular" />
            </change_format>
        </data>    
        <data label="Log of MSMetaEnhancer on ${on_string}" name="log_file" format="txt">
           <filter>options['logging']['output_log'] == 'TRUE'</filter>
       </data>
    </outputs>

    <tests>
        <test expect_num_outputs="2">
            <param name="input_file" value="sample.msp" ftype="msp" />
            <param name="jobs" value="compound_name inchi PubChem,inchi canonical_smiles PubChem"/>
            <section name="options">
                <conditional name="logging">
                    <param name="output_log" value="TRUE"/>
                </conditional>
            </section>
            <output name="output_file" file="sample_out.msp" ftype="msp"/>
            <output name="log_file" ftype="txt">
                <assert_contents>
                    <has_text text=""/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="input_file" value="msme_sample.tsv" ftype="tsv" />
            <param name="jobs" value="compound_name inchi PubChem,inchi canonical_smiles PubChem"/>
            <output name="output_file" file="msme_sample_out.tabular" ftype="tabular"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input_file" value="msme_sample.tsv" ftype="tabular" />
            <param name="jobs" value="compound_name inchi PubChem,inchi canonical_smiles PubChem"/>
            <output name="output_file" file="msme_sample_out.tabular" ftype="tabular"/>
        </test>
    </tests>

    <help>
        <![CDATA[
        @HELP@
        ]]>
    </help>

    <citations>
        <citation type="doi">https://doi.org/10.21105/joss.04494</citation>
    </citations>

</tool>