# Deblur --p-trim-length deactivation failure

**URL:** https://forum.qiime2.org/t/deblur-p-trim-length-deactivation-failure/1880
**Category:** User Support
**Tags:** deblur
**Created:** [November 16, 2017, 7:06pm UTC](https://forum.qiime2.org/t/deblur-p-trim-length-deactivation-failure/1880 "2017-11-16T19:06:59Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Harry](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/h/f6c823/32.png) [@Harry](https://forum.qiime2.org/u/Harry)
#### Post date: [November 16, 2017, 7:06pm UTC](https://forum.qiime2.org/t/deblur-p-trim-length-deactivation-failure/1880/1 "2017-11-16T19:06:59Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![jairideout](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jairideout/32/9_2.png) [@jairideout](https://forum.qiime2.org/u/jairideout)
#### Post date: [November 17, 2017, 9:47pm UTC](https://forum.qiime2.org/t/deblur-p-trim-length-deactivation-failure/1880/3 "2017-11-17T21:47:39Z")

</div>

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?

Thanks!

> [@Harry](#):
>
> 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.

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

---

<div class="post-metadata">

### Author: ![wasade](https://forum.qiime2.org/user_avatar/forum.qiime2.org/wasade/32/2317_2.png) [@wasade](https://forum.qiime2.org/u/wasade)
#### Post date: [November 20, 2017, 3:45pm UTC](https://forum.qiime2.org/t/deblur-p-trim-length-deactivation-failure/1880/5 "2017-11-20T15:45:43Z")

</div>

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.

Best,  
Daniel

---

<div class="post-metadata">

### Author: ![Harry](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/h/f6c823/32.png) [@Harry](https://forum.qiime2.org/u/Harry)
#### Post date: [November 22, 2017, 2:30am UTC](https://forum.qiime2.org/t/deblur-p-trim-length-deactivation-failure/1880/6 "2017-11-22T02:30:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Harry](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/h/f6c823/32.png) [@Harry](https://forum.qiime2.org/u/Harry)
#### Post date: [November 22, 2017, 2:37am UTC](https://forum.qiime2.org/t/deblur-p-trim-length-deactivation-failure/1880/7 "2017-11-22T02:37:48Z")

</div>

Hi Jai,

Below is the return on verbose.

```bash
(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/ __init__.py", 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/ __init__.py", 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>
    deblur_cmds()
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/click/core.py", 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/core.py", 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/core.py", 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
    threads_per_sample=threads_per_sample)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/deblur/workflow.py", 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/deblurring.py", line 114, in deblur
    seqs = get_sequences(input_seqs)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/deblur/deblurring.py", 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/commands.py", 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/action.py", line 220, in bound_callable
    output_types, provenance)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/qiime2/sdk/action.py", 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/_denoise.py", line 96, in denoise_16S
    hashed_feature_ids=hashed_feature_ids)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/site-packages/q2_deblur/_denoise.py", line 163, in _denoise_helper
    subprocess.run(cmd, check=True)
  File "/Users/Harry/miniconda3/envs/qiime2-2017.10/lib/python3.5/subprocess.py", 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.

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [November 22, 2017, 12:44pm UTC](https://forum.qiime2.org/t/deblur-p-trim-length-deactivation-failure/1880/9 "2017-11-22T12:44:24Z")

</div>

Hi @Harry!

> [@Harry](#):
>
> I try to type –p-trim-length -1 as tutorial suggested to

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](https://docs.qiime2.org/2017.10/plugins/available/deblur/denoise-16S/), 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`](https://docs.qiime2.org/2017.10/plugins/available/demux/summarize/) visualization, and come up with a good value for your trim length! 🦖

---

<div class="post-metadata">

### Author: ![Harry](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/h/f6c823/32.png) [@Harry](https://forum.qiime2.org/u/Harry)
#### Post date: [November 22, 2017, 10:34pm UTC](https://forum.qiime2.org/t/deblur-p-trim-length-deactivation-failure/1880/11 "2017-11-22T22:34:02Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![ebolyen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ebolyen/32/11_2.png) [@ebolyen](https://forum.qiime2.org/u/ebolyen)
#### Post date: [November 27, 2017, 5:47pm UTC](https://forum.qiime2.org/t/deblur-p-trim-length-deactivation-failure/1880/14 "2017-11-27T17:47:19Z")

</div>

Hey @Harry,

> [@Harry](#):
>
> 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?

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.

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [December 28, 2017, 11:47pm UTC](https://forum.qiime2.org/t/deblur-p-trim-length-deactivation-failure/1880/16 "2017-12-28T23:47:26Z")

</div>

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