Пример #1
0
        '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
Пример #2
0
from q2_types.distance_matrix import DistanceMatrix
from q2_types.sample_data import AlphaDiversity, SampleData
from q2_types.tree import Phylogeny, Rooted
from q2_types.ordination import PCoAResults


plugin = Plugin(
    name='diversity',
    version=q2_diversity.__version__,
    website='https://github.com/qiime2/q2-diversity',
    package='q2_diversity'
)

plugin.methods.register_function(
    function=q2_diversity.beta_phylogenetic,
    inputs={'table': FeatureTable[Frequency] % Properties('uniform-sampling'),
            'phylogeny': Phylogeny[Rooted]},
    parameters={'metric': Str % Choices(beta.phylogenetic_metrics())},
    outputs=[('distance_matrix', DistanceMatrix % Properties('phylogenetic'))],
    input_descriptions={
        'table': ('The feature table containing the samples over which beta '
                  'diversity should be computed.'),
        'phylogeny': ('Phylogenetic tree containing tip identifiers that '
                      'correspond to the feature identifiers in the table. '
                      'This tree can contain tip ids that are not present in '
                      'the table, but all feature ids in the table must be '
                      'present in this tree.')
    },
    parameter_descriptions={
        'metric': 'The beta diversity metric to be computed.'
    },
Пример #3
0
    function=differential_plot,
    inputs={
        "ranks": FeatureData[Differential],
        "table": FeatureTable[Frequency],
    },
    parameters=params,
    parameter_descriptions=param_descs,
    input_descriptions={"ranks": "Feature differentials.", "table": TABLE},
    name=short_desc.format("differential"),
    description=long_desc.format("differential"),
)

plugin.visualizers.register_function(
    function=loading_plot,
    inputs={
        "ranks": PCoAResults % Properties("biplot"),
        "table": FeatureTable[Frequency],
    },
    parameters=params,
    parameter_descriptions=param_descs,
    input_descriptions={
        "ranks": "A biplot containing feature loadings.",
        "table": TABLE,
    },
    name=short_desc.format("loading"),
    description=long_desc.format("loading"),
)

qarcoal_params = {
    "num_string": Str,
    "denom_string": Str,
Пример #4
0
 parameters={
     'metadata': Metadata,
     'formula': Str,
     'training_column': Str,
     'num_random_test_examples': Int,
     'epoch': Int,
     'batch_size': Int,
     'beta_prior': Float,
     'learning_rate': Float,
     'clipnorm': Float,
     'min_sample_count': Int,
     'min_feature_count': Int,
     'summary_interval': Int
 },
 outputs=[('coefficients',
           FeatureTable[Composition % Properties('coefficients')])],
 input_descriptions={
     'table': 'Input table of counts.',
 },
 parameter_descriptions={
     'metadata':
     'Sample metadata table with covariates of interest.',
     'formula': ('The statistical formula specifying covariates to be '
                 'included in the model and their interactions'),
     'num_random_test_examples': ("The number of random examples to select "
                                  "if `training_column` isn't specified"),
     'epoch': ('The number of total number of iterations '
               'over the entire dataset'),
     'batch_size': ('The number of samples to be evaluated per '
                    'training iteration'),
     'beta_prior': ('Width of normal prior for the coefficients '
Пример #5
0
        function=supervised_rank_plot,
        inputs={
            'ranks': FeatureData[Differential],
            'table': FeatureTable[Frequency]
        },
        parameters=params,
        input_descriptions={
            'ranks': ranks_desc.format("differentials", "songbird"),
            'table': table_desc
        },
        name=short_desc.format("songbird"),
        description=long_desc.format("songbird"))

plugin.visualizers.register_function(function=unsupervised_rank_plot,
                                     inputs={
                                         'ranks':
                                         PCoAResults % Properties("biplot"),
                                         'table':
                                         FeatureTable[Frequency]
                                     },
                                     parameters=params,
                                     input_descriptions={
                                         'ranks':
                                         ranks_desc.format(
                                             "ordination", "DEICODE"),
                                         'table':
                                         table_desc
                                     },
                                     name=short_desc.format("DEICODE"),
                                     description=long_desc.format("DEICODE"))
Пример #6
0
    website='http://bryandmartin.github.io/corncob/',
    package='q2_corncob',
    description=('This QIIME 2 plugin wraps corncob and supports '
                 'single-taxon regression using the corncob R library.'),
    short_description='Plugin for single-taxon regression with corncob.',
    citations=[citations['martin2018']]
)

plugin.methods.register_function(
    function=q2_corncob.differentialtest,
    inputs={'table': FeatureTable[Frequency],
            'taxonomy': FeatureData[Taxonomy]
    },
    parameters={'metadata': Metadata,
                'variable': Str,
    },
    
    outputs=[('output',FeatureData[Taxonomy % Properties(["Taxon", "DA", "DV"])])],
    input_descriptions={'table': ('A feature table.'),
                        'taxonomy': ('Your taxonomic classification by unique feature')
    },
                                 
    output_descriptions={'output': 'A table of FDR <0.05 p-values.'
    },
    parameter_descriptions={'metadata': ('Your metadata'),
                            'variable': ('A categorical variable in your metadata')},
    name='Run differential test',
    description='This method runs differential test.'
)

Пример #7
0
        "some degree of accuracy loss, the magnitude "
        "of which varies across different datasets."
    },
    output_descriptions={'pcoa': 'The resulting PCoA matrix.'},
    name='Principal Coordinate Analysis',
    description=("Apply principal coordinate analysis."),
    citations=[citations['legendrelegendre'], citations['halko2010']])

