ERROR: Qiime 2 alignment mafft

Guys,

I have used the following code for alignment

qiime alignment mafft
–i-sequences rep-seqs.qza
–o-alignment aligned-rep-seqs.qza

Then I got the following error

=============
Plugin error from alignment:

Command ‘[‘mafft’, ‘–preservecase’, ‘–inputorder’, ‘–thread’, ‘1’, ‘/var/folders/0_/kqg94rwj0hn532c1t4jlgtlh1__xx4/T/qiime2-archive-44vauu_e/2fd7ef40-143d-41ac-8ef9-a7b544583ac0/data/dna-sequences.fasta’]’ returned non-zero exit status 1.

Debug info has been saved to /var/folders/0_/kqg94rwj0hn532c1t4jlgtlh1__xx4/T/qiime2-q2cli-err-7s9iz_0t.log

============
And here is the log file content, ANY HELP PLEASE?

Running external command line application. This may print messages to stdout and/or stderr.
The command being run is below. This command cannot be manually re-run as it will depend on temporary files that no longer exist.

Command: mafft --preservecase --inputorder --thread 1 /var/folders/0_/kqg94rwj0hn532c1t4jlgtlh1__xx4/T/qiime2-archive-44vauu_e/2fd7ef40-143d-41ac-8ef9-a7b544583ac0/data/dna-sequences.fasta

inputfile = orig
188388 x 458 - 235 d
nthread = 1
stacksize: 8192 kb->36794 kb
generating a scoring matrix for nucleotide (dist=200) … done
Gap Penalty = -1.53, +0.00, +0.00

Making a distance matrix …
188301 / 188388
done.

/Users/elolimyahmed/miniconda3/envs/qiime2-2020.2/bin/mafft: line 2440: 1326 Killed: 9 “$prefix/disttbfast” -q $npickup -E $cycledisttbfast -V “-”$gopdist -s $unalignlevel $legacygapopt $mergearg -W $tuplesize $termgapopt $outnum $addarg $add2ndhalfarg -C $numthreadstb $memopt $weightopt $treeinopt $treeoutopt $distoutopt $seqtype $model -f “-”$gop -Q $spfactor -h $aof $param_fft $algopt $treealg $scoreoutarg < infile > pre 2>> “$progressfile”
Traceback (most recent call last):
File “/Users/elolimyahmed/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2cli/commands.py”, line 328, in call
results = action(**arguments)
File “</Users/elolimyahmed/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/decorator.py:decorator-gen-473>”, line 2, in mafft
File “/Users/elolimyahmed/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 245, in bound_callable
output_types, provenance)
File “/Users/elolimyahmed/miniconda3/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 “/Users/elolimyahmed/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_alignment/_mafft.py”, line 85, in mafft
run_command(cmd, aligned_fp)
File "/Users/elolimyahmed/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_alignment/mafft.py", line 27, in run_command
subprocess.run(cmd, stdout=output_f, check=True)
File “/Users/elolimyahmed/miniconda3/envs/qiime2-2020.2/lib/python3.6/subprocess.py”, line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '[‘mafft’, ‘–preservecase’, ‘–inputorder’, ‘–thread’, ‘1’, '/var/folders/0
/kqg94rwj0hn532c1t4jlgtlh1__xx4/T/qiime2-archive-44vauu_e/2fd7ef40-143d-41ac-8ef9-a7b544583ac0/data/dna-sequences.fasta’]’ returned non-zero exit status 1.

@elolimy, when processes are killed like this, out-of-memory errors are often the culprit. Are you using a virtual machine or a cluster to run QIIME 2? How much RAM does QIIME 2 have access to?

@ChrisKeefe I am using iMac with 32GM RAM. I have tried to add --p-n-threads 0 like I did in DADA2 but seems this code is not supported here

That’s a solid machine, @elolimy. With a large number of reads, MAFFT can require a lot of memory. Unfortunately, MAFFT doesn’t seem to have a native option for memory chunking, so if this is a memory issue, here are some other things you could try.

  1. The --p-partree argument might be useful if you are running MAFFT on a large number of sequences. (e.g. over 100k)
  2. If parttree isn’t a good option for you, a compute cluster at your institution or a rented computer could be good backup options.

It is possible that something else is killing your process. Some other variables to consider

  • make sure your machine doesn’t suspend/sleep/hibernate while you’re running the command. This could cause a sigkill
  • shut down any extra processes when you run denoise-paired . Firefox is great, but if you have as many tabs open as I do, it will eat up memory you may need.

Let me know if this helps. :crossed_fingers: I’m new to this issue myself, and am interested in seeing how it works out.

1 Like

Thanks @ChrisKeefe! I would go for --p-partree. What are the drawbacks of using partree? And what is the reasonable value you would recommend?

Sorry, but I don’t know. :slight_smile:
I know that MAFFT requires its use above a certain number of reads, but It’s probably worth doing some digging.

  1. MAFFT docs
  2. PartTree paper
  3. Forum results

If you learn anything worth sharing, please consider posting it for future users. (and meeeee!)

Best,
CK

1 Like

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