align-to-tree-mafft error

A similar error occurred when I ran these commands:

qiime phylogeny align-to-tree-mafft-fasttree  \
  --i-sequences rep-seqs.qza \
  --o-alignment aligned-rep-seqs.qza \
  --o-masked-alignment masked-aligned-rep-seqs.qza \
  --o-tree unrooted-tree.qza \
  --o-rooted-tree rooted-tree.qza
Plugin error from phylogeny:
  Command '['mafft', '--preservecase', '--inputorder', '--thread', '1', '/mnt/me4/peipt/tmp/qiime2-archive-57cxe4s1/ad4454de-a6fe-488d-b979-474d83973e56/data/dna-sequences.fasta']' returned non-zero exit status 1.

So I'd like to ask you what causes the error and how to solve it. Thank you.

1 Like

Hi @shengxinfenxi,

Welcome to the :qiime2: forum!

This looks like a separate issue, since the original thread you replied to was not related to any actual error message.

Can you please provide us with the following details?

  • Version of QIIME 2 you are running, and how it is installed (e.g. Virtualbox, conda, etc.)
  • What is the exact error message, if applicable? If you didn't run the command with the --verbose flag, please re-run and copy-and-paste the results.

Thanks!

Thank you for your response and suggestions!
I follow your suggestions that rerun the commands as recommended by you with qiime version 2021.4 and add the "-- verbose" flag. The commands are as follows:

qiime phylogeny align-to-tree-mafft-fasttree
--i-sequences rep-seqs.qza
--o-alignment aligned-rep-seqs.qza
--o-masked-alignment masked-aligned-rep-seqs.qza
--o-tree unrooted-tree.qza
--o-rooted-tree rooted-tree.qza
--verbose

But there still seem to be some problems, which are a consequence of the output:

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 /mnt/me4/peipt/tmp/qiime2-archive-q5yooa2o/ad4454de-a6fe-488d-b979-474d83973e56/data/dna-sequences.fasta

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



Making a distance matrix ..

There are 7429 ambiguous characters.
 41201 / 977772 (thread    0)/home/gene/peipt/miniconda3/envs/qiime2-2021.4/bin/mafft: line 2747: 71536 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/gene/peipt/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/q2cli/commands.py", line 329, in __call__
    results = action(**arguments)
  File "<decorator-gen-226>", line 2, in align_to_tree_mafft_fasttree
  File "/home/gene/peipt/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 244, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/home/gene/peipt/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 484, in _callable_executor_
    outputs = self._callable(scope.ctx, **view_args)
  File "/home/gene/peipt/miniconda3/envs/qiime2-2021.4/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 "<decorator-gen-538>", line 2, in mafft
  File "/home/gene/peipt/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 244, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/home/gene/peipt/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 390, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/home/gene/peipt/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_alignment/_mafft.py", line 128, in mafft
    return _mafft(sequences_fp, None, n_threads, parttree, False)
  File "/home/gene/peipt/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_alignment/_mafft.py", line 100, in _mafft
    run_command(cmd, result_fp)
  File "/home/gene/peipt/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_alignment/_mafft.py", line 26, in run_command
    subprocess.run(cmd, stdout=output_f, check=True)
  File "/home/gene/peipt/miniconda3/envs/qiime2-2021.4/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['mafft', '--preservecase', '--inputorder', '--thread', '1', '/mnt/me4/peipt/tmp/qiime2-archive-q5yooa2o/ad4454de-a6fe-488d-b979-474d83973e56/data/dna-sequences.fasta']' returned non-zero exit status 1.

Plugin error from phylogeny:

  Command '['mafft', '--preservecase', '--inputorder', '--thread', '1', '/mnt/me4/peipt/tmp/qiime2-archive-q5yooa2o/ad4454de-a6fe-488d-b979-474d83973e56/data/dna-sequences.fasta']' returned non-zero exit status 1.

See above for debug info.

In addition, I used CONDA to install qiime2.
So I want to ask you what are the reasons for these problems and how to solve it.
Thanks a lot!

Hi @shengxinfenxi,

Thanks for providing those details! It looks like you're running into this error when running align-to-tree-mafft-fasttree:

This usually indicates that you've run out of available RAM (i.e. memory) on your machine. Depending on what resources you have available to you, you can allocate more memory on your machine (if you aren't currently using the maximum available RAM), you could try running this command on another machine with more memory available, or you could run this command on an AWS instance , which you could provision with plenty of RAM, then download the outputs and run them locally on your machine.

Hope this helps! Let us know if you run into any further issues.

Cheers :lizard:

3 Likes

Okay, I see, thanks for your patient and detailed answers.

1 Like

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