view qiime2__feature_table__filter_samples.xml @ 3:4a129fe72b67 draft default tip

planemo upload for repository https://github.com/qiime2/galaxy-tools/tree/main/tools/suite_qiime2__feature_table commit 389df0134cd0763dcf02aac6e623fc15f8861c1e
author q2d2
date Thu, 25 Apr 2024 21:08:41 +0000
parents 540707a41f82
children
line wrap: on
line source

<?xml version='1.0' encoding='utf-8'?>
<!--
Copyright (c) 2024, QIIME 2 development team.

Distributed under the terms of the Modified BSD License. (SPDX: BSD-3-Clause)
-->
<!--
This tool was automatically generated by:
    q2galaxy (version: 2024.2.1)
for:
    qiime2 (version: 2024.2.0)
-->
<tool name="qiime2 feature-table filter-samples" id="qiime2__feature_table__filter_samples" version="2024.2.2+q2galaxy.2024.2.1" profile="22.05" license="BSD-3-Clause">
    <description>Filter samples from table</description>
    <requirements>
        <container type="docker">quay.io/qiime2/amplicon:2024.2</container>
    </requirements>
    <version_command>q2galaxy version feature_table</version_command>
    <command detect_errors="exit_code">q2galaxy run feature_table filter_samples '$inputs'</command>
    <configfiles>
        <inputs name="inputs" data_style="staging_path_and_source_path"/>
    </configfiles>
    <inputs>
        <param name="table" type="data" format="qza" label="table: FeatureTable[Frequency¹ | RelativeFrequency² | PresenceAbsence³ | Composition⁴]" help="[required]  The feature table from which samples should be filtered.">
            <options options_filter_attribute="metadata.semantic_type">
                <filter type="add_value" value="FeatureTable[Composition]"/>
                <filter type="add_value" value="FeatureTable[PresenceAbsence]"/>
                <filter type="add_value" value="FeatureTable[Frequency]"/>
                <filter type="add_value" value="FeatureTable[RelativeFrequency]"/>
            </options>
            <validator type="expression" message="Incompatible type">hasattr(value.metadata, "semantic_type") and value.metadata.semantic_type in ['FeatureTable[Composition]', 'FeatureTable[Frequency]', 'FeatureTable[PresenceAbsence]', 'FeatureTable[RelativeFrequency]']</validator>
        </param>
        <section name="__q2galaxy__GUI__section__extra_opts__" title="Click here for additional options">
            <param name="min_frequency" type="integer" value="0" label="min_frequency: Int" help="[default: 0]  The minimum total frequency that a sample must have to be retained."/>
            <param name="max_frequency" type="integer" optional="true" label="max_frequency: Int" help="[optional]  The maximum total frequency that a sample can have to be retained. If no value is provided this will default to infinity (i.e., no maximum frequency filter will be applied)."/>
            <param name="min_features" type="integer" value="0" label="min_features: Int" help="[default: 0]  The minimum number of features that a sample must have to be retained."/>
            <param name="max_features" type="integer" optional="true" label="max_features: Int" help="[optional]  The maximum number of features that a sample can have to be retained. If no value is provided this will default to infinity (i.e., no maximum feature filter will be applied)."/>
            <repeat name="metadata" help="[optional]  Sample metadata used with `where` parameter when selecting samples to retain, or with `exclude_ids` when selecting samples to discard." title="metadata: Metadata">
                <conditional name="__q2galaxy__GUI__conditional__metadata__">
                    <param name="type" type="select" label="metadata: Metadata">
                        <option value="tsv" selected="true">Metadata from TSV</option>
                        <option value="qza">Metadata from Artifact</option>
                    </param>
                    <when value="tsv">
                        <param name="source" type="data" format="tabular,qiime2.tabular" label="Metadata Source"/>
                    </when>
                    <when value="qza">
                        <param name="source" type="data" format="qza" label="Metadata Source"/>
                    </when>
                </conditional>
            </repeat>
            <conditional name="__q2galaxy__GUI__conditional__where__" label="where: Str">
                <param name="__q2galaxy__GUI__select__" type="select" label="where: Str" help="[optional]  SQLite WHERE clause specifying sample metadata criteria that must be met to be included in the filtered feature table. If not provided, all samples in `metadata` that are also in the feature table will be retained.">
                    <option value="__q2galaxy__::control::default" selected="true">None (Use default behavior)</option>
                    <option value="__q2galaxy__::control::provide">Provide a value</option>
                </param>
                <when value="__q2galaxy__::control::default">
                    <param name="where" type="hidden" value="__q2galaxy__::literal::None"/>
                </when>
                <when value="__q2galaxy__::control::provide">
                    <param name="where" type="text">
                        <sanitizer>
                            <valid initial="string.printable"/>
                        </sanitizer>
                    </param>
                </when>
            </conditional>
            <param name="exclude_ids" type="boolean" truevalue="__q2galaxy__::literal::True" falsevalue="__q2galaxy__::literal::False" label="exclude_ids: Bool" help="[default: No]  If true, the samples selected by `metadata` or `where` parameters will be excluded from the filtered table instead of being retained."/>
            <param name="filter_empty_features" type="boolean" truevalue="__q2galaxy__::literal::True" falsevalue="__q2galaxy__::literal::False" checked="true" label="filter_empty_features: Bool" help="[default: Yes]  If true, features which are not present in any retained samples are dropped."/>
            <param name="allow_empty_table" type="boolean" truevalue="__q2galaxy__::literal::True" falsevalue="__q2galaxy__::literal::False" label="allow_empty_table: Bool" help="[default: No]  If true, the filtered table may be empty. Default behavior is to raise an error if the filtered table is empty."/>
        </section>
    </inputs>
    <outputs>
        <data name="filtered_table" format="qza" label="${tool.name} on ${on_string}: filtered_table.qza" from_work_dir="filtered_table.qza"/>
    </outputs>
    <tests>
        <test>
            <param name="table" value="filter_samples.test0.feature-table.qza" ftype="qza"/>
            <repeat name="metadata">
                <conditional name="__q2galaxy__GUI__conditional__metadata__">
                    <param name="type" value="tsv"/>
                    <param name="source" value="filter_samples.test0.sample-metadata.tsv" ftype="qiime2.tabular"/>
                </conditional>
            </repeat>
            <param name="where" value="__ob__subject__cb__=__dq__subject-1__dq__"/>
            <output name="filtered_table" ftype="qza">
                <assert_contents>
                    <has_archive_member path="[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\/metadata.yaml">
                        <has_line_matching expression="type: FeatureTable\[Frequency\]"/>
                    </has_archive_member>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="table" value="filter_samples.test1.feature-table.qza" ftype="qza"/>
            <repeat name="metadata">
                <conditional name="__q2galaxy__GUI__conditional__metadata__">
                    <param name="type" value="tsv"/>
                    <param name="source" value="filter_samples.test1.sample-metadata.tsv" ftype="qiime2.tabular"/>
                </conditional>
            </repeat>
            <param name="where" value="__ob__body-site__cb__ IN (__dq__left palm__dq____comma__ __dq__right palm__dq__)"/>
            <output name="filtered_table" ftype="qza">
                <assert_contents>
                    <has_archive_member path="[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\/metadata.yaml">
                        <has_line_matching expression="type: FeatureTable\[Frequency\]"/>
                    </has_archive_member>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="table" value="filter_samples.test2.feature-table.qza" ftype="qza"/>
            <repeat name="metadata">
                <conditional name="__q2galaxy__GUI__conditional__metadata__">
                    <param name="type" value="tsv"/>
                    <param name="source" value="filter_samples.test2.sample-metadata.tsv" ftype="qiime2.tabular"/>
                </conditional>
            </repeat>
            <param name="where" value="__ob__subject__cb__=__dq__subject-1__dq__ AND __ob__body-site__cb__=__dq__gut__dq__"/>
            <output name="filtered_table" ftype="qza">
                <assert_contents>
                    <has_archive_member path="[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\/metadata.yaml">
                        <has_line_matching expression="type: FeatureTable\[Frequency\]"/>
                    </has_archive_member>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="table" value="filter_samples.test3.feature-table.qza" ftype="qza"/>
            <repeat name="metadata">
                <conditional name="__q2galaxy__GUI__conditional__metadata__">
                    <param name="type" value="tsv"/>
                    <param name="source" value="filter_samples.test3.sample-metadata.tsv" ftype="qiime2.tabular"/>
                </conditional>
            </repeat>
            <param name="where" value="__ob__body-site__cb__=__dq__gut__dq__ OR __ob__reported-antibiotic-usage__cb__=__dq__Yes__dq__"/>
            <output name="filtered_table" ftype="qza">
                <assert_contents>
                    <has_archive_member path="[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\/metadata.yaml">
                        <has_line_matching expression="type: FeatureTable\[Frequency\]"/>
                    </has_archive_member>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="table" value="filter_samples.test4.feature-table.qza" ftype="qza"/>
            <repeat name="metadata">
                <conditional name="__q2galaxy__GUI__conditional__metadata__">
                    <param name="type" value="tsv"/>
                    <param name="source" value="filter_samples.test4.sample-metadata.tsv" ftype="qiime2.tabular"/>
                </conditional>
            </repeat>
            <param name="where" value="__ob__subject__cb__=__dq__subject-1__dq__ AND NOT __ob__body-site__cb__=__dq__gut__dq__"/>
            <output name="filtered_table" ftype="qza">
                <assert_contents>
                    <has_archive_member path="[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\/metadata.yaml">
                        <has_line_matching expression="type: FeatureTable\[Frequency\]"/>
                    </has_archive_member>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="table" value="filter_samples.test5.feature-table.qza" ftype="qza"/>
            <param name="min_features" value="10"/>
            <output name="filtered_table" ftype="qza">
                <assert_contents>
                    <has_archive_member path="[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\/metadata.yaml">
                        <has_line_matching expression="type: FeatureTable\[Frequency\]"/>
                    </has_archive_member>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="table" value="filter_samples.test6.feature-table.qza" ftype="qza"/>
            <param name="min_frequency" value="1500"/>
            <output name="filtered_table" ftype="qza">
                <assert_contents>
                    <has_archive_member path="[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\/metadata.yaml">
                        <has_line_matching expression="type: FeatureTable\[Frequency\]"/>
                    </has_archive_member>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help>
