# Issues with Quality Control and Pair End Joining

**URL:** <https://forum.qiime2.org/t/issues-with-quality-control-and-pair-end-joining/15117>\
**Category:** Technical Support\
**Created:** [May 27, 2020, 4:07am UTC](https://forum.qiime2.org/t/issues-with-quality-control-and-pair-end-joining/15117 "2020-05-27T04:07:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bill\_Yen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/bill_yen/32/8182_2.png) [@Bill\_Yen](https://forum.qiime2.org/u/Bill_Yen)\
**Post date:** [May 27, 2020, 4:07am UTC](https://forum.qiime2.org/t/issues-with-quality-control-and-pair-end-joining/15117/1 "2020-05-27T04:07:11Z")

</div>

Hello all! I am new to Qiime2, and after finally being able to import stuff into the virtual machine, I am having some problem doing quality control and pair end joining with my test data. I am running qiime2-2020.2 via Virtualbox, and below is my code (with verbose) and its associated error:

**Code:**  
qiime dada2 denoise-paired --i-demultiplexed-seqs demux-paired-end.qza --p-trunc-len-f 230 --p-trunc-len-r 210 --p-trim-left-f 19 --p-trim-left-r 20 --p-n-threads 7 --o-representative-sequences dada2\_rep\_seq\_16s.qza --o-table dada2\_table\_feature.qza --p-trunc-q 10 --p-max-ee-f 2.5 --o-denoising-stats dada2\_denoise --verbose

**Error:**  
Running external command line application(s). This may print messages to stdout and/or stderr.  
The command(s) being run are below. These commands cannot be manually re-run as they will depend on temporary files that no longer exist.

Command: run\_dada\_paired.R /tmp/tmp6w2ny275/forward /tmp/tmp6w2ny275/reverse /tmp/tmp6w2ny275/output.tsv.biom /tmp/tmp6w2ny275/track.tsv /tmp/tmp6w2ny275/filt\_f /tmp/tmp6w2ny275/filt\_r 230 210 19 20 2.5 2.0 10 consensus 1.0 7 1000000

R version 3.5.1 (2018-07-02)  
Loading required package: Rcpp  
DADA2: 1.10.0 / Rcpp: 1.0.3 / RcppParallel: 4.4.4

1. Filtering Error in names(answer) \<- names1 :  
'names' attribute [22] must be the same length as the vector [6]  
Execution halted  
Traceback (most recent call last):  
File "/home/qiime2/miniconda/envs/qiime2-2020.2/lib/python3.6/site-packages/q2\_dada2/\_denoise.py", line 257, in denoise\_paired  
run\_commands([cmd])  
File "/home/qiime2/miniconda/envs/qiime2-2020.2/lib/python3.6/site-packages/q2\_dada2/\_denoise.py", line 36, in run\_commands  
subprocess.run(cmd, check=True)  
File "/home/qiime2/miniconda/envs/qiime2-2020.2/lib/python3.6/subprocess.py", line 418, in run  
output=stdout, stderr=stderr)  
subprocess.CalledProcessError: Command '['run\_dada\_paired.R', '/tmp/tmp6w2ny275/forward', '/tmp/tmp6w2ny275/reverse', '/tmp/tmp6w2ny275/output.tsv.biom', '/tmp/tmp6w2ny275/track.tsv', '/tmp/tmp6w2ny275/filt\_f', '/tmp/tmp6w2ny275/filt\_r', '230', '210', '19', '20', '2.5', '2.0', '10', 'consensus', '1.0', '7', '1000000']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File "/home/qiime2/miniconda/envs/qiime2-2020.2/lib/python3.6/site-packages/q2cli/commands.py", line 328, in **call**  
results = action(\*\*arguments)  
File "\</home/qiime2/miniconda/envs/qiime2-2020.2/lib/python3.6/site-packages/decorator.py:decorator-gen-455\>", line 2, in denoise\_paired  
File "/home/qiime2/miniconda/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound\_callable  
output\_types, provenance)  
File "/home/qiime2/miniconda/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 390, in _callable\_executor_  
output\_views = self.\_callable(\*\*view\_args)  
File "/home/qiime2/miniconda/envs/qiime2-2020.2/lib/python3.6/site-packages/q2\_dada2/\_denoise.py", line 272, in denoise\_paired  
" and stderr to learn more." % e.returncode)  
Exception: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.

What does this error mean? It seems like there is a mismatch between the length of my attribute and the length of my vector, but I'm not sure how to fix it. Thank you for all of your support!

---

<div class="post-metadata">

**Author:** ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)\
**Post date:** [May 27, 2020, 9:57am UTC](https://forum.qiime2.org/t/issues-with-quality-control-and-pair-end-joining/15117/2 "2020-05-27T09:57:32Z")

</div>

Hi @Bill_Yen,  
We see this error pop up when the user is assigning more threads than their system can allocate.  
In your case its possible that you are still using default VB settings which only assigns 1 thread to that environment, therefore when you are calling 7 threads it is not able to find them/allocate them.  
So you can try either a) changing the VB settings to assign more threads to that environment or b) reducing `--p-n-threads 7` to 1 and see if that solves the problem. I would go with option a) personally.  
Note that sometimes even with enough threads available, we see this error pop up when the system can't for some reason allocate to those threads. In those cases simply assigning less threads (from 7 to say 4) also seems to solve the problem.

