Deblur --p-trim-length deactivation failure

Hi everyone,

I am trying to use deblur to denoise my 16S data from Ion Torrent PGM. My seqs are around 300-400 bp, and nearly all of them have very good q-score (>20). I try to type –p-trim-length -1 as tutorial suggested to deactivate the command, but receiving errors:

Command ‘[‘deblur’, ‘workflow’, ‘–seqs-fp’, ‘/var/folders/lz/dshtc4351ns3418pq2yq5wph0000gn/T/qiime2-archive-g1g6ec8f/e8827318-b6d8-49b5-8ed2-a48574d85c25/data’, ‘–output-dir’, ‘/var/folders/lz/dshtc4351ns3418pq2yq5wph0000gn/T/tmpvc8yw8ke’, ‘–mean-error’, ‘0.005’, ‘–indel-prob’, ‘0.01’, ‘–indel-max’, ‘3’, ‘–trim-length’, ‘-1’, ‘–min-reads’, ‘10’, ‘–min-size’, ‘2’, ‘–jobs-to-start’, ‘1’, ‘-w’]’ returned non-zero exit status 1

Any idea to solve this problem?

If I give command –p-trim-length 350, will the seqs that are shorter than 350 bp be removed? That will lead to significant data loss.

Thanks so much!

Hi @Harry! Can you please provide the following info?

  1. Which release of qiime2 are you using? Use qiime info to find that out.

  2. What is the exact command you’re running?

  3. Can you either 1) rerun the command with --verbose and paste the full output, or 2) post the contents of the debug log file that is included in the output?


I’m not sure what happens in that case. @wasade or @antgonza, can you weigh in here?

1 Like

Hi @Harry,

The Deblur algorithm needs the sequences to be the same length. I suspect that specifying --verbose on the run will indicate the issue. Using --p-trim-length 350 will trim your reads to a maximum of 350nt, and anything less than 350nt will be dropped.

Please note that Deblur has not been evaluated with Ion Torrent and its error profiles are based off of Illumina data.



Thank you Daniel and Jai!

May I know your suggestion of processing Ion Torrent data? Should I use dada2? (Which also seems to be based on Illumina), but trim the first 15 bp?

Data2 takes much longer time (several days), not sure whether it works.

Thanks a lot.

Hi Jai,

Below is the return on verbose.

(qiime2-2017.10) dyn-160-39-172-19:Qiime_Good Harry$ qiime deblur denoise-16S --i-demultiplexed-seqs gi-filtered.qza **--p-trim-length -1** --o-representative-sequences rep-seqs-deblur2.qza --o-table table-deblur2-1.qza --o-stats deblur2-stats.qza --verbose
Traceback (most recent call last):
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/bin/deblur", line 4, in <module>
    __import__('pkg_resources').run_script('deblur==1.0.3', 'deblur')
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/pkg_resources/", line 748, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/pkg_resources/", line 1517, in run_script
    exec(code, namespace, namespace)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/deblur-1.0.3-py3.5.egg-info/scripts/deblur", line 684, in <module>
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/click/", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/click/", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/click/", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/click/", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/click/", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/deblur-1.0.3-py3.5.egg-info/scripts/deblur", line 632, in workflow
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/deblur/", line 879, in launch_workflow
    error_dist, indel_prob, indel_max)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/deblur/", line 114, in deblur
    seqs = get_sequences(input_seqs)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/deblur/", line 65, in get_sequences
    ", ".join(map(str, unaligned_lengths))))
ValueError: **Not all sequence have the same length.** Aligned lengths: 630, sequence lengths: 386, 315, 319, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 366, 368, 376
Traceback (most recent call last):
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/q2cli/", line 218, in __call__
    results = action(**arguments)
  File "<decorator-gen-328>", line 2, in denoise_16S
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/qiime2/sdk/", line 220, in bound_callable
    output_types, provenance)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/qiime2/sdk/", line 355, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/q2_deblur/", line 96, in denoise_16S
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/q2_deblur/", line 163, in _denoise_helper, check=True)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/", line 398, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['deblur', 'workflow', '--seqs-fp', '/var/folders/lz/dshtc4351ns3418pq2yq5wph0000gn/T/qiime2-archive-kq94fo7s/e8827318-b6d8-49b5-8ed2-a48574d85c25/data', '--output-dir', '/var/folders/lz/dshtc4351ns3418pq2yq5wph0000gn/T/tmpdz2g9rzq', '--mean-error', '0.005', '--indel-prob', '0.01', '--indel-max', '3', '--trim-length', '-1', '--min-reads', '10', '--min-size', '2', '--jobs-to-start', '1', '-w']' returned non-zero exit status 1

Plugin error from deblur:

  Command '['deblur', 'workflow', '--seqs-fp', '/var/folders/lz/dshtc4351ns3418pq2yq5wph0000gn/T/qiime2-archive-kq94fo7s/e8827318-b6d8-49b5-8ed2-a48574d85c25/data', '--output-dir', '/var/folders/lz/dshtc4351ns3418pq2yq5wph0000gn/T/tmpdz2g9rzq', '--mean-error', '0.005', '--indel-prob', '0.01', '--indel-max', '3', '--trim-length', '-1', '--min-reads', '10', '--min-size', '2', '--jobs-to-start', '1', '-w']' returned non-zero exit status 1

See above for debug info.

probably that is the issue that the length of the sequences are not the same.

Hi @Harry!

I am not sure which tutorial you are reading that suggestion in (this doesn’t sound familiar to me), but, if you check out the docs for q2-deblur, you can learn the following about the --p-trim-length parameter:

Sequence trim length, specify -1 to disable trimming.

So, when you specify -1, none of your sequences are being trimmed. That in and of itself isn’t a problem - if your sequences were all the same length this setting would work just fine. As @wasade mentioned above, the trimming doesn’t just impact the longer sequences — trimming also drops sequences shorter than the specified length. Ultimately, the trimming ensures that all sequences are the same length! Since yours aren’t, and you are disabling this, that would explain your error.

I would suggest revisiting your demux summarize visualization, and come up with a good value for your trim length! :t_rex:

1 Like

Also, may I know, if dada2 has the similar mechanism as deblur, for --p-trunc-len, if I set 350, will those seqs shorter than 350 bp be dropped?

I really appreciate your unreservable help and suggestions. Happy Thanksgiving!

Hey @Harry,

Yup, denoise-single and denoise-paired both have equivalent parameters! We tried to make sure those parameters behaved the same (and had the same name) for convenience.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.