view recetox_aplcms_hybrid.xml @ 2:acd25e4fda77 draft default tip

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/recetox_aplcms commit 19de0924a65bc65cbbf7c1fc17e9b5348305f95c
author recetox
date Fri, 10 Jun 2022 10:15:14 +0000
parents 867c737a7f10
children
line wrap: on
line source

<tool id="recetox_aplcms_hybrid" name="RECETOX apLCMS Hybrid" version="@TOOL_VERSION@+galaxy3">
    <description>generate a feature table from LC/MS spectra</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="creator"/>

    <expand macro="requirements"/>
    <command detect_errors="aggressive"><![CDATA[
        sh ${symlink_inputs} &&
        Rscript  -e 'source("${__tool_directory__}/main.R")' -e 'source("${run_script}")'
    ]]></command>
    <configfiles>
        <configfile name="symlink_inputs">
            #for $infile in $files
                ln -s '${infile}' '${infile.element_identifier}'
            #end for
        </configfile>
        <configfile name="run_script"><![CDATA[
            #set filenames_str = str("', '").join([str($f.element_identifier) for $f in $files])

            hybrid_main(
                sample_files = c('$filenames_str'),
                known_table_file = '${known_table}',
                updated_known_table_file = '${updated_known_table}',
                pairing_file = '${feature_known_table_pairing}',
                aligned_file = '${aligned_feature_sample_table}',
                recovered_file = '${recovered_feature_sample_table}',
                out_format = '$output_format.out_format',
                min_exp = $noise_filtering.min_exp,
                min_pres = $noise_filtering.min_pres,
                min_run = $noise_filtering.min_run,
                mz_tol = $noise_filtering.mz_tol,
                baseline_correct = $noise_filtering.baseline_correct,
                baseline_correct_noise_percentile = $noise_filtering.baseline_correct_noise_percentile,
                intensity_weighted = $noise_filtering.intensity_weighted,
                shape_model = '$feature_detection.shape_model',
                BIC_factor = $feature_detection.BIC_factor,
                peak_estim_method = '$feature_detection.peak_estim_method',
                min_bandwidth = $feature_detection.min_bandwidth,
                max_bandwidth = $feature_detection.max_bandwidth,
                sd_cut = c($feature_detection.sd_cut_min, $feature_detection.sd_cut_max),
                sigma_ratio_lim = c($feature_detection.sigma_ratio_lim_min, $feature_detection.sigma_ratio_lim_max),
                component_eliminate = $feature_detection.component_eliminate,
                moment_power = $feature_detection.moment_power,
                align_chr_tol = $peak_alignment.align_chr_tol,
                align_mz_tol = $peak_alignment.align_mz_tol,
                max_align_mz_diff = $peak_alignment.max_align_mz_diff,
                match_tol_ppm = $history_db.match_tol_ppm,
                new_feature_min_count = $history_db.new_feature_min_count,
                recover_mz_range = $weak_signal_recovery.recover_mz_range,
                recover_chr_range = $weak_signal_recovery.recover_chr_range,
                use_observed_range = $weak_signal_recovery.use_observed_range,
                recover_min_count = $weak_signal_recovery.recover_min_count,
                cluster = as.integer(Sys.getenv('GALAXY_SLOTS', unset = 1))
            )
        ]]></configfile>
    </configfiles>

    <expand macro="inputs">
        <expand macro="history_db"/>
        <expand macro="noise_filtering">
            <param name="min_exp" type="integer" min="1" value="2"
            label="min_exp"
            help="If a feature is to be included in the final feature table, it must be present in at least this number of samples." />
        </expand>
        <expand macro="feature_detection"/>
        <expand macro="peak_alignment"/>
        <expand macro="weak_signal_recovery"/>
        <expand macro="output_format"/>
    </expand>

    <outputs>
        <expand macro="unsupervised_outputs">
            <collection  name="extracted_features" type="list" label="${tool.name} extracted_features on ${on_string}">
                <discover_datasets pattern="__designation__" directory="extracted" format="parquet" />
            </collection >
            <collection  name="corrected_features" type="list" label="${tool.name} corrected_features on ${on_string}">
                <discover_datasets pattern="__designation__" directory="corrected" format="parquet" />
            </collection >
            <data name="updated_known_table" format="parquet" label="${tool.name} updated_known_table on ${on_string}"/>
        </expand>
        <data name="feature_known_table_pairing" format="tabular"
              label="${tool.name} feature_known_table_pairing on ${on_string}" hidden="true"/>
    </outputs>

    <tests>
        <test>
            <param name="known_table" value="known_table.parquet" ftype="parquet"/>
            <param name="files" value="mbr_test0.mzml,mbr_test1.mzml,mbr_test2.mzml" ftype="mzml"/>
            <output name="recovered_feature_sample_table" file="hybrid_recovered_feature_sample_table.parquet"
                    ftype="parquet"/>
        </test>
        <test>
            <param name="known_table" value="known_table.parquet" ftype="parquet"/>
            <param name="files" value="mbr_test0.mzml,mbr_test1.mzml,mbr_test2.mzml" ftype="mzml"/>
            <section name="output_format">
                <param name="out_format" value="recetox"/>
            </section>
            <output name="recovered_feature_sample_table" file="hybrid.recetox.parquet" ftype="parquet"/>
        </test>
    </tests>

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

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