DADA2 troubleshooting_An error was encountered while running DADA2 in R (return code 1)

Hello Colin,

Thank you so much for your reply @colinbrislawn
Initially I also thought it is the length problem. The length of my raw sequence is the same 251 nts. Since the primer in my sequence had slightly different length as I post before in this remove primer with different length. I should get different length for sure. But I do not know how to fix this issues.
But after read more post in the forum and read the error message more carefully. I think the important part of the error message is:
########################################
Error: cannot allocate vector of size 95.4 Mb
Execution halted
Warning message:
system call failed: Cannot allocate memory
Traceback (most recent call last):
#########################################
It seems that the actually error is coming from out of memory which is a common issue in DADA2. So I followed this DADA2 issue in R. I assigned more RAM to the VM (from 4MB to 12 MB) and also decrease the --p-n-reads-learn to 100000.
After doing all these, no error message appeared and I can go through the DADA2 step completely. I got the results finally!

But after merging, for some sequence I only get small read sleft. For one sample, after merging, 0 left.
I totally have 89 samples. However, after merging, 46 of them had less than 500 reads.
I attached the qzv file before doing denoised step, can you please have a look. Based on these quality plot I used (–p-trunc-len-f 0 –p-trunc-len-r 230) in the DADA 2 step. I know that I should probably play around this values and see how the merged reads changes. And I also think about just try the forward and see the results. Can you please give me some suggestions for increasing the merged reads?

One more thing I want to ask is the sequencing length. I think it is fine to have different sequence length for DADA2 denoise step as mentioned in this thread. But why when I run it, DADA2 keep reporting Not all sequences were the same length? Is this message just trying to inform me that I have different length in the sequence. So this different length won't hurt the denoise step?? Can you please help me with this question.
trimmed_remove_primers.qzv (295.9 KB)

Thank you!!