---

<div class="post-metadata">

**Author:** ![Bill\_Yen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/bill_yen/32/8182_2.png) [@Bill\_Yen](https://forum.qiime2.org/u/Bill_Yen)\
**Post date:** [May 27, 2020, 3:47pm UTC](https://forum.qiime2.org/t/issues-with-quality-control-and-pair-end-joining/15117/3 "2020-05-27T15:47:29Z")

</div>

I have upped the number of CPUs allocated to the system to 3 out of the maximum 4 allowed on my computer, and tried to run the same code, but the same error occurred. I then downed --p-n-threads to just 1, and now the terminal seems to be frozen. I tried --p-n-threads 4 as well and it also froze there. What should I do from here? Also, is there a way to run these code from file instead of directly through the terminal to avoid typing the same thing over again after the virtual machine powers off?

---

<div class="post-metadata">

**Author:** ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)\
**Post date:** [May 27, 2020, 8:23pm UTC](https://forum.qiime2.org/t/issues-with-quality-control-and-pair-end-joining/15117/5 "2020-05-27T20:23:02Z")

</div>

Hi @Bill_Yen,  
I probably should have mentioned this alongside my last suggestion (thanks @thermokarst). You also want to make sure you are assigning a reasonable amount of memory to the VB as well. As you increase # of threads, the amount of memory requirement also goes up. How much RAM is available to this environment? If you can allocate at least 6-8 Gigs of RAM to your VB, then dada2 should run fine with 3 threads (assuming your data is not a crazy large set).

> [@Bill\_Yen](#):
>
> and now the terminal seems to be frozen.

Can you elaborate? When a process is running the terminal window wouldn't show you a prompt line, and you won't be able to run anything else until that just is completed or terminated (ctrl + c). This to me says that DADA2 is working. However with 1 thread and the very low default VB memory allocation this might take a very long time. So you can either let it run to completion which might take a while, or you can terminate the task, restart VB with more RAM designated and try again with 3 threads.

> [@Bill\_Yen](#):
>
> Also, is there a way to run these code from file instead of directly through the terminal to avoid typing the same thing over again after the virtual machine powers off?

Sure, you could write a script to run whatever you want but probably an easier solution for you since you're just starting out and will likely be making a lot of changes to your scripts is to simply type the commands in a text editor, Ubuntu VM I think comes with a plain text editor or g-edit (maybe?) and copy paste from that. You can also use the up/down arrow key to go through the history of your previous commands ran in terminal and just pick the last command you executed so you don't have to re-type everything. Type history to see a full list of previous commands you ran.

---

<div class="post-metadata">

**Author:** ![Bill\_Yen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/bill_yen/32/8182_2.png) [@Bill\_Yen](https://forum.qiime2.org/u/Bill_Yen)\
**Post date:** [May 27, 2020, 8:46pm UTC](https://forum.qiime2.org/t/issues-with-quality-control-and-pair-end-joining/15117/6 "2020-05-27T20:46:41Z")

</div>

I am currently assigning 5053 MB to the VirtualBox base memory, and what I meant by the terminal being frozen is that it wouldn't show me a prompt line. I can still type stuff or terminate it, but nothing will happen since it is still running DADA2 as you said. I let it sit for a while but nothing happened, so I terminated the terminal. Below is a screen shot of what this looks like for reference:

 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/a/adb2f3e2cf4cf0b3349a60752dfc601909594125.png)

\*Update: I waited for 30 minutes, and the command eventually finished running. However, now I ran into an even more troubling problem of the virtual disk image using up all the space on my laptop when I tried to do taxonomy annotation (code included below). After downloading the silva classifier and running the command with it, the VDI ballooned in size to the point where it’s now 48.3 GB, and the virtual machine had to be paused because my computer had no more storage (It has 213 GB total).  
**Code:**  
qiime feature-classifier classify-sklearn --i-classifier '/home/qiime2/Desktop/silva-132-99-515-806-nb-classifier.qza' --i-reads dada2\_rep\_seq\_16s.qza --o-classification taxonomy.qza

Since this is now a slightly different issue, should I turn this into a new post? Thanks!

---

<div class="post-metadata">

**Author:** ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)\
**Post date:** [May 28, 2020, 7:16am UTC](https://forum.qiime2.org/t/issues-with-quality-control-and-pair-end-joining/15117/7 "2020-05-28T07:16:51Z")

</div>

Hi @Bill_Yen,  
Glad you got the problem sorted! 30 minutes is pretty quick actually for dada2 on low threads/memory. Glad to hear it.

> [@Bill\_Yen](#):
>
> Since this is now a slightly different issue, should I turn this into a new post? Thanks!

Yes please! Also I should note that this is a common problem with the silva database and you can easily search the forum for your error message and see what the recommended solutions are.

Good luck

---

<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:** [June 28, 2020, 1:21pm UTC](https://forum.qiime2.org/t/issues-with-quality-control-and-pair-end-joining/15117/8 "2020-06-28T13:21:38Z")

</div>

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