MAFFT non-zero exit status 1 error

I am trying to align sequences in qiime2-amplicon-2024.5.1 and running into some new errors.

My feature table looks like this prior to alignment:
#total samples: 384
#total features: 62,763
#total reads: 8,459,561

I ran the following code:
qiime alignment mafft
--i-sequences ./rep-seqs.qza
--o-alignment seq_dada2_aligned.qza

And am getting the following error:
Plugin error from alignment:
Command '['mafft', '--preservecase', '--inputorder', '--thread', '1', '/var/folders/4w/v2ylb51s721gyqw_rjnvqr940000gq/T/qiime2/dr33/data/d856750a-acb2-4827-8983-7dcd039f47dc/data/dna-sequences.fasta']' returned non-zero exit status 1.

Can anyone help me fix this? Thanks!

Wes

Hello Wes,

Thank you for posting that. Did you also see a log file you can post here?

You could try adding --verbose to get more detail we can use to address the root cause of this error.

1 Like

Hey Colin,

I can rerun the command with --verbose but this took over a week to run the last time, so it may be a bit before I have answers.

Here is the output of the log file:

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/4w/v2ylb51s721gyqw_rjnvqr940000gq/T/qiime2/dr33/data/d856750a-acb2-4827-8983-7dcd039f47dc/data/dna-sequences.fasta

inputfile = orig
62763 x 418 - 250 d
nthread = 1
nthreadpair = 1
nthreadtb = 1
ppenalty_ex = 0
stacksize: 8176 kb->12258 kb
generating a scoring matrix for nucleotide (dist=200) ... done
Gap Penalty = -1.53, +0.00, +0.00

Making a distance matrix ..
62701 / 62763 (thread 0)
done.

Constructing a UPGMA tree (efffree=0) ...
62760 / 62763
done.

Progressive alignment 1/2...
STEP 62001 / 62762 h
Reallocating..done. *alloclen = 2037
STEP 62701 / 62762 h
Reallocating..done. *alloclen = 3174

done.

Making a distance matrix from msa..
62700 / 62763 (thread 0)
done.

Constructing a UPGMA tree (efffree=1) ...
62760 / 62763
done.

Progressive alignment 2/2...
STEP 62501 / 62762 h
Reallocating..done. *alloclen = 2021
STEP 62701 / 62762 h
Reallocating..done. *alloclen = 3061

done.

disttbfast (nuc) Version 7.520
alg=A, model=DNA200 (2), 1.53 (4.59), -0.00 (-0.00), noshift, amax=0.0
0 thread(s)

mv: rename hat3.seed to hat3: No such file or directory
Cannot open orig
Traceback (most recent call last):
File "/Users/dr33/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2cli/commands.py", line 520, in call
results = self._execute_action(
File "/Users/dr33/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2cli/commands.py", line 581, in _execute_action
results = action(**arguments)
File "", line 2, in mafft
File "/Users/dr33/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py", line 342, in bound_callable
outputs = self.callable_executor(
File "/Users/dr33/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py", line 576, in callable_executor
output_views = self._callable(**view_args)
File "/Users/dr33/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_alignment/_mafft.py", line 128, in mafft
return _mafft(sequences_fp, None, n_threads, parttree, False)
File "/Users/dr33/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_alignment/_mafft.py", line 100, in _mafft
run_command(cmd, result_fp)
File "/Users/dr33/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_alignment/_mafft.py", line 26, in run_command
subprocess.run(cmd, stdout=output_f, check=True)
File "/Users/dr33/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['mafft', '--preservecase', '--inputorder', '--thread', '1', '/var/folders/4w/v2ylb51s721gyqw_rjnvqr940000gq/T/qiime2/dr33/data/d856750a-acb2-4827-8983-7dcd039f47dc/data/dna-sequences.fasta']' returned non-zero exit status 1.

Wes

1 Like

Hi @Wes_Neely,

This usually implies an "out of memory error". You could try using the --p-parttree flag to see if that helps, and/or find a machine with more RAM.

Wow, that is an awful large amount of features! This many features is often too much for alignments and phylogenetic construction, assuming the --p-parttree flag is not sufficient. Did you perform any quality control & filtering of the data before proceeding? Like removing reads with poor taxonomy, or low read count, low sample prevalence?

Observing so many features for 384 samples is surprising. Typically, you do not see that many features, even when dealing with gut and/or soil data sets comprised of over 500 samples. At least after quality control processing and denoising of 16S rRNA gene data. Can you let us know what processing and quality control steps you've taken with the data prior to this point? What marker gene /region are you using?

1 Like

Hey Mike,

Adding --p-parttree seems to have worked!
The code was taking over a week before failing before but now worked in 24 hours, thanks for your help!

Wes

4 Likes

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