plugin.methods.register_function(
    function=q2_diversity.pcoa_biplot,
    inputs={
        'pcoa': PCoAResults,
        'features': FeatureTable[RelativeFrequency]
    },
    parameters={},
    outputs=[('biplot', PCoAResults % Properties('biplot'))],
    input_descriptions={
        'pcoa': 'The PCoA where the features will be projected onto.',
        'features': 'Variables to project onto the PCoA matrix'
    },
    parameter_descriptions={},
    output_descriptions={'biplot': 'The resulting PCoA matrix.'},
    name='Principal Coordinate Analysis Biplot',
    description="Project features into a principal coordinates matrix. The "
    "features used should be the features used to compute the "
    "distance matrix. It is recommended that these variables be"
    " normalized in cases of dimensionally heterogeneous physical"
    " variables.",
    citations=[citations['legendrelegendre']])

plugin.methods.register_function(
Пример #8
0
     'formula': Str,
     'training_column': Str,
     'num_random_test_examples': Int,
     'epochs': Int,
     'batch_size': Int,
     'differential_prior': Float,
     'learning_rate': Float,
     'clipnorm': Float,
     'min_sample_count': Int,
     'min_feature_count': Int,
     'summary_interval': Int,
     'random_seed': Int,
 },
 outputs=[('differentials', FeatureData[Differential]),
          ('regression_stats', SampleData[SongbirdStats]),
          ('regression_biplot', PCoAResults % Properties('biplot'))],
 input_descriptions={
     'table': DESCS["table"],
 },
 output_descriptions={
     'differentials': ('Output differentials learned from the '
                       'multinomial regression.'),
     'regression_stats': ('Summary information about the loss '
                          'and cross validation error over iterations.'),
     'regression_biplot': ('A biplot of the regression coefficients')
 },
 parameter_descriptions={
     'metadata': DESCS["metadata"],
     'formula': DESCS["formula"],
     "training_column": DESCS["training-column"],
     'num_random_test_examples': DESCS["num-random-test-examples"],
Пример #9
0
    short_description=('Plugin for Robust Aitchison PCA:'
                       'compositional biplots from sparse count data.'),
    description=('This is a QIIME 2 plugin supporting Robust Aitchison on '
                 'feature tables'),
    package='deicode')

plugin.methods.register_function(
    function=rpca,
    inputs={'table': FeatureTable[Frequency]},
    parameters={
        'n_components': Int,
        'min_sample_count': Int,
        'min_feature_count': Int,
        'max_iterations': Int,
    },
    outputs=[('biplot', PCoAResults % Properties("biplot")),
             ('distance_matrix', DistanceMatrix)],
    input_descriptions={
        'table': 'Input table of counts.',
    },
    parameter_descriptions={
        'n_components': DESC_RANK,
        'min_sample_count': DESC_MSC,
        'min_feature_count': DESC_MFC,
        'max_iterations': DESC_ITERATIONS,
    },
    output_descriptions={
        'biplot': ('A biplot of the (Robust Aitchison) RPCA feature loadings'),
        'distance_matrix': ('The Aitchison distance of'
                            'the sample loadings from RPCA.')
    },
Пример #10
0
 parameters={
     'metadata': Metadata,
     'training_column': Str,
     'num_testing_examples': Int,
     'min_feature_count': Int,
     'epochs': Int,
     'batch_size': Int,
     'latent_dim': Int,
     'input_prior': Float,
     'output_prior': Float,
     'learning_rate': Float,
     'summary_interval': Int
 },
 outputs=[
     ('conditionals', FeatureData[Conditional]),
     ('conditional_biplot', PCoAResults % Properties('biplot'))
 ],
 input_descriptions={
     'microbes': 'Input table of microbial counts.',
     'metabolites': 'Input table of metabolite intensities.',
 },
 output_descriptions={
     'conditionals': 'Mean-centered Conditional log-probabilities.',
     'conditional_biplot': 'Biplot of microbe-metabolite vectors.',
 },
 parameter_descriptions={
     'metadata': 'Sample metadata table with covariates of interest.',
     'training_column': "The metadata column specifying which "
                        "samples are for training/testing. "
                        "Entries must be marked `Train` for training "
                        "examples and `Test` for testing examples. ",
Пример #11
0
    },
    parameters=PARAMETERS,
    input_descriptions={
        'reference_pcoa':
        'The reference ordination matrix to be plotted.',
        'other_pcoa':
        'The "other" ordination matrix to be plotted (the one '
        'that was fitted to the reference).'
    },
    parameter_descriptions=PARAMETERS_DESC,
    name='Visualize and Interact with a procrustes plot',
    description='Plot two procrustes-fitted matrices')

