view recetox_aplcms_compute_clusters.xml @ 4:15aae2bfa67d draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/recetox_aplcms commit 775afc79d12e680bb26496a2626d1855db9cddc7
author recetox
date Thu, 25 May 2023 12:08:49 +0000
parents ce00e1d03c31
children 60a09c4fa7a0
line wrap: on
line source

<tool id="recetox_aplcms_compute_clusters" name="recetox-aplcms - compute clusters" version="@TOOL_VERSION@+galaxy1">
    <description>compute clusters of mz and rt across samples and assign cluster IDs to individual features</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]

              clusters <- compute_clusters_simple(
                  feature_tables = feature_tables,
                  sample_names = sample_names,
                  mz_tol_ppm = $mz_tol_relative_ppm,
                  rt_tol = $rt_tol
              )

              save_parquet_collection(clusters, sample_names, "clustered")
         ]]></configfile>
    </configfiles>

    <inputs>
        <param name="files" type="data_collection" collection_type="list" format="parquet" label="Input data"
               help="List of tables containing features." />
        <expand macro="tolerances"/>
    </inputs>

    <outputs>
        <collection name="clustered_feature_tables" type="list"
                    label="${tool.name} feature_tables on ${on_string}">
            <discover_datasets pattern="__designation__" directory="clustered" format="parquet" />
        </collection>
    </outputs>

    <tests>

    </tests>

    <help>
        <![CDATA[
            @COMPUTE_CLUSTERS_HELP@

            @GENERAL_HELP@
        ]]>
    </help>

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