view recetox_aplcms_extract_features.xml @ 0:d78dc8992e5a 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:17:01 +0000
parents
children
line wrap: on
line source

<tool id="recetox_aplcms_extract_features" name="RECETOX apLCMS - extract features" version="@TOOL_VERSION@+galaxy0">
    <description>extract features from LC/MS spectra</description>
    <macros>
        <import>macros.xml</import>
        <import>macros_split.xml</import>
    </macros>
    <expand macro="creator"/>

    <expand macro="requirements"/>
    <command detect_errors="aggressive"><![CDATA[
        Rscript -e 'source("${__tool_directory__}/utils.R")' -e 'source("${run_script}")'
    ]]></command>
    <configfiles>
        <configfile name="run_script"><![CDATA[
            profile <- proc.cdf(
                filename = "$file",
                min.pres = $noise_filtering.min_pres,
                min.run = $noise_filtering.min_run,
                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,
                do.plot = FALSE,
                cache = FALSE
            )

            features <- prof.to.features(
                a = profile,
                min.bw = $feature_detection.min_bandwidth,
                max.bw = $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),
                shape.model = '$feature_detection.shape_model',
                estim.method = '$feature_detection.peak_estim_method',
                component.eliminate = $feature_detection.component_eliminate,
                power = $feature_detection.moment_power,
                BIC.factor = $feature_detection.BIC_factor,
                do.plot = FALSE
            )

            df <- as.data.frame(features)
            arrow::write_parquet(df, "$feature_sample_table")
        ]]></configfile>
    </configfiles>

    <inputs>
        <param name="file" type="data" format="mzdata,mzml,mzxml,netcdf" label="Input file"
               help="Mass spectrometry file for peak extraction." />
        <expand macro="noise_filtering_split"/>
        <expand macro="feature_detection"/>
    </inputs>

    <outputs>
        <data name="feature_sample_table" format="parquet" label="${tool.name} on ${on_string}" />
    </outputs>

    <tests>
        <test>
            <param name="file" value="mbr_test0.mzml" ftype="mzml"/>
            <output name="feature_sample_table" file="extracted_expected/extracted_0.parquet" ftype="parquet"/>
        </test>
        <test>
            <param name="file" value="mbr_test1.mzml" ftype="mzml"/>
            <output name="feature_sample_table" file="extracted_expected/extracted_1.parquet" ftype="parquet"/>
        </test>
        <test>
            <param name="file" value="mbr_test2.mzml" ftype="mzml"/>
            <output name="feature_sample_table" file="extracted_expected/extracted_2.parquet" ftype="parquet"/>
        </test>
    </tests>

    <help>
        <![CDATA[
            This is a tool which runs apLCMS features extraction.

            @GENERAL_HELP@
        ]]>
    </help>

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