Exemplo n.º 1
0

P, R = TypeMap({Choices(True): C1[Foo], Choices(False): Foo})
dummy_plugin.methods.register_function(
    function=bool_flag_swaps_output_method,
    inputs={'a': Bar},
    parameters={'b': Bool % P},
    outputs=[('x', R)],
    name='Bool Flag Swaps Output Method',
    description='Test if a parameter can change output')
del P, R


def predicates_preserved_method(a: EchoFormat) -> EchoFormat:
    return a


P = TypeMatch(
    [Properties('A'),
     Properties('B'),
     Properties('C'),
     Properties('X', 'Y')])
dummy_plugin.methods.register_function(
    function=predicates_preserved_method,
    inputs={'a': Foo % P},
    parameters={},
    outputs=[('x', Foo % P)],
    name='Predicates Preserved Method',
    description='Test that predicates are preserved')
del P
Exemplo n.º 2
0
        'vmin': 'The minimum value to use for anchoring the colormap. If '
        '"auto", vmin is set to the minimum value in the data.',
        'vmax': 'The maximum value to use for anchoring the colormap. If '
        '"auto", vmax is set to the maximum value in the data.',
        'palette': 'The color palette to use for plotting.'
    },
    name='Make a confusion matrix from sample classifier predictions.',
    description='Make a confusion matrix and calculate accuracy of predicted '
    'vs. true values for a set of samples classified using a '
    'sample classifier. If per-sample class probabilities are '
    'provided, will also generate Receiver Operating '
    'Characteristic curves and calculate area under the curve for '
    'each class.')

T = TypeMatch([
    Frequency, RelativeFrequency, PresenceAbsence, Balance,
    PercentileNormalized
])
plugin.methods.register_function(
    function=split_table,
    inputs={'table': FeatureTable[T]},
    parameters={
        'random_state': parameters['base']['random_state'],
        'missing_samples': parameters['base']['missing_samples'],
        **parameters['splitter'], 'metadata':
        MetadataColumn[Numeric | Categorical],
        **parameters['regressor']
    },
    outputs=[('training_table', FeatureTable[T]),
             ('test_table', FeatureTable[T])],
    input_descriptions={
        'table':
Exemplo n.º 3
0
        'int1': Int,
        'int2': Int
    },
    outputs=[('concatenated_ints', IntSequence1)],
    name='Concatenate integers',
    description='This method concatenates integers into a single sequence in '
    'the order they are provided.',
    citations=[citations['baerheim1994effect']],
    examples={
        'concatenate_ints_simple': concatenate_ints_simple,
        'concatenate_ints_complex': concatenate_ints_complex,
        'comments_only': comments_only
    },
)

T = TypeMatch([IntSequence1, IntSequence2])
dummy_plugin.methods.register_function(
    function=split_ints,
    inputs={'ints': T},
    parameters={},
    outputs=[('left', T), ('right', T)],
    name='Split sequence of integers in half',
    description='This method splits a sequence of integers in half, returning '
    'the two halves (left and right). If the input sequence\'s '
    'length is not evenly divisible by 2, the right half will '
    'have one more element than the left.',
    citations=[
        citations['witcombe2006sword'], citations['reimers2012response']
    ])

dummy_plugin.methods.register_function(
Exemplo n.º 4
0
    parameter_descriptions={
        'fraction': ('The fraction of sequences to retain in subsample.')
    },
    output_descriptions={
        'subsampled_sequences': 'The subsampled sequences.'
    },
    name='Subsample paired-end sequences without replacement.',
    description=('Generate a random subsample of paired-end sequences '
                 'containing approximately the fraction of input sequences '
                 'specified by the fraction parameter. The number of output '
                 'samples will always be equal to the number of input '
                 'samples, even if some of those samples contain no '
                 'sequences after subsampling.')
)

T = TypeMatch([SequencesWithQuality, PairedEndSequencesWithQuality,
               JoinedSequencesWithQuality])
