コード例 #1
0
citations = qiime2.plugin.Citations.load('citations.bib', package='q2_vsearch')
plugin = qiime2.plugin.Plugin(
    name='vsearch',
    version=q2_vsearch.__version__,
    website='https://github.com/qiime2/q2-vsearch',
    package='q2_vsearch',
    user_support_text=None,
    short_description='Plugin for clustering and dereplicating with vsearch.',
    description=('This plugin wraps the vsearch application, and provides '
                 'methods for clustering and dereplicating features and '
                 'sequences.'),
    citations=[citations['rognes2016vsearch']]
)

plugin.register_formats(UchimeStatsFmt, UchimeStatsDirFmt)

plugin.register_semantic_types(UchimeStats)
plugin.register_semantic_type_to_format(
    UchimeStats,
    artifact_format=UchimeStatsDirFmt)

plugin.methods.register_function(
    function=q2_vsearch._cluster_features.cluster_features_de_novo,
    inputs={
        'table': FeatureTable[Frequency],
        'sequences': FeatureData[Sequence]},
    parameters={
        'perc_identity': qiime2.plugin.Float % qiime2.plugin.Range(
                          0, 1, inclusive_start=False, inclusive_end=True),
        'threads': qiime2.plugin.Int % qiime2.plugin.Range(
コード例 #2
0
    version=q2_quality_filter.__version__,
    website='https://github.com/wasade/q2-quality-filter',
    package='q2_quality_filter',
    citation_text=('Quality-filtering vastly improves diversity estimates '
                   'from Illumina amplicon sequencing. Nicholas A Bokulich, '
                   'Sathish Subramanian, Jeremiah J Faith, Dirk Gevers, '
                   'Jeffrey I Gordon, Rob Knight, David A Mills & J Gregory '
                   'Caporaso. Nature Methods 10, 57–59 (2013) '
                   'doi:10.1038/nmeth.2276'),
    description=('This QIIME 2 plugin supports filtering and trimming of '
                 'sequence reads based on PHRED scores and ambiguous '
                 'nucleotide characters.'),
    short_description='Plugin for PHRED-based filtering and trimming.'
)

plugin.register_formats(QualityFilterStatsFmt, QualityFilterStatsDirFmt)

plugin.register_semantic_types(QualityFilterStats)
plugin.register_semantic_type_to_format(
    QualityFilterStats,
    artifact_format=QualityFilterStatsDirFmt)

plugin.methods.register_function(
    function=q2_quality_filter.q_score,
    inputs={'demux': SampleData[SequencesWithQuality]},
    parameters={
        'min_quality': qiime2.plugin.Int,
        'quality_window': qiime2.plugin.Int,
        'min_length_fraction': qiime2.plugin.Float,
        'max_ambiguous': qiime2.plugin.Int
    },
コード例 #3
0
        'the input table. You can ignore this table for '
        'downstream analyses.',
    },
    name='Filter fragments in tree from table.',
    description='Filters fragments not inserted into a phylogenetic tree from '
    'a feature-table. Some fragments computed by e.g. Deblur or '
    'DADA2 are too remote to get inserted by SEPP into a '
    'reference phylogeny. To be able to use the feature-table for '
    'downstream analyses like computing Faith\'s PD or UniFrac, '
    'the feature-table must be cleared of fragments that are not '
    'part of the phylogenetic tree, because their path length can '
    'otherwise not be determined. Typically, the number of '
    'rejected fragments is low (<= 10), but it might be worth to '
    'inspect the ratio of rea'
    'ds assigned to those rejected '
    'fragments.',
)

# TODO: rough in method to merge database components
# TODO: rough in method to destructure database components

importlib.import_module('q2_fragment_insertion._transformer')

plugin.register_formats(PlacementsFormat, PlacementsDirFmt, RAxMLinfoFormat,
                        SeppReferenceDirFmt)
plugin.register_semantic_types(Placements, SeppReferenceDatabase)
plugin.register_semantic_type_to_format(Placements,
                                        artifact_format=PlacementsDirFmt)
plugin.register_semantic_type_to_format(SeppReferenceDatabase,
                                        artifact_format=SeppReferenceDirFmt)
コード例 #4
0
ファイル: _mapping.py プロジェクト: qiime2/q2-dummy-types
                cells = line.rstrip('\n').split('\t')
                if len(cells) != 2:
                    return False
            return True


# Define a directory format. A directory format is a directory structure
# composed of one or more files (nested directories are also supported). Each
# file has a specific file format associated with it.  This directory format
# only has a single file, ints.txt, with file format `IntSequenceFormat`.
MappingDirectoryFormat = model.SingleFileDirectoryFormat(
    'MappingDirectoryFormat', 'mapping.tsv', MappingFormat)

# Register the formats defined above. Formats must be unique across all
# plugins installed on a users system.
plugin.register_formats(MappingFormat, MappingDirectoryFormat)

# Register the directory format with the semantic types defined above. A
# directory format can be registered to multiple semantic types. Currently, a
# semantic type can only have a single directory format associated with it.
plugin.register_semantic_type_to_format(
    Mapping,
    artifact_format=MappingDirectoryFormat)


# Define a transformer for converting a file format (`MappingFormat`) into a
# view type (`dict` in this case). To indicate that only the QIIME 2 Framework
# should interact with a transformer, a non-meaningful name is used. The
# convention is `_<int counter>`, but anything is acceptable. The aim is to
# draw the reader to the function annotations, which convey precisely what the
# transformer is responsible for.
コード例 #5
0
plugin.methods.register_function(
    function=qarcoal,
    inputs={
        "table": FeatureTable[Frequency],
        "taxonomy": FeatureData[Taxonomy],
    },
    parameters=qarcoal_params,
    parameter_descriptions=qarcoal_param_descs,
    input_descriptions={
        "table": QPD.QARCOAL_TBL,
        "taxonomy": QPD.QARCOAL_TAXONOMY,
    },
    outputs=[("qarcoal_log_ratios", SampleData[LogRatios])],
    description=QPD.QARCOAL_DESC,
    name="Compute feature log-ratios based on textual taxonomy searching.",
)


# this line may be necessary to register transformers
# found in songbird's plugin_setup file as well as Q2 forum post
# https://github.com/biocore/songbird/blob/master/songbird/q2/plugin_setup.py
# https://forum.qiime2.org/t/question-about-error-no-transformation-class-for-dataframe-to-dir/4576
importlib.import_module("qurro.q2._transformer")

# Register types
plugin.register_formats(LogRatiosFormat, LogRatiosDirFmt)
plugin.register_semantic_types(LogRatios)
plugin.register_semantic_type_to_format(
    SampleData[LogRatios], artifact_format=LogRatiosDirFmt
)
コード例 #6
0

@plugin.register_transformer
def _3(dirfmt: TaxonomicClassifierDirFmt) -> Pipeline:
    raise ValueError('The scikit-learn version could not be determined for'
                     ' this artifact, please retrain your classifier for your'
                     ' current deployment to prevent data-corruption errors.')


@plugin.register_transformer
def _4(fmt: JSONFormat) -> dict:
    with fmt.open() as fh:
        return json.load(fh)


@plugin.register_transformer
def _5(data: dict) -> JSONFormat:
    result = JSONFormat()
    with result.open() as fh:
        json.dump(data, fh)
    return result


# Registrations
plugin.register_semantic_types(TaxonomicClassifier)
plugin.register_formats(TaxonomicClassifierDirFmt,
                        TaxonomicClassiferTemporaryPickleDirFmt)
plugin.register_semantic_type_to_format(
    TaxonomicClassifier,
    artifact_format=TaxonomicClassiferTemporaryPickleDirFmt)
コード例 #7
0
                cells = line.rstrip('\n').split('\t')
                if len(cells) != 2:
                    return False
            return True


# Define a directory format. A directory format is a directory structure
# composed of one or more files (nested directories are also supported). Each
# file has a specific file format associated with it.  This directory format
# only has a single file, ints.txt, with file format `IntSequenceFormat`.
MappingDirectoryFormat = model.SingleFileDirectoryFormat(
    'MappingDirectoryFormat', 'mapping.tsv', MappingFormat)

# Register the formats defined above. Formats must be unique across all
# plugins installed on a users system.
plugin.register_formats(MappingFormat, MappingDirectoryFormat)

# Register the directory format with the semantic types defined above. A
# directory format can be registered to multiple semantic types. Currently, a
# semantic type can only have a single directory format associated with it.
plugin.register_semantic_type_to_format(Mapping,
                                        artifact_format=MappingDirectoryFormat)


# Define a transformer for converting a file format (`MappingFormat`) into a
# view type (`dict` in this case). To indicate that only the QIIME 2 Framework
# should interact with a transformer, a non-meaningful name is used. The
# convention is `_<int counter>`, but anything is acceptable. The aim is to
# draw the reader to the function annotations, which convey precisely what the
# transformer is responsible for.
@plugin.register_transformer
コード例 #8
0
ファイル: plugin_setup.py プロジェクト: shihuang047/gemelli
    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"
                 " biological features that separate them. In this case, a "
                 "subject may have several paired samples, where each sample"
                 " may be a time point. The output is akin to conventional "
                 "beta-diversity analyses but with the paired component "
                 "integrated in the dimensionality reduction."),
)

