mafft: non-zero exit status 1 error

qiime phylogeny align-to-tree-mafft-fasttree --i-sequences VLrepseqs.qza --o-alignment VLalignedrepseqs.qza --o-masked-alignment VLmaskedalignedrepseqs.qza --o-tree VLunrootedtree.qza --o-rooted-tree VLrootedtree.qza

Plugin error from phylogeny:

Command '['mafft', '--preservecase', '--inputorder', '--thread', '1', '/tmp/qiime2/mk21/data/fa6b3349-9d32-45ed-b162-78c54f358c88/data/dna-sequences.fasta']' returned non-zero exit status 1.

Debug info has been saved to /tmp/qiime2-q2cli-err-wbas_gwo.log

Hello @Manny,

Can you please rerun your commands with the --verbose flag? That way we can get a more detailed error message to work from.

Also, If you search the forum you will find that this error has been encountered and resolved before.

This post suggests that the error could be a memory issue.

Once you get the full error message posted here we can see what the problem is and resolve it from there.

-Hannah

I checked it and run with --verbose also. I am not sure about the space as I have 2TB RAM. Below is the error with --verbose

qiime phylogeny align-to-tree-mafft-fasttree --i-sequences VLrepseqs.qza --o-alignment VLalignedrepseqs.qza --o-masked-alignment VLmaskedalignedrepseqs.qza --o-tree VLunrootedtree.qza --o-rooted-tree VLrootedtree.qza --verbose
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 /tmp/qiime2/mk21/data/fa6b3349-9d32-45ed-b162-78c54f358c88/data/dna-sequences.fasta

inputfile = orig
514184 x 296 - 159 d
nthread = 1
nthreadpair = 1
nthreadtb = 1
ppenalty_ex = 0
stacksize: 8192 kb->100426 kb
generating a scoring matrix for nucleotide (dist=200) ... done
Gap Penalty = -1.53, +0.00, +0.00

Making a distance matrix ..
/home/mk21/anaconda3/envs/qiime2-2023/bin/mafft: line 2836: 2257 Killed "$prefix/disttbfast" -q $npickup -E $cycledisttbfast -V "-"$gopdist -s $unalignlevel $legacygapopt $mergearg -W $tuplesize $termgapopt $outnum $addarg $add2ndhalfarg -C $numthreads-$numthreadstb $memopt $weightopt $treeinopt $treeoutopt $distoutopt $seqtype $model -g $gexp -f "-"$gop -Q $spfactor -h $aof $param_fft $algopt $treealg $scoreoutarg $anchoropt -x $maxanchorseparation $oneiterationopt < infile > pre 2>> "$progressfile"
Traceback (most recent call last):
File "/home/mk21/anaconda3/envs/qiime2-2023/lib/python3.8/site-packages/q2cli/commands.py", line 473, in call
results = action(**arguments)
File "", line 2, in align_to_tree_mafft_fasttree
File "/home/mk21/anaconda3/envs/qiime2-2023/lib/python3.8/site-packages/qiime2/sdk/action.py", line 274, in bound_callable
outputs = self.callable_executor(
File "/home/mk21/anaconda3/envs/qiime2-2023/lib/python3.8/site-packages/qiime2/sdk/action.py", line 590, in callable_executor
outputs = self._callable(scope.ctx, **view_args)
File "/home/mk21/anaconda3/envs/qiime2-2023/lib/python3.8/site-packages/q2_phylogeny/_align_to_tree_mafft_fasttree.py", line 19, in align_to_tree_mafft_fasttree
aligned_seq, = mafft(sequences=sequences, n_threads=n_threads,
File "/home/mk21/anaconda3/envs/qiime2-2023/lib/python3.8/site-packages/qiime2/sdk/context.py", line 140, in deferred_action
return action_obj._bind(
File "", line 2, in mafft
File "/home/mk21/anaconda3/envs/qiime2-2023/lib/python3.8/site-packages/qiime2/sdk/action.py", line 274, in bound_callable
outputs = self.callable_executor(
File "/home/mk21/anaconda3/envs/qiime2-2023/lib/python3.8/site-packages/qiime2/sdk/action.py", line 509, in callable_executor
output_views = self._callable(**view_args)
File "/home/mk21/anaconda3/envs/qiime2-2023/lib/python3.8/site-packages/q2_alignment/_mafft.py", line 128, in mafft
return _mafft(sequences_fp, None, n_threads, parttree, False)
File "/home/mk21/anaconda3/envs/qiime2-2023/lib/python3.8/site-packages/q2_alignment/_mafft.py", line 100, in _mafft
run_command(cmd, result_fp)
File "/home/mk21/anaconda3/envs/qiime2-2023/lib/python3.8/site-packages/q2_alignment/_mafft.py", line 26, in run_command
subprocess.run(cmd, stdout=output_f, check=True)
File "/home/mk21/anaconda3/envs/qiime2-2023/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['mafft', '--preservecase', '--inputorder', '--thread', '1', '/tmp/qiime2/mkaur21/data/fa6b3349-9d32-45ed-b162-78c54f358c88/data/dna-sequences.fasta']' returned non-zero exit status 1.

Plugin error from phylogeny:

Command '['mafft', '--preservecase', '--inputorder', '--thread', '1', '/tmp/qiime2/mk21/data/fa6b3349-9d32-45ed-b162-78c54f358c88/data/dna-sequences.fasta']' returned non-zero exit status 1.

See above for debug info.

Hi @Manny,

This issue is very similar to one discussed here.

That is, given:

you have just over a half-a-million reads across 296 alignment positions. That is a lot of reads! Are you sure you are using the correct sequence file? Typically this command is ran with ASVs / OTUs as input.

If you run qiime phylogeny align-to-tree-mafft-fasttree --help , you'll find that there is a potentially useful flag: --p-partree. Try running with this flag and let us know if it works.

1 Like

Thank you, I tried it didn't work

How much RAM do you have? I know you mentioned 2TB, that sounds more like your hard drive size (storage space), not memory. Unless you are running on a high memory HPC?

Thanks, Its 32GB RAM.

Okay, running out of memory is likely the problem given that amount of RAM. Especially when trying to align a half-million reads.

What marker gene are you trying to align? Often the more variable the gene is, the more resources it'll take to align.

The current q2-alignment plugin does not currently expose other memory saving features of mafft.

You could export your fasta file and try running mafft manually by using either the--dpparttree or --fastaparttree, and --memsavetree options. Then re-import into QIIME 2, then construct your phylogeny.

However, if you are having memory issues with a sequence alignment, you can potentially run into similar issues with phylogentic reconstruction.

-Mike

1 Like

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