plugin.visualizers.register_function(
    function=biplot,
    inputs={'biplot': PCoAResults % Properties("biplot")},
    parameters={
        'sample_metadata': Metadata,
        'feature_metadata': Metadata,
        'ignore_missing_samples': Bool,
        'invert': Bool,
        'number_of_features': Int % Range(1, None)
    },
    input_descriptions={
        'biplot': 'The principal coordinates matrix to be plotted.'
    },
    parameter_descriptions={
        'sample_metadata':
        'The sample metadata',
        'feature_metadata':
        'The feature metadata (useful to manipulate the '
Пример #12
0
                   'Daniel McDonald, Jose C Clemente, Justin Kuczynski, '
                   'Jai Ram Rideout, Jesse Stombaugh, Doug Wendel, Andreas '
                   'Wilke, Susan Huse, John Hufnagle, Folker Meyer, Rob '
                   'Knight and J Gregory Caporaso. GigaScience 1:7 (2012).'
                   'doi:10.1186/2047-217X-1-7'),
    short_description=('Plugin for working with sample by feature tables.'),
    description=('This is a QIIME 2 plugin supporting operations on sample '
                 'by feature tables, such as filtering, merging, and '
                 'transforming tables.'))

plugin.methods.register_function(
    function=q2_feature_table.rarefy,
    inputs={'table': FeatureTable[Frequency]},
    parameters={'sampling_depth': Int},
    outputs=[('rarefied_table',
              FeatureTable[Frequency] % Properties('uniform-sampling'))],
    input_descriptions={'table': 'The feature table to be rarefied.'},
    parameter_descriptions={
        'sampling_depth': ('The total frequency that each sample should be '
                           'rarefied to. Samples where the sum of frequencies '
                           'is less than the sampling depth will be not be '
                           'included in the resulting table.')
    },
    output_descriptions={
        'rarefied_table': 'The resulting rarefied feature table.'
    },
    name='Rarefy table',
    description=("Subsample frequencies from all samples without replacement "
                 "so that the sum of frequencies in each sample is equal to "
                 "sampling-depth."))
Пример #13
0
plugin = qiime2.plugin.Plugin(name='breakaway',
                              version=q2_breakaway.__version__,
                              website='http://github.com/adw96/breakaway/',
                              package='q2_breakaway',
                              description=('baway'),
                              short_description='ba.',
                              citations=qiime2.plugin.Citations.load(
                                  'citations.bib', package='q2_breakaway'))

_METRIC_CHOICES = {'richness', 'chao_bunge'}

plugin.methods.register_function(
    function=q2_breakaway.breakaway,
    inputs={'table': FeatureTable[Frequency]},
    outputs=[('alpha_diversity', SampleData[AlphaDiversity % Properties(
        ["StandardError", "LowerConfidence", "UpperConfidence"])])],
    parameters={'metric': Str % Choices(_METRIC_CHOICES)},
    input_descriptions={
        'table': ('The feature table containing the samples for which alpha '
                  'diversity should be computed.')
    },
    parameter_descriptions={
        'metric': 'An alpha diversity metric',
    },
    output_descriptions={
        'alpha_diversity': 'Vector containing per-sample alpha diversities.'
    },
    name='Richness, better',
    description='Amy\'s opinionated ideas about richness as a q2, '
    'plug-in.')
