view recetox_aplcms_align_features.xml @ 6:c464931ca425 draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/recetox_aplcms commit 505c3374a3e1e9aa450fcb752f2b8f87558fedbb
author recetox
date Thu, 25 May 2023 09:14:53 +0000
parents c44c73efd6e5
children 2d13fcae8b84
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 "cluster <- \${GALAXY_SLOTS:-1}" -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]

             aligned_features <- create_aligned_feature_table(
                  features_table = dplyr::bind_rows(feature_tables),
                  min_occurrence = $min_occurrence,
                  sample_names = sample_names,
                  mz_tol_relative = $mz_tol_relative_ppm * 1e-06,
                  rt_tol_relative = $rt_tol,
                  cluster = cluster
             )

             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." />
        <expand macro="tolerances"/>
        <param name="min_occurrence" type="integer" min="2" value="2" label="Minimal occurrence in samples"
               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>