plugin.register_semantic_types(SampleTrajectory, FeatureTrajectory)
plugin.register_semantic_type_to_format(
    SampleData[SampleTrajectory], artifact_format=TrajectoryDirectoryFormat)
plugin.register_semantic_type_to_format(
    FeatureData[FeatureTrajectory], artifact_format=TrajectoryDirectoryFormat)
plugin.register_formats(TrajectoryDirectoryFormat)
importlib.import_module('gemelli.q2._transformer')
コード例 #9
0
    citations=qiime2.plugin.Citations.load("citations.bib",
                                           package="q2_winnowing"),
    description=
    "A Qiime2 plugin used to perform a feature selection on data in order to generate a winnowed community."
    " Diversity and Environmental measures can then be performed on this output to measure the connectivity"
    " of the generated winnowed community.",
    short_description=
    "Plugin for performing feature orderings in order to generate winnowed communities."
)

# <><><> Register semantic types and formats <><><>
plugin.register_semantic_types(Winnowed)

# Register the formats defined
plugin.register_formats(WinnowedFeatureOrderingFormat,
                        WinnowedAucOrderingFormat,
                        WinnowedPermanovaOrderingFormat,
                        WinnowedDirectoryFormat)

# Register directory format with semantic type
plugin.register_semantic_type_to_format(
    Winnowed, artifact_format=WinnowedDirectoryFormat)