Пример #14
0
plugin.methods.register_function(
    function=q2_cscs.q2_cscs.cscs,
    inputs={
        'features': FeatureTable[Frequency],
    },
    parameters={
        'css_edges': qiime2.plugin.Str,
        'weighted': qiime2.plugin.Bool,
        'normalization': qiime2.plugin.Bool,
        'cosine_threshold':
        qiime2.plugin.Float % qiime2.plugin.Range(0., None),
        'cpus': qiime2.plugin.Int,
        'chunk': qiime2.plugin.Int
    },
    outputs=[('distance_matrix', DistanceMatrix % Properties('phylogenetic'))],
    input_descriptions={
        'features':
        ('The feature table containing the samples over which the chemical structural and compositional dissimilarity metric '
         'should be computed.')
    },
    parameter_descriptions={
        'css_edges':
        '.tsv file containing pair wise cosine scores for all features provided in the feature table',
        'normalization':
        'Perform Total Ion Current Normalization (TIC) on the feature table',
        'cosine_threshold':
        'Min. cosine score between two features to be included',
        'weighted': 'Weight CSCS by feature intensity',
        'cpus': 'How many parallel processeces to run',
        'chunk': 'How large pieces to parallelize'
Пример #15
0
plugin = qiime2.plugin.Plugin(
    name='gemelli',
    version=__version__,
    website="https://github.com/biocore/gemelli",
    citations=[citations['Martino2019']],
    short_description=('Plugin for Compositional Tensor Factorization'),
    description=('This is a QIIME 2 plugin supporting Robust Aitchison on '
                 'feature tables'),
    package='gemelli')

plugin.methods.register_function(
    function=ctf,
    inputs={'table': FeatureTable[Frequency]},
    parameters=PARAMETERS,
    outputs=[('subject_biplot', PCoAResults % Properties("biplot")),
             ('state_biplot', PCoAResults % Properties("biplot")),
             ('distance_matrix', DistanceMatrix),
             ('state_subject_ordination', SampleData[SampleTrajectory]),
             ('state_feature_ordination', FeatureData[FeatureTrajectory])],
    input_descriptions={'table': DESC_BIN},
    parameter_descriptions=PARAMETERDESC,
    output_descriptions={
        'subject_biplot': QLOAD,
        'state_biplot': QSOAD,
        'distance_matrix': QDIST,
        'state_subject_ordination': QORD,
        'state_feature_ordination': QORD
    },
    name='Compositional Tensor Factorization - Mode 3',
    description=("Gemelli resolves spatiotemporal subject variation and the"
Пример #16
0
                 'statistics and visualizations in the context of sample '
                 'metadata.'),
    short_description='Plugin for exploring community diversity.',
)

plugin.methods.register_function(
    function=q2_diversity.beta_phylogenetic,
    inputs={
        'table': FeatureTable[Frequency],
        'phylogeny': Phylogeny[Rooted]
    },
    parameters={
        'metric': Str % Choices(beta.phylogenetic_metrics()),
        'n_jobs': Int % Range(1, None)
    },
    outputs=[('distance_matrix', DistanceMatrix % Properties('phylogenetic'))],
    input_descriptions={
        'table': ('The feature table containing the samples over which beta '
                  'diversity should be computed.'),
        'phylogeny': ('Phylogenetic tree containing tip identifiers that '
                      'correspond to the feature identifiers in the table. '
                      'This tree can contain tip ids that are not present in '
                      'the table, but all feature ids in the table must be '
                      'present in this tree.')
    },
    parameter_descriptions={
        'metric': 'The beta diversity metric to be computed.',
        'n_jobs':
        '[Excluding weighted_unifrac] - %s' % sklearn_n_jobs_description
    },
    output_descriptions={'distance_matrix': 'The resulting distance matrix.'},
Пример #17
0
 def test_complicated_semantic_type(self):
     self.assert_roundtrip(
         C2[C1[Foo % Properties(["A", "B"]) | Bar], Foo % Properties("A")] %
         Properties(exclude=["B", "C"]))
Пример #18
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
plugin = qiime2.plugin.Plugin(name='breakaway',
                              version=q2_breakaway.__version__,
                              website='http://github.com/adw96/breakaway/',
                              package='q2_breakaway',
                              description=('baway'),
                              short_description='ba.',
                              citations=qiime2.plugin.Citations.load(
                                  'citations.bib', package='q2_breakaway'))

_METRIC_CHOICES = {'richness', 'chao_bunge'}

plugin.methods.register_function(
    function=q2_breakaway.alpha,
    inputs={'table': FeatureTable[Frequency]},
    outputs=[('alpha_diversity', SampleData[AlphaDiversity % Properties([
        "StandardError", "LowerConfidence", "UpperConfidence", "SampleNames",
        "MethodName", "ModelType"
    ])])],
    parameters={'metric': Str % Choices(_METRIC_CHOICES)},
    input_descriptions={
        'table': ('The feature table containing the samples for which alpha '
                  'diversity should be computed.')
    },
    parameter_descriptions={
        'metric': 'An alpha diversity metric',
    },
    output_descriptions={
        'alpha_diversity': 'Vector containing per-sample alpha diversities.'
    },
    name='Richness, better',
    description='Amy\'s opinionated ideas about richness as a q2, '
    'plug-in.')