plugin.methods.register_function(
    function=q2_demux.filter_samples,
    inputs={'demux': SampleData[T]},
    parameters={'metadata': Metadata,
                'where': Str,
                'exclude_ids': Bool},
    outputs=[
        ('filtered_demux', SampleData[T])
    ],
    input_descriptions={
        'demux': 'The demultiplexed data from which samples should be '
        'filtered.'
    },
    parameter_descriptions={
        'metadata': 'Sample metadata indicating which sample ids to filter. '
Exemplo n.º 5
0
    outputs=[('merged_data', FeatureData[Taxonomy])],
    input_descriptions={
        'data': 'The collection of feature taxonomies to be merged.',
    },
    parameter_descriptions={},
    output_descriptions={
        'merged_data': ('The resulting collection of feature taxonomies '
                        'containing all feature taxonomies provided.')
    },
    name="Combine collections of feature taxonomies",
    description="Combines a pair of feature data objects which may or may not "
    "contain data for the same features. If different feature "
    "data is present for the same feature id in the inputs, "
    "the data from the first will be propagated to the result.")

T1 = TypeMatch([Frequency, RelativeFrequency, PresenceAbsence, Composition])

plugin.methods.register_function(
    function=q2_feature_table.rename_ids,
    inputs={
        'table': FeatureTable[T1],
    },
    parameters={
        'metadata': MetadataColumn[Categorical],
        'strict': Bool,
        'axis': Str % Choices({'sample', 'feature'})
    },
    outputs=[('renamed_table', FeatureTable[T1])],
    input_descriptions={
        'table': 'The table to be renamed',
    },
Exemplo n.º 6
0
                 'supports interactive visualization of phylogenetic '
                 'trees.'),
    short_description='Plugin for visualizing phylogenies with Empress.')

TREE_DESC = 'The phylogenetic tree to visualize.'

FM_DESC = (
    'Feature metadata. Can be used to color nodes (tips and/or '
    'internal nodes) in the tree, and to display tip-level barplots. '
    'Features described in the metadata that are not present in the tree '
    'will be automatically filtered out of the visualization.')

# Accept various types of feature tables -- we (currently) convert things to
# presence/absence, anyway. This line adapted from
# https://github.com/qiime2/q2-feature-table/blob/9ed6160adad45445ec054e5ce034a3b3ba25a9b4/q2_feature_table/plugin_setup.py#L243.
AcceptedTableTypes = TypeMatch([Frequency, RelativeFrequency, PresenceAbsence])

