Fork me on GitHub

classify-consensus-vsearch: VSEARCH-based consensus taxonomy classifier

Citations
  • Torbjørn Rognes, Tomáš Flouri, Ben Nichols, Christopher Quince, and Frédéric Mahé. Vsearch: a versatile open source tool for metagenomics. PeerJ, 4:e2584, 2016. doi:10.7717/peerj.2584.

Docstring:

Usage: qiime feature-classifier classify-consensus-vsearch
           [OPTIONS]

  Assign taxonomy to query sequences using VSEARCH. Performs VSEARCH global
  alignment between query and reference_reads, then assigns consensus taxonomy
  to each query sequence from among maxaccepts top hits, min_consensus of
  which share that taxonomic assignment. Unlike classify-consensus-blast, this
  method searches the entire reference database before choosing the top N
  hits, not the first N hits.

Inputs:
  --i-query ARTIFACT FeatureData[Sequence]
                          Query Sequences.                          [required]
  --i-reference-reads ARTIFACT FeatureData[Sequence]
                          Reference sequences.                      [required]
  --i-reference-taxonomy ARTIFACT FeatureData[Taxonomy]
                          Reference taxonomy labels.                [required]
Parameters:
  --p-maxaccepts VALUE Int % Range(1, None) | Str % Choices('all')
                          Maximum number of hits to keep for each query. Set
                          to "all" to keep all hits > perc-identity
                          similarity. Note that if strand=both, maxaccepts
                          will keep N hits for each direction (if searches in
                          the opposite direction yield results that exceed the
                          minimum perc-identity). In those cases use maxhits
                          to control the total number of hits returned. This
                          option works in pair with maxrejects. The search
                          process sorts target sequences by decreasing number
                          of k-mers they have in common with the query
                          sequence, using that information as a proxy for
                          sequence similarity. After pairwise alignments, if
                          the first target sequence passes the acceptation
                          criteria, it is accepted as best hit and the search
                          process stops for that query. If maxaccepts is set
                          to a higher value, more hits are accepted. If
                          maxaccepts and maxrejects are both set to "all", the
                          complete database is searched.         [default: 10]
  --p-perc-identity PROPORTION Range(0.0, 1.0, inclusive_end=True)
                          Reject match if percent identity to query is lower.
                                                                [default: 0.8]
  --p-query-cov PROPORTION Range(0.0, 1.0, inclusive_end=True)
                          Reject match if query alignment coverage per
                          high-scoring pair is lower.           [default: 0.8]
  --p-strand TEXT Choices('both', 'plus')
                          Align against reference sequences in forward
                          ("plus") or both directions ("both").
                                                             [default: 'both']
  --p-search-exact / --p-no-search-exact
                          Search for exact full-length matches to the query
                          sequences. Only 100% exact matches are reported and
                          this command is much faster than the default. If
                          True, the perc-identity, query-cov, maxaccepts, and
                          maxrejects settings are ignored. Note: query and
                          reference reads must be trimmed to the exact same
                          DNA locus (e.g., primer site) because only exact
                          matches will be reported.           [default: False]
  --p-top-hits-only / --p-no-top-hits-only
                          Only the top hits between the query and reference
                          sequence sets are reported. For each query, the top
                          hit is the one presenting the highest percentage of
                          identity. Multiple equally scored top hits will be
                          used for consensus taxonomic assignment if
                          maxaccepts is greater than 1.       [default: False]
  --p-maxhits VALUE Int % Range(1, None) | Str % Choices('all')
                          Maximum number of hits to show once the search is
                          terminated.                         [default: 'all']
  --p-maxrejects VALUE Int % Range(1, None) | Str % Choices('all')
                          Maximum number of non-matching target sequences to
                          consider before stopping the search. This option
                          works in pair with maxaccepts (see maxaccepts
                          description for details).           [default: 'all']
  --p-output-no-hits / --p-no-output-no-hits
                          Report both matching and non-matching queries.
                          WARNING: always use the default setting for this
                          option unless if you know what you are doing! If you
                          set this option to False, your sequences and feature
                          table will need to be filtered to exclude
                          unclassified sequences, otherwise you may run into
                          errors downstream from missing feature IDs.
                                                               [default: True]
  --p-weak-id PROPORTION Range(0.0, 1.0, inclusive_end=True)
                          Show hits with percentage of identity of at least
                          N, without terminating the search. A normal search
                          stops as soon as enough hits are found (as defined
                          by maxaccepts, maxrejects, and perc-identity). As
                          weak-id reports weak hits that are not deduced from
                          maxaccepts, high perc-identity values can be used,
                          hence preserving both speed and sensitivity.
                          Logically, weak-id must be smaller than the value
                          indicated by perc-identity, otherwise this option
                          will be ignored.                      [default: 0.0]
  --p-threads NTHREADS    Number of threads to use for job parallelization.
                          Pass 0 to use one per available CPU.    [default: 1]
  --p-min-consensus NUMBER Range(0.5, 1.0, inclusive_start=False,
    inclusive_end=True)   Minimum fraction of assignments must match top hit
                          to be accepted as consensus assignment.
                                                               [default: 0.51]
  --p-unassignable-label TEXT
                          Annotation given to sequences without any hits.
                                                       [default: 'Unassigned']
Outputs:
  --o-classification ARTIFACT FeatureData[Taxonomy]
                          Taxonomy classifications of query sequences.
                                                                    [required]
  --o-search-results ARTIFACT
    FeatureData[BLAST6]   Top hits for each query.                  [required]