# <><><> Register functions <><><>

plugin.methods.register_function(
    name='Winnowing Processing Function',
    description=("Perform a feature selection to get the winnowed community."),
    function=process,
    inputs={
        "infile1": FeatureTable[Frequency],
        "infile2": FeatureTable[Frequency]
コード例 #10
0
    website='https://github.com/biocore/q2-fragment-insertion',
    short_description='Plugin for extending phylogenies.',
    package='q2_fragment_insertion',
    user_support_text=('https://github.com/biocore/'
                       'q2-fragment-insertion/issues'),
    citation_text=('Stefan Janssen, Daniel McDonald, Antonio Gonzalez, '
                   'Jose A. Navas-Molina, Lingjing Jiang, '
                   'Zhenjiang Zech Xu, Kevin Winker, Deborah M. Kado, '
                   'Eric Orwoll, Mark Manary, Siavash Mirarab, Rob Knight.'
                   ' "Phylogenetic Placement of Exact Amplicon Sequences '
                   'Improves Associations with Clinical Information." '
                   'mSystems. 2018.')
)


plugin.register_formats(PlacementsFormat, PlacementsDirFmt)
plugin.register_semantic_types(Placements)
plugin.register_semantic_type_to_format(Placements,
                                        artifact_format=PlacementsDirFmt)

_parameter_descriptions = {
    'threads': 'The number of threads to use',
    'alignment_subset_size':
    ('Each placement subset is further broken into subsets of at most these '
     'many sequences and a separate HMM is trained on each subset. The '
     'default alignment subset size is set to balance the exhaustiveness of '
     'the alignment step with the running time.'),
    'placement_subset_size':
    ('The tree is divided into subsets such that each subset includes at most '
     'these many subsets. The placement step places the fragment on only one '
     'subset, determined based on alignment scores. The default placement '
コード例 #11
0

@plugin.register_transformer
def _3(dirfmt: TaxonomicClassifierDirFmt) -> Pipeline:
    raise ValueError('The scikit-learn version could not be determined for'
                     ' this artifact, please retrain your classifier for your'
                     ' current deployment to prevent data-corruption errors.')


@plugin.register_transformer
def _4(fmt: JSONFormat) -> dict:
    with fmt.open() as fh:
        return json.load(fh)


@plugin.register_transformer
def _5(data: dict) -> JSONFormat:
    result = JSONFormat()
    with result.open() as fh:
        json.dump(data, fh)
    return result


# Registrations
plugin.register_semantic_types(TaxonomicClassifier)
plugin.register_formats(TaxonomicClassifierDirFmt,
                        TaxonomicClassiferTemporaryPickleDirFmt)
plugin.register_semantic_type_to_format(
    TaxonomicClassifier,
    artifact_format=TaxonomicClassiferTemporaryPickleDirFmt)
コード例 #12
0
                    int(line.rstrip('\n'))
                except (TypeError, ValueError):
                    return False
            return True


# Define a directory format. A directory format is a directory structure
# composed of one or more files (nested directories are also supported). Each
# file has a specific file format associated with it.  This directory format
# only has a single file, ints.txt, with file format `IntSequenceFormat`.
IntSequenceDirectoryFormat = model.SingleFileDirectoryFormat(
    'IntSequenceDirectoryFormat', 'ints.txt', IntSequenceFormat)

# Register the formats defined above. Formats must be unique across all
# plugins installed on a users system.
plugin.register_formats(IntSequenceFormat, IntSequenceDirectoryFormat)

# Register the directory format with the semantic types defined above. A
# directory format can be registered to multiple semantic types. Currently, a
# semantic type can only have a single directory format associated with it.
plugin.register_semantic_type_to_format(
    IntSequence1, artifact_format=IntSequenceDirectoryFormat)
plugin.register_semantic_type_to_format(
    IntSequence2, artifact_format=IntSequenceDirectoryFormat)


# Define a transformer for converting a file format (`IntSequenceFormat`) into
# a view type (`list` in this case). To indicate that only the QIIME 2
# Framework should interact with a transformer, a non-meaningful name is used.
# The convention is `_<int counter>`, but anything is acceptable. The aim is to
# draw the reader to the function annotations, which convey precisely what the
コード例 #13
0
    name='Visualize feature assignments with an interactive bar plot',
    description='This visualizer produces an interactive barplot visualization'
                ' of the feature assignments. '
                'Interactive features include multi-level '
                'sorting, plot recoloring, sample relabeling, and SVG '
                'figure export.'
)

plugin.visualizers.register_function(
    function=barplot,
    inputs={'proportions': FeatureTable[RelativeFrequency]},
    parameters={'sample_metadata': Metadata,
                'category_column': Str},
    input_descriptions={'proportions': OUT_MEAN},
    parameter_descriptions={'sample_metadata': DESC_MAP,
                            'category_column': DESC_CAT},
    name='Visualize feature assignments with an interactive bar plot',
    description='This visualizer produces an interactive barplot visualization'
                ' of the feature assignments. '
                'Interactive features include multi-level '
                'sorting, plot recoloring, sample relabeling, and SVG '
                'figure export.'
)

plugin.register_semantic_types(SinkSourceMap)
plugin.register_semantic_type_to_format(
    SampleData[SinkSourceMap],
    artifact_format=SinkSourceMapDirectoryFormat)
plugin.register_formats(SinkSourceMapDirectoryFormat)
importlib.import_module('sourcetracker._q2._transformer')
コード例 #14
0
        'regression_stats': SampleData[SongbirdStats],
        'baseline_stats': SampleData[SongbirdStats]
    },
    parameters={},
    input_descriptions={
        'feature_table': ('Input biom table that was used for the '
                          'regression analysis.'),
        'regression_stats': ('results from multinomial regression '
                             'for reference model'),
        'baseline_stats': ('results from multinomial regression '
                           'for baseline model')
    },
    parameter_descriptions={},
    name='Paired regression summary statistics',
    description=("Visualize the convergence statistics of regression fit "
                 "including cross validation accuracy, loglikehood over the "
                 "iterations and the R2."))