plugin.visualizers.register_function(
    function=community_plot,
    inputs={
        'tree': Phylogeny[Rooted],
        'feature_table': FeatureTable[AcceptedTableTypes],
        'pcoa': PCoAResults,
    },
    parameters={
        'sample_metadata': Metadata,
        'feature_metadata': Metadata,
        'ignore_missing_samples': Bool,
        'filter_extra_samples': Bool,
        'filter_missing_features': Bool,
        'number_of_features': Int % Range(1, None),
Exemplo n.º 7
0
    parameter_descriptions={
        'level': ('The level that masking should be performed at. "mask" will '
                  'mask only positions annotated as "mask", while "caution" '
                  'will mask positions annotated as "mask" or "caution".'),
        'mask_terminal_gaps':
            ('Mask alignment positions that are terminal (i.e., end) gaps in '
             'all reference sequences.'),
    },
    output_descriptions={
        'masked_alignment': ('The alignment with masked positions removed.')
    },
    name='Mask alignment',
    description='Apply pre-computed alignment mask to filter positions.'
)

T = TypeMatch([Sequence, AlignedSequence])

plugin.methods.register_function(
    function=label_seqs,
    inputs={'seqs': FeatureData[T]},
    parameters={
        'delimiter': Str % Choices('|', ',', '+', ':', ';'),
        'metadata': Metadata,
        'columns': List[Str],
        'missing_value': Str,
    },
    outputs=[('labeled_seqs', FeatureData[T])],
    input_descriptions={'seqs': 'The sequences to be re-labeled.'},
    parameter_descriptions={
        'delimiter': 'The delimiter between the sequence id and each metadata'
                     ' entry.',
Exemplo n.º 8
0
    input_descriptions={
        'data': 'The collection of feature taxonomies to be merged.',
    },
    parameter_descriptions={},
    output_descriptions={
        'merged_data': ('The resulting collection of feature taxonomies '
                        'containing all feature taxonomies provided.')
    },
    name="Combine collections of feature taxonomies",
    description="Combines a pair of feature data objects which may or may not "
                "contain data for the same features. If different feature "
                "data is present for the same feature id in the inputs, "
                "the data from the first will be propagated to the result."
)

T = TypeMatch([Frequency, RelativeFrequency, PresenceAbsence, Composition])

plugin.methods.register_function(
    function=q2_feature_table.rename_ids,
    inputs={
        'table': FeatureTable[T],
    },
    parameters={
        'metadata': MetadataColumn[Categorical],
        'strict': Bool,
        'axis': Str % Choices({'sample', 'feature'})
        },
    outputs=[
        ('renamed_table', FeatureTable[T])
        ],
    input_descriptions={
Exemplo n.º 9
0
    version='1',
    website='https://github.com/richrr/coremicro',
    package='q2_coremicrobiome',
    description=('This QIIME 2 plugin calculates coremicrobiome '
                 'using presence/absence data. '
                 'Refer http://coremic2.appspot.com/help for online tool.'),
    short_description='Plugin for exploring coremicrobiome.',
    citation_text='Rodrigues RR, Rodgers NC, Wu X, Williams MA. (2018) '
    'COREMIC: a web-tool to search for a niche associated '
    'CORE MICrobiome. PeerJ 6:e4395'
    #citations=[citations['Rodrigues2018']]
)

# https://dev.qiime2.org/latest/actions/visualizers/
# you do not provide outputs or output_descriptions when making this call, as Visualizers, by definition, only return a single visualization. Since the visualization output path is a required parameter, you do not include this in an outputs list
T = TypeMatch([Frequency, RelativeFrequency])
plugin.visualizers.register_function(
    function=q2_coremicrobiome.full_pipeline,
    inputs={'table': FeatureTable[T]},
    parameters={
        'groupfile': Metadata,
        'factor': Str,
        'group': Str,
        'outputfile': Str,
        'max_out_presence': Float,
        'max_p': Float,
        'min_frac': Float,
        'min_abundance': Float,
        'p_val_adj': Str,
        'make_relative': Bool,
        'quantile_normalize': Bool
Exemplo n.º 10
0
    },
    output_descriptions={'tree': 'The resulting phylogenetic tree.'},
    name=('Construct a phylogenetic tree with IQ-TREE with bootstrap '
          'supports.'),
    description=('Construct a phylogenetic tree using IQ-TREE '
                 '(http://www.iqtree.org/) with automatic '
                 'model selection and bootstrap supports.'),
    citations=[
        citations['Minh2020iqtree'],
        citations['Kalyaanamoorthy2017modelfinder'],
        citations['Minh2013ultrafastbootstrap'],
        citations['Hoang2017ultrafastbootstrap2']
    ],
)

T1 = TypeMatch([Frequency, RelativeFrequency, PresenceAbsence])

plugin.methods.register_function(
    function=q2_phylogeny.filter_table,
    inputs={
        'table': FeatureTable[T1],
        'tree': Phylogeny[Rooted | Unrooted]
    },
    parameters={},
    outputs=[('filtered_table', FeatureTable[T1])],
    input_descriptions={
        'table':
        'Feature table that features should be filtered from.',
        'tree': ('Tree where tip identifiers are the feature identifiers that '
                 'should be retained in the table.')
    },