1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2023, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------
from qiime2.plugin import (
Plugin, Float, Bool, Range, Citations, Threads)
from q2_types.feature_data import FeatureData, Sequence, AlignedSequence
import q2_alignment
citations = Citations.load('citations.bib', package='q2_alignment')
plugin = Plugin(
name='alignment',
version=q2_alignment.__version__,
website='https://github.com/qiime2/q2-alignment',
package='q2_alignment',
description=('This QIIME 2 plugin provides support for generating '
'and manipulating sequence alignments.'),
short_description='Plugin for generating and manipulating alignments.'
)
plugin.methods.register_function(
function=q2_alignment.mafft,
inputs={'sequences': FeatureData[Sequence]},
parameters={'n_threads': Threads,
'parttree': Bool},
outputs=[('alignment', FeatureData[AlignedSequence])],
input_descriptions={'sequences': 'The sequences to be aligned.'},
parameter_descriptions={
'n_threads': 'The number of threads. (Use `auto` to automatically use '
'all available cores)',
'parttree': 'This flag is required if the number of sequences being '
'aligned are larger than 1000000. Disabled by default'},
output_descriptions={'alignment': 'The aligned sequences.'},
name='De novo multiple sequence alignment with MAFFT',
description=("Perform de novo multiple sequence alignment using MAFFT."),
citations=[citations['katoh2013mafft']]
)
plugin.methods.register_function(
function=q2_alignment.mafft_add,
inputs={'alignment': FeatureData[AlignedSequence],
'sequences': FeatureData[Sequence]},
parameters={'n_threads': Threads,
'parttree': Bool,
'addfragments': Bool},
outputs=[('expanded_alignment', FeatureData[AlignedSequence])],
input_descriptions={'alignment': 'The alignment to which '
'sequences should be added.',
'sequences': 'The sequences to be added.'},
parameter_descriptions={
'n_threads': 'The number of threads. (Use `auto` to automatically use '
'all available cores)',
'parttree': 'This flag is required if the number of sequences being '
'aligned are larger than 1000000. Disabled by default',
'addfragments': 'Optimize for the addition of short sequence '
'fragments (for example, primer or amplicon '
'sequences). If not set, default sequence addition '
'is used.'},
output_descriptions={
'expanded_alignment': 'Alignment containing the provided aligned and '
'unaligned sequences.'},
name='Add sequences to multiple sequence alignment with MAFFT.',
description='Add new sequences to an existing alignment with MAFFT.',
citations=[citations['katoh2013mafft']]
)
plugin.methods.register_function(
function=q2_alignment.mask,
inputs={'alignment': FeatureData[AlignedSequence]},
parameters={'max_gap_frequency': Float % Range(0, 1, inclusive_end=True),
'min_conservation': Float % Range(0, 1, inclusive_end=True)},
outputs=[('masked_alignment', FeatureData[AlignedSequence])],
input_descriptions={'alignment': 'The alignment to be masked.'},
parameter_descriptions={
'max_gap_frequency': ('The maximum relative frequency of gap '
'characters in a column for the column to be '
'retained. This relative frequency must be a '
'number between 0.0 and 1.0 (inclusive), where '
'0.0 retains only those columns without gap '
'characters, and 1.0 retains all columns '
'regardless of gap character frequency.'),
'min_conservation': ('The minimum relative frequency '
'of at least one non-gap character in a '
'column for that column to be retained. This '
'relative frequency must be a number between 0.0 '
'and 1.0 (inclusive). For example, if a value of '
'0.4 is provided, a column will only be retained '
'if it contains at least one character that is '
'present in at least 40% of the sequences.')
},
output_descriptions={'masked_alignment': 'The masked alignment.'},
name='Positional conservation and gap filtering.',
description=("Mask (i.e., filter) unconserved and highly gapped "
"columns from an alignment. Default min_conservation was "
"chosen to reproduce the mask presented in Lane (1991)."),
citations=[citations['lane1991']]
)
|