Example #1
0
    },
    output_descriptions={
        'grouped_table':
        'A table that has been grouped along the given '
        '`axis`. IDs on that axis are replaced by values in '
        'the `metadata` column.'
    },
    name="Group samples or features by a metadata column",
    description="Group samples or features in a feature table using metadata "
    "to define the mapping of IDs to a group.")

plugin.methods.register_function(
    function=q2_feature_table.merge,
    inputs={'tables': List[FeatureTable[Frequency]]},
    parameters={
        'overlap_method': Str % Choices(q2_feature_table.overlap_methods()),
    },
    outputs=[('merged_table', FeatureTable[Frequency])],
    input_descriptions={
        'tables': 'The collection of feature tables to be merged.',
    },
    parameter_descriptions={
        'overlap_method': 'Method for handling overlapping ids.',
    },
    output_descriptions={
        'merged_table': ('The resulting merged feature table.'),
    },
    name="Combine multiple tables",
    description="Combines feature tables using the `overlap_method` provided.")

plugin.methods.register_function(
Example #2
0
        'Along which axis to group. Each ID in the given axis must '
        'exist in `metadata`.'
    },
    output_descriptions={
        'grouped_table':
        'A table that has been grouped along the given '
        '`axis`. IDs on that axis are replaced by values in '
        'the `metadata` column.'
    },
    name="Group samples or features by a metadata column",
    description="Group samples or features in a feature table using metadata "
    "to define the mapping of IDs to a group.")

i_table, p_overlap_method, o_table = TypeMap({
    (FeatureTable[Frequency], Str % Choices(
         sorted(q2_feature_table.overlap_methods()))):
    FeatureTable[Frequency],
    (
        FeatureTable[RelativeFrequency],
        # We don't want to allow summing of RelativeFrequency tables, so remove
        # that option from the overlap methods
        Str % Choices(sorted(q2_feature_table.overlap_methods() - {'sum'}))):
    FeatureTable[RelativeFrequency]
})

plugin.methods.register_function(
    function=q2_feature_table.merge,
    inputs={'tables': List[i_table]},
    parameters={'overlap_method': p_overlap_method},
    outputs=[('merged_table', o_table)],
    input_descriptions={
    },
    output_descriptions={
        'grouped_table': 'A table that has been grouped along the given '
                         '`axis`. IDs on that axis are replaced by values in '
                         'the `metadata` column.'
    },
    name="Group samples or features by a metadata column",
    description="Group samples or features in a feature table using metadata "
                "to define the mapping of IDs to a group."
)

plugin.methods.register_function(
    function=q2_feature_table.merge,
    inputs={'tables': List[FeatureTable[Frequency]]},
    parameters={
        'overlap_method': Str % Choices(q2_feature_table.overlap_methods()),
    },
    outputs=[
        ('merged_table', FeatureTable[Frequency])],
    input_descriptions={
        'tables': 'The collection of feature tables to be merged.',
    },
    parameter_descriptions={
        'overlap_method': 'Method for handling overlapping ids.',
    },
    output_descriptions={
        'merged_table': ('The resulting merged feature table.'),
    },
    name="Combine multiple tables",
    description="Combines feature tables using the `overlap_method` provided."
)