Miscellaneous:
  --output-dir PATH       Output unspecified results to a directory
  --verbose / --quiet     Display verbose output to stdout and/or stderr
                          during execution of this action. Or silence output
                          if execution is successful (silence is golden).
  --recycle-pool TEXT     Use a cache pool for pipeline resumption. QIIME 2
                          will cache your results in this pool for reuse by
                          future invocations. These pool are retained until
                          deleted by the user. If not provided, QIIME 2 will
                          create a pool which is automatically reused by
                          invocations of the same action and removed if the
                          action is successful. Note: these pools are local to
                          the cache you are using.
  --no-recycle            Do not recycle results from a previous failed
                          pipeline run or save the results from this run for
                          future recycling.
  --parallel              Execute your action in parallel. This flag will use
                          your default parallel config.
  --parallel-config FILE  Execute your action in parallel using a config at
                          the indicated path.
  --use-cache DIRECTORY   Specify the cache to be used for the intermediate
                          work of this pipeline. If not provided, the default
                          cache under $TMP/qiime2/ will be used.
                          IMPORTANT FOR HPC USERS: If you are on an HPC system
                          and are using parallel execution it is important to
                          set this to a location that is globally accessible
                          to all nodes in the cluster.
  --example-data PATH     Write example data and exit.
  --citations             Show citations and exit.
  --help                  Show this message and exit.

Import:

from qiime2.plugins.feature_classifier.pipelines import classify_consensus_vsearch

Docstring:

VSEARCH-based consensus taxonomy classifier

Assign taxonomy to query sequences using VSEARCH. Performs VSEARCH global
alignment between query and reference_reads, then assigns consensus
taxonomy to each query sequence from among maxaccepts top hits,
min_consensus of which share that taxonomic assignment. Unlike classify-
consensus-blast, this method searches the entire reference database before
choosing the top N hits, not the first N hits.

Parameters
----------
query : FeatureData[Sequence]
    Query Sequences.
reference_reads : FeatureData[Sequence]
    Reference sequences.
reference_taxonomy : FeatureData[Taxonomy]
    Reference taxonomy labels.
maxaccepts : Int % Range(1, None) | Str % Choices('all'), optional
    Maximum number of hits to keep for each query. Set to "all" to keep all
    hits > perc_identity similarity. Note that if strand=both, maxaccepts
    will keep N hits for each direction (if searches in the opposite
    direction yield results that exceed the minimum perc_identity). In
    those cases use maxhits to control the total number of hits returned.
    This option works in pair with maxrejects. The search process sorts
    target sequences by decreasing number of k-mers they have in common
    with the query sequence, using that information as a proxy for sequence
    similarity. After pairwise alignments, if the first target sequence
    passes the acceptation criteria, it is accepted as best hit and the
    search process stops for that query. If maxaccepts is set to a higher
    value, more hits are accepted. If maxaccepts and maxrejects are both
    set to "all", the complete database is searched.
perc_identity : Float % Range(0.0, 1.0, inclusive_end=True), optional
    Reject match if percent identity to query is lower.
query_cov : Float % Range(0.0, 1.0, inclusive_end=True), optional
    Reject match if query alignment coverage per high-scoring pair is
    lower.
strand : Str % Choices('both', 'plus'), optional
    Align against reference sequences in forward ("plus") or both
    directions ("both").
search_exact : Bool, optional
    Search for exact full-length matches to the query sequences. Only 100%
    exact matches are reported and this command is much faster than the
    default. If True, the perc_identity, query_cov, maxaccepts, and
    maxrejects settings are ignored. Note: query and reference reads must
    be trimmed to the exact same DNA locus (e.g., primer site) because only
    exact matches will be reported.
top_hits_only : Bool, optional
    Only the top hits between the query and reference sequence sets are
    reported. For each query, the top hit is the one presenting the highest
    percentage of identity. Multiple equally scored top hits will be used
    for consensus taxonomic assignment if maxaccepts is greater than 1.
maxhits : Int % Range(1, None) | Str % Choices('all'), optional
    Maximum number of hits to show once the search is terminated.
maxrejects : Int % Range(1, None) | Str % Choices('all'), optional
    Maximum number of non-matching target sequences to consider before
    stopping the search. This option works in pair with maxaccepts (see
    maxaccepts description for details).
output_no_hits : Bool, optional
    Report both matching and non-matching queries. WARNING: always use the
    default setting for this option unless if you know what you are doing!
    If you set this option to False, your sequences and feature table will
    need to be filtered to exclude unclassified sequences, otherwise you
    may run into errors downstream from missing feature IDs.
weak_id : Float % Range(0.0, 1.0, inclusive_end=True), optional
    Show hits with percentage of identity of at least N, without
    terminating the search. A normal search stops as soon as enough hits
    are found (as defined by maxaccepts, maxrejects, and perc_identity). As
    weak_id reports weak hits that are not deduced from maxaccepts, high
    perc_identity values can be used, hence preserving both speed and
    sensitivity. Logically, weak_id must be smaller than the value
    indicated by perc_identity, otherwise this option will be ignored.
threads : Threads, optional
    Number of threads to use for job parallelization. Pass 0 to use one per
    available CPU.
min_consensus : Float % Range(0.5, 1.0, inclusive_start=False, inclusive_end=True), optional
    Minimum fraction of assignments must match top hit to be accepted as
    consensus assignment.
unassignable_label : Str, optional
    Annotation given to sequences without any hits.

Returns
-------
classification : FeatureData[Taxonomy]
    Taxonomy classifications of query sequences.
search_results : FeatureData[BLAST6]
    Top hits for each query.