# Register types
plugin.register_formats(SongbirdStatsFormat, SongbirdStatsDirFmt)
plugin.register_semantic_types(SongbirdStats)
plugin.register_semantic_type_to_format(SampleData[SongbirdStats],
                                        SongbirdStatsDirFmt)

plugin.register_formats(DifferentialFormat, DifferentialDirFmt)
plugin.register_semantic_types(Differential)
plugin.register_semantic_type_to_format(FeatureData[Differential],
                                        DifferentialDirFmt)

importlib.import_module('songbird.q2._transformer')
コード例 #15
0
    output_descriptions={'curated_metadata': 'The curated sample metadata.'},
    name='Normalize metadata',
    description='Normalize metadata according to a series of rules.'
)


plugin.visualizers.register_function(
    function=tabulate,
    inputs={},
    parameters={
        'input': qiime2.plugin.Metadata,
        'page_size': qiime2.plugin.Int,
    },
    parameter_descriptions={
        'input': 'The metadata to tabulate.',
        'page_size': 'The maximum number of Metadata records to display '
                     'per page',
    },
    name='Interactively explore Metadata in an HTML table',
    description='Generate a tabular view of Metadata. The output '
                'visualization supports interactive filtering, sorting, and '
                'exporting to common file formats.',
)


plugin.register_semantic_types(MetadataX)
plugin.register_semantic_type_to_format(
    MetadataX, artifact_format=MetadataDirectoryFormat
)
plugin.register_formats(MetadataFormat, MetadataDirectoryFormat)
importlib.import_module('q2_metadata._transformer')
コード例 #16
0
ファイル: plugin_setup.py プロジェクト: zydcat89/mmvec
        'normalize': 'Optionally normalize heatmap values by columns or rows.',
        'top_k_metabolites': 'Select top k metabolites associated with each '
                             'of the chosen features to display on heatmap.',
        'keep_top_samples': 'Display only samples in which at least one of '
                            'the selected microbes is the most abundant '
                            'feature.',
        'level': 'taxonomic level for annotating clustermap. Set to -1 if not '
                 'parsing semicolon-delimited taxonomies or wish to print '
                 'entire annotation.',
        'row_center': 'Center conditional probability table '
                      'around average row.'
    },
    name='Paired feature abundance heatmaps',
    description="Generate paired heatmaps that depict microbial and "
                "metabolite feature abundances. The left panel displays the "
                "abundance of each selected microbial feature in each sample. "
                "The right panel displays the abundances of the top k "
                "metabolites most highly correlated with these microbes in "
                "each sample. The y-axis (sample axis) is shared between each "
                "panel.",
    citations=[]
)


