view recetox_aplcms_align_features.xml @ 4:a85b9670051c draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/recetox_aplcms commit ce3d81b59ef0895b61fcb1e17fa1553ccb28b077
author recetox
date Wed, 03 May 2023 15:18:57 +0000
parents 1e2a13bcb5a7
children c44c73efd6e5
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]

             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),
                  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." />
        <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="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>