view recetox_aplcms_align_features.xml @ 2:abe783e0daca draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/recetox_aplcms commit 506df2aef355b3791567283e1a175914f06b405a
author recetox
date Mon, 13 Feb 2023 10:26:59 +0000
parents b07fd3d7ffd0
children 1e2a13bcb5a7
line wrap: on
line source

<tool id="recetox_aplcms_align_features" name="recetox-aplcms - align features" version="@TOOL_VERSION@+galaxy0">
    <description>align peaks across samples</description>
    <macros>
        <import>macros.xml</import>
        <import>help.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[
             #set filenames = str("', '").join([str($f) for $f in $files])
             feature_tables <- load_parquet_collection(c('$filenames'))
             sample_names <- unlist(lapply(feature_tables, load_sample_name))

             validate_sample_names(sample_names)

             ordering <- order(sample_names)
             feature_tables <- feature_tables[ordering]
             sample_names <- sample_names[ordering]

             tolerances <- load_data_from_parquet_file('$input_tolerances')

             aligned_features <- create_aligned_feature_table(
                  features_table = dplyr::bind_rows(feature_tables),
                  min_occurrence = $min_occurrence,
                  sample_names = sample_names,
                  mz_tol_relative = get_mz_tol(tolerances),
                  rt_tol_relative = get_rt_tol(tolerances)
             )

             save_aligned_features(aligned_features, '$metadata_file', '$rt_file', '$intensity_file')
        ]]></configfile>
    </configfiles>

    <inputs>
        <param name="files" type="data_collection" collection_type="list" format="parquet"
               label="Clustered features" help="List of tables containing clustered features." />
        <param label="Input tolerances values" name="input_tolerances" type="data" format="parquet"
               help="Table containing tolerance values." />
        <param name="min_occurrence" type="integer" min="2" value="2" label="min_occurrence"
               help="A feature has to show up in at least this number of profiles to be included in the final result." />
    </inputs>

    <outputs>
        <data name="metadata_file" format="parquet" label="${tool.name} on ${on_string} (metadata table)"/>
        <data name="rt_file" format="parquet" label="${tool.name} on ${on_string} (rt table)"/>
        <data name="intensity_file" format="parquet" label="${tool.name} on ${on_string} (intensity table)"/>
    </outputs>

    <tests>

    </tests>

    <help>
        <![CDATA[
            @ALIGN_FEATURES_HELP@

            @GENERAL_HELP@
        ]]>
    </help>

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