plugin.register_formats(ConditionalFormat, ConditionalDirFmt)
plugin.register_semantic_types(Conditional)
plugin.register_semantic_type_to_format(
    FeatureData[Conditional], ConditionalDirFmt)

importlib.import_module('mmvec.q2._transformer')
コード例 #17
0
    MetaStormsSearchResultsFmt, MetaStormsSearchResultsDirFmt,
    MetaStormsMetaResultsFmt, MetaStormsMetaResultsDirFmt,
    MetaStormsMNSResultsFmt, MetaStormsMNSResultsDirFmt)

plugin = qiime2.plugin.Plugin(
    name='metastorms',
    version='std 2.2.1',
    website='https://github.com/qibebt-bioinfo/q2-metastorms',
    package='q2_metastorms',
    citations=qiime2.plugin.Citations.load('citations.bib',
                                           package='q2_metastorms'),
    description='This QIIME 2 plugin supports standalone implementation of '
    'Microbiome Search Engine (MSE; http://mse.single-cell.cn).',
    short_description='Plugin for search in a micriobiome database.')

plugin.register_formats(MetaStormsOTUDatabaseFmt, MetaStormsOTUDatabaseDirFmt)
plugin.register_formats(MetaStormsSPDatabaseFmt, MetaStormsSPDatabaseDirFmt)
plugin.register_formats(MetaStormsFUNCDatabaseFmt,
                        MetaStormsFUNCDatabaseDirFmt)