QIIME 2: feature-table filter-samples
=====================================
Filter samples from table


Outputs:
--------
:filtered_table.qza: The resulting feature table filtered by sample.

|  

Description:
------------
Filter samples from table based on frequency and/or metadata. Any features with a frequency of zero after sample filtering will also be removed. See the filtering tutorial on https://docs.qiime2.org for additional details.

Examples:
---------

filter_to_subject1
******************
Using the ``qiime2 feature-table filter-samples`` tool:
 #. Set *"table"* to ``#: feature-table.qza``
 #. Expand the ``additional options`` section

    #. For *"metadata"*:

       - Press the ``+ Insert metadata`` button to set up the next steps.

         #. Leave as ``Metadata from TSV``
         #. Set *"Metadata Source"* to ``sample-metadata.tsv``


    #. Set *"where"* to ``[subject]="subject-1"``

 #. Press the ``Execute`` button.


filter_to_skin
**************
Using the ``qiime2 feature-table filter-samples`` tool:
 #. Set *"table"* to ``#: feature-table.qza``
 #. Expand the ``additional options`` section

    #. For *"metadata"*:

       - Press the ``+ Insert metadata`` button to set up the next steps.

         #. Leave as ``Metadata from TSV``
         #. Set *"Metadata Source"* to ``sample-metadata.tsv``


    #. Set *"where"* to ``[body-site] IN ("left palm", "right palm")``

 #. Press the ``Execute`` button.


