view ramclustr.xml @ 3:2ec9253a647e draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ramclustr commit 8714723083359049eb1a715a946851e07f8a3a20
author recetox
date Tue, 20 Sep 2022 14:43:56 +0000
parents 75dafb766417
children 050cfef6ba65
line wrap: on
line source

<tool id="ramclustr" name="RAMClustR" version="@TOOL_VERSION@+galaxy2">
    <description>A feature clustering algorithm for non-targeted mass spectrometric metabolomics data.</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="creator"/>

    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">r-ramclustr</requirement>
        <requirement type="package" version="3.14.0">bioconductor-xcms</requirement>
    </requirements>

    <command detect_errors="aggressive"><![CDATA[
        Rscript
            -e 'source("${__tool_directory__}/ramclustr_wrapper.R")'
            -e 'source("${ramclustr_method}")'
    ]]>
    </command>
    <configfiles>
        <configfile name="ramclustr_method">
            store_output(
                #if $filetype.type_choice == "xcms":
                ramclustr_xcms(
                    input_xcms = "$filetype.xcms.input_xcms",
                    use_pheno = $filetype.xcms.usePheno,
                #else:
                ramclustr_csv(
                    ms = "$filetype.ms_csv.ms",
                    idmsms = "$filetype.ms_csv.idmsms",
                #end if
                    sr = $filetype.required.sr,
                    #if $filetype.type_choice == "xcms":
                        #if $filetype.required.st
                            st = $filetype.required.st,
                        #end if
                    #else:
                        st = $filetype.required.st,
                    #end if
                    cor_method = "$filetype.required.cor_method",
                    maxt = $filetype.required.maxt,
                    linkage = "$clustering.linkage",
                    min_module_size = $clustering.minModuleSize,
                    hmax = $clustering.hmax,
                    deep_split = "$clustering.deepSplit",
                    normalize = "$normalisation.normalisation_method.normalize",
                    #if "$normalisation.normalisation_method.normalize" == "batch.qc":
                        metadata_file = "$normalisation.normalisation_method.batch_order_qc",
                        qc_inj_range = $normalisation.normalisation_method.qc_inj_range,
                    #end if
                    block_size = $performance.blocksize,
                    mult = $performance.mult,
                    mzdec = $msp_output_details.mzdec,
                    rt_only_low_n = $extras.rt_only_low_n,
                    replace_zeros = $extras.replace_zeros,
                    #if $extras.ExpDes:
                        exp_design = "${$extras.ExpDes}"
                    #end if
                ),
                $msp_output_details.merge_msp,
                "$spec_abundance",
            #if $msp_output_details.merge_msp:
                "$mass_spectra_merged"
            #else:
                NULL
            #end if
                )
        </configfile>
    </configfiles>
    <inputs>
        <conditional name="filetype">
            <param name="type_choice" type="select" label="Choose input format:">
                <option value="xcms" selected="true">XCMS</option>
                <option value="csv">CSV</option>
            </param>
            <when value="xcms">
                <expand macro="parameters_xcms" />
                <section name="required" title="General parameters" expanded="true">
                    <param label="Sigma t" name="st" type="float" optional="true" help="Retention time similarity (optional).
                           A recommended starting point is half the value of your average chromatographic peak width at half max (seconds))."/>
                    <expand macro="parameters_required" />
                </section>
            </when>
            <when value="csv">
                <expand macro="parameters_csv" />
                <section name="required" title="General parameters" expanded="true">
                    <param label="Sigma t" name="st" type="float" value="1" help="Retention time similarity.
                           A recommended starting point is half the value of your average chromatographic peak width at half max (seconds))."/>
                    <expand macro="parameters_required" />
                </section>
            </when>
        </conditional>
        <expand macro="main_parameters" />
    </inputs>

    <outputs>
        <data label="Spec Abundance of ${on_string}" name="spec_abundance" format="csv" />
        <expand macro="output_msp"/>
    </outputs>

    <tests>
        <test><!-- TEST 1 -->
            <section name="filetype">
                <param name="type_choice" value="xcms"/>
                <section name="xcms">
                    <param name="input_xcms" value="test1_xcmsObj_1.rdata.xcms.fillpeaks" ftype="rdata.xcms.fillpeaks"/>
                </section>
                <section name="required">
                    <param name="maxt" value="259.8"/>
                </section>
            </section>
            <section name="extras">
                <param name="ExpDes" value="lc-ramclustr-define-experiment.csv" ftype="csv"/>
            </section>
            <output name="mass_spectra_merged" file="test1_fill_xcms_1.msp" ftype="msp"/>
            <output name="spec_abundance" file="test1_spec_abundance_xcms_1.csv" ftype="csv" compare="sim_size" delta="100"/>
        </test>
        <test><!-- TEST 2 -->
            <section name="filetype">
                <param name="type_choice" value="xcms"/>
                <section name="xcms">
                    <param name="input_xcms" value="test2_xcmsObj_2.rdata.xcms.fillpeaks" ftype="rdata.xcms.fillpeaks"/>
                </section>
                <section name="required">
                    <param name="maxt" value="78.4"/>
                </section>
            </section>
            <section name="normalisation">
                <section name="normalisation_method">
                    <param name="batch_order_qc" value="test2_sample_metadata_xcms_2.csv" ftype="csv" />
                </section>
            </section>
            <output name="mass_spectra_merged" file="test2_fill_xcms_2.msp" ftype="msp" compare="diff" lines_diff="20"/>
            <output name="spec_abundance" file="test2_spec_abundance_xcms_2.csv" ftype="csv" compare="sim_size" delta="100"/>
        </test>
        <test><!-- TEST 3 -->
            <section name="filetype">
                <param name="type_choice" value="csv"/>
                <section name="ms_csv">
                    <param name="ms" value="test3_csv_test-input_1_2.csv" ftype="csv"/>
                </section>
                <section name="required">
                    <param name="st" value="5.0"/>
                    <param name="maxt" value="1"/>
                </section>
            </section>
            <section name="performance">
                <param name="blocksize" value="1000"/>
                <param name="mult" value="1"/>
            </section>
            <output name="mass_spectra_merged" file="test3_spectra_csv_1.msp" ftype="msp"/>
            <output name="spec_abundance" file="test3_spec_abundance_csv_1.csv" ftype="csv"/>
        </test>
        <test><!-- TEST 4 -->
            <section name="filetype">
                <param name="type_choice" value="csv"/>
                <section name="ms_csv">
                    <param name="ms" value="test3_csv_test-input_1_2.csv" ftype="csv"/>
                </section>
            </section>
            <output name="mass_spectra_merged" file="test4_spectra_csv_2.msp" ftype="msp" lines_diff="10"/>
        </test>
    </tests>

    <help>
        <![CDATA[
            @HELP@

        .. rubric:: **Footnotes**
        .. [1] Correlation, Variance and Covariance - `stats::cor <https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/cor>`_
        .. [2] Hierarchical Clustering - `stats::hclust <https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/hclust>`_
        .. [3] Dynamic Dendrogram Pruning Based on Dendrogram Only - `dynamicTreeCut::cutreeDynamicTree <https://www.rdocumentation.org/packages/dynamicTreeCut/versions/1.63-1/topics/cutreeDynamicTree>`_
        ]]>
    </help>

    <expand macro="citations" />
</tool>