plugin.register_formats(MetaStormsSearchResultsFmt,
                        MetaStormsSearchResultsDirFmt)
plugin.register_formats(MetaStormsMetaResultsFmt, MetaStormsMetaResultsDirFmt)
plugin.register_formats(MetaStormsMNSResultsFmt, MetaStormsMNSResultsDirFmt)

plugin.register_semantic_types(MetaStormsOTUDatabase)
plugin.register_semantic_type_to_format(
    MetaStormsOTUDatabase, artifact_format=MetaStormsOTUDatabaseDirFmt)

plugin.register_semantic_types(MetaStormsSPDatabase)
plugin.register_semantic_type_to_format(
    MetaStormsSPDatabase, artifact_format=MetaStormsSPDatabaseDirFmt)
コード例 #18
0
        'table will be presented as hashes of the '
        'sequences defining each feature. The hash '
        'will always be the same for the same sequence '
        'so this allows feature tables to be merged '
        'across runs of this method. You should only '
        'merge tables if the exact same parameters are '
        'used for each run.',
        'retain_all_samples':
        'If True all samples input to dada2 will be '
        'retained in the output of dada2, if false '
        'samples with zero total frequency are removed '
        'from the table.'
    },
    output_descriptions={
        'table':
        'The resulting feature table.',
        'representative_sequences':
        'The resulting feature sequences. Each '
        'feature in the feature table will be '
        'represented by exactly one sequence.'
    },
    name='Denoise and dereplicate single-end pyrosequences',
    description='This method denoises single-end pyrosequencing sequences, '
    'dereplicates them, and filters chimeras.')

plugin.register_formats(DADA2StatsFormat, DADA2StatsDirFmt)
plugin.register_semantic_types(DADA2Stats)
plugin.register_semantic_type_to_format(SampleData[DADA2Stats],
                                        DADA2StatsDirFmt)
importlib.import_module('q2_dada2._transformer')
コード例 #19
0
ファイル: plugin_setup.py プロジェクト: LadnerLab/q2-pepsirf
    name='pepsirf',
    version=q2_pepsirf.__version__,
    website='https://github.com/LadnerLab/q2-pepsirf',
    package='q2_pepsirf',
    user_support_text=None,
    short_description='Plugin for pepsirf.',
    description=('This QIIME2 plugin wraps pep_sirf, '
                 'where each module in pep_sirf has at least '
                 'command. To get specific information about each '
                 'module and its commands.'),
    citations=None)

plugin.register_formats(LinkedSpeciesPeptideFmt, LinkedSpeciesPeptideDirFmt,
                        SequenceNamesFmt, SequenceNamesDirFmt,
                        ProteinSequenceFmt, ProteinSequenceDirFmt,
                        TaxIdLineageFmt, TaxIdLineageDirFmt,
                        EnrichedPeptideFmt, EnrichedPeptideDirFmt,
                        DeconvolutedSpeciesFmt, DeconvolutedSpeciesDirFmt,
                        SpeciesAssignMapFmt, SpeciesAssignMapDirFmt)
plugin.register_semantic_types(LinkedSpeciesPeptide, SequenceNames,
                               ProteinSequence, TaxIdLineage, EnrichedPeptide,
                               DeconvolutedSpecies, SpeciesAssignMap)

plugin.register_semantic_type_to_format(
    FeatureTable[DeconvolutedSpecies],
    artifact_format=DeconvolutedSpeciesDirFmt)
plugin.register_semantic_type_to_format(
    LinkedSpeciesPeptide, artifact_format=LinkedSpeciesPeptideDirFmt)
plugin.register_semantic_type_to_format(SequenceNames,
                                        artifact_format=SequenceNamesDirFmt)