filter_to_subject1_gut
**********************
Using the ``qiime2 feature-table filter-samples`` tool:
 #. Set *"table"* to ``#: feature-table.qza``
 #. Expand the ``additional options`` section

    #. For *"metadata"*:

       - Press the ``+ Insert metadata`` button to set up the next steps.

         #. Leave as ``Metadata from TSV``
         #. Set *"Metadata Source"* to ``sample-metadata.tsv``


    #. Set *"where"* to ``[subject]="subject-1" AND [body-site]="gut"``

 #. Press the ``Execute`` button.


filter_to_gut_or_abx
********************
Using the ``qiime2 feature-table filter-samples`` tool:
 #. Set *"table"* to ``#: feature-table.qza``
 #. Expand the ``additional options`` section

    #. For *"metadata"*:

       - Press the ``+ Insert metadata`` button to set up the next steps.

         #. Leave as ``Metadata from TSV``
         #. Set *"Metadata Source"* to ``sample-metadata.tsv``


    #. Set *"where"* to ``[body-site]="gut" OR [reported-antibiotic-usage]="Yes"``

 #. Press the ``Execute`` button.


filter_to_subject1_not_gut
**************************
Using the ``qiime2 feature-table filter-samples`` tool:
 #. Set *"table"* to ``#: feature-table.qza``
 #. Expand the ``additional options`` section

    #. For *"metadata"*:

       - Press the ``+ Insert metadata`` button to set up the next steps.

         #. Leave as ``Metadata from TSV``
         #. Set *"Metadata Source"* to ``sample-metadata.tsv``


    #. Set *"where"* to ``[subject]="subject-1" AND NOT [body-site]="gut"``

 #. Press the ``Execute`` button.


filter_min_features
*******************
Using the ``qiime2 feature-table filter-samples`` tool:
 #. Set *"table"* to ``#: feature-table.qza``
 #. Expand the ``additional options`` section

    - Set *"min_features"* to ``10``

 #. Press the ``Execute`` button.


filter_min_frequency
********************
Using the ``qiime2 feature-table filter-samples`` tool:
 #. Set *"table"* to ``#: feature-table.qza``
 #. Expand the ``additional options`` section

    - Set *"min_frequency"* to ``1500``

 #. Press the ``Execute`` button.



|  

</help>
    <citations>
        <citation type="doi">10.1038/s41587-019-0209-9</citation>
    </citations>
</tool>