plugin.register_semantic_type_to_format(FeatureData[ProteinSequence],
コード例 #20
0
from ._format import (EMPMultiplexedDirFmt, EMPSingleEndDirFmt,
                      EMPSingleEndCasavaDirFmt, EMPPairedEndDirFmt,
                      EMPPairedEndCasavaDirFmt)

plugin = qiime2.plugin.Plugin(name='demux',
                              version=q2_demux.__version__,
                              website='https://github.com/qiime2/q2-demux',
                              package='q2_demux',
                              user_support_text=None,
                              citation_text=None)

plugin.register_semantic_types(RawSequences, EMPSingleEndSequences,
                               EMPPairedEndSequences)

plugin.register_formats(EMPMultiplexedDirFmt, EMPSingleEndDirFmt,
                        EMPSingleEndCasavaDirFmt, EMPPairedEndDirFmt,
                        EMPPairedEndCasavaDirFmt)

# TODO: remove when aliasing exists
plugin.register_semantic_type_to_format(RawSequences,
                                        artifact_format=EMPSingleEndDirFmt)

plugin.register_semantic_type_to_format(EMPSingleEndSequences,
                                        artifact_format=EMPSingleEndDirFmt)

plugin.register_semantic_type_to_format(EMPPairedEndSequences,
                                        artifact_format=EMPPairedEndDirFmt)

plugin.methods.register_function(
    function=q2_demux.emp_single,
    # TODO: remove RawSequences by creating an alias to EMPSequences
コード例 #21
0
from q2_abundance_filtering._format import AbundanceFilteringStatsFmt, AbundanceFilteringStatsDirFmt

plugin = qiime2.plugin.Plugin(
    name='abundance-filtering',
    version=q2_abundance_filtering.__version__,
    website='https://github.com/bassio/q2-abundance-filtering',
    package='q2_abundance_filtering',
    user_support_text=None,
    short_description=
    'Plugin for abundance filtration of sequences according to the method of Wang et al.',
    description=
    ('This plugin filters out sequences according to the method of Wang et al.'
     ),
    citations=[citations['Wang2018']])

plugin.register_formats(AbundanceFilteringStatsFmt,
                        AbundanceFilteringStatsDirFmt)
plugin.register_semantic_types(AbundanceFilteringStats)
plugin.register_semantic_type_to_format(
    AbundanceFilteringStats, artifact_format=AbundanceFilteringStatsDirFmt)

plugin.methods.register_function(
    function=q2_abundance_filtering.abundance_filter,
    inputs={
        'sequences':
        SampleData[JoinedSequencesWithQuality | SequencesWithQuality]
    },
    parameters={
        'threads': qiime2.plugin.Int % qiime2.plugin.Range(1, None),
    },
    outputs=[('filtered_sequences', SampleData[SequencesWithQuality]),
             ('stats', AbundanceFilteringStats)],
コード例 #22
0
from q2_deblur._type import DeblurStats
from q2_deblur._format import DeblurStatsFmt, DeblurStatsDirFmt

citations = qiime2.plugin.Citations.load('citations.bib', package='q2_deblur')

plugin = qiime2.plugin.Plugin(
    name='deblur',
    version=q2_deblur.__version__,
    website='https://github.com/biocore/deblur',
    package='q2_deblur',
    citations=[citations['amir2017deblur']],
    description=('This QIIME 2 plugin wraps the Deblur software for '
                 'performing sequence quality control.'),
    short_description='Plugin for sequence quality control with Deblur.')

plugin.register_formats(DeblurStatsFmt, DeblurStatsDirFmt)
plugin.register_semantic_types(DeblurStats)
plugin.register_semantic_type_to_format(DeblurStats,
                                        artifact_format=DeblurStatsDirFmt)

_parameter_descriptions = {
    'mean_error': ("The mean per nucleotide error, used for original "
                   "sequence estimate."),
    'indel_prob': ('Insertion/deletion (indel) probability (same for N '
                   'indels).'),
    'indel_max':
    "Maximum number of insertion/deletions.",
    'trim_length':
    "Sequence trim length, specify -1 to disable trimming.",
    'left_trim_len':
    "Sequence trimming from the 5' end. A value of 0 will "
コード例 #23
0
ファイル: plugin_setup.py プロジェクト: sangtaepark1973/mmvec
        'baseline_stats': SampleData[MMvecStats]
    },
    parameters={},
    input_descriptions={
        'model_stats':
        ("Summary information for the reference model, produced by running "
         "`qiime mmvec paired-omics`."),
        'baseline_stats':
        ("Summary information for the baseline model, produced by running "
         "`qiime mmvec paired-omics`.")
    },
    parameter_descriptions={},
    name='Paired MMvec summary statistics',
    description=(
        "Visualize the convergence statistics from two MMvec models, "
        "giving insight into how the models fit to your data. "
        "The produced visualization includes a 'pseudo-Q-squared' value."))

# Register types
plugin.register_formats(MMvecStatsFormat, MMvecStatsDirFmt)
plugin.register_semantic_types(MMvecStats)
plugin.register_semantic_type_to_format(SampleData[MMvecStats],
                                        MMvecStatsDirFmt)

plugin.register_formats(ConditionalFormat, ConditionalDirFmt)
plugin.register_semantic_types(Conditional)
plugin.register_semantic_type_to_format(FeatureData[Conditional],
                                        ConditionalDirFmt)

importlib.import_module('mmvec.q2._transformer')
コード例 #24
0
plugin.visualizers.register_function(
    function=summarize_paired,
    inputs={
        'regression_stats': SampleData[SongbirdStats],
        'baseline_stats': SampleData[SongbirdStats]
    },
    parameters={},
    input_descriptions={
        'regression_stats':
        ("Summary information for the reference model, produced by running "
         "`qiime songbird multinomial`."),
        'baseline_stats':
        ("Summary information for the baseline model, produced by running "
         "`qiime songbird multinomial`.")
    },
    parameter_descriptions={},
    name='Paired regression summary statistics',
    description=(
        "Visualize the convergence statistics from two runs of multinomial "
        "regression, giving insight into how the models fit to your data. "
        "The produced visualization includes a 'pseudo-Q-squared' value."))

# Register types
plugin.register_formats(SongbirdStatsFormat, SongbirdStatsDirFmt)
plugin.register_semantic_types(SongbirdStats)
plugin.register_semantic_type_to_format(SampleData[SongbirdStats],
                                        SongbirdStatsDirFmt)

importlib.import_module('songbird.q2._transformer')
コード例 #25
0
    'Shiffer A, McDonald D, Knight R, Caporaso JG, Kelley ST. '
    '2016. Ghost-tree: creating hybrid-gene phylogenetic trees '
    'for diversity analyses. Microbiome',
    version=q2_ghost_tree.__version__,
    website='https://github.com/JTFouquier/ghost-tree',
    package='q2_ghost_tree',
    user_support_text=None,
    citation_text='Fouquier J, Rideout JR, Bolyen E, Chase J, Shiffer A, '
    'McDonald D, Knight R, Caporaso JG, Kelley ST. 2016. '
    'Ghost-tree: creating hybrid-gene phylogenetic trees for '
    'diversity analyses. Microbiome',
    short_description='Plugin for creating hybrid-gene phylogenetic trees.',
)

OtuMap = qiime2.plugin.SemanticType('OtuMap')
plugin.register_formats(OtuMapFormat, OtuMapDirectoryFormat)
plugin.register_semantic_types(OtuMap)
plugin.register_semantic_type_to_format(OtuMap,
                                        artifact_format=OtuMapDirectoryFormat)

graft_level = qiime2.plugin
graft_level = graft_level.Str % \
              graft_level.Choices({'p', 'c', 'o', 'f', 'g'})

plugin.methods.register_function(
    function=scaffold_hybrid_tree_foundation_alignment,
    inputs={
        'otu_map': OtuMap,  # ghost-tree semantic type
        'extension_taxonomy': FeatureData[Taxonomy],
        'extension_sequences': FeatureData[Sequence],
        'foundation_alignment': FeatureData[AlignedSequence],