Problem running Mafft alignment

Hello, I just ran the mafft alignment and it failed. I got the massage below. Could any one please inform me why it failed? Thank you.

Plugin error from alignment:

Command ‘[‘mafft’, ‘–preservecase’, ‘–inputorder’, ‘–thread’, ‘1’, ‘/tmp/qiime2-archive-35abjqvd/d61eb1be-d2a6-4e3e-8151-bbe196037ec3/data/dna-sequences.fasta’]’ returned non-zero exit status 254

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

The run log detail is shown here.
inputfile = orig
81589 x 251 - 33 d
nthread = 1
stacksize: 8192 kb->15935 kb
Warning: Failed to extend stack size. It’s ok in most cases but there may be problems in --pileup and --chainedtree.
generating a scoring matrix for nucleotide (dist=200) … done
Gap Penalty = -1.53, +0.00, +0.00

Making a distance matrix …

There are 41412 ambiguous characters.
^M 1 /home/vorthon/miniconda3/envs/qiime2-2018.8/bin/mafft: line 2440/tmp/qiime2-q2cli-err-9md4u1_j.log

Hey there @Vorthon - this looks like a mafft error. Can you please provide the following:

  • What is the exact command you are running?
  • What is the complete output when run with --verbose?

Thanks! :qiime2: :t_rex:

Hello @thermokarst

Thank you for your reply.
Here is the command and the output of running with --verbose

(qiime2-2018.8) vorthon@DESKTOP-BCB5NP1:~/d/NGS-output-microbiome-view/QIIME2ANALYSIS/testfecescynoF$ qiime alignment mafft \

  --i-sequences fiteredTaxonAssignedSeq.qza \
  --p-no-parttree \
  --p-n-threads 2 \
  --o-alignment fiteredTaxonAssignedAlignment.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 2 /tmp/qiime2-archive-9wcqs478/3f68cb7f-a9e8-4e4f-8be8-685d1af4291b/data/dna-sequences.fasta

inputfile = orig
81589 x 251 - 33 d
nthread = 2
stacksize: 8192 kb->15935 kb
Warning: Failed to extend stack size. It's ok in most cases but there may be problems in --pileup and --chainedtree.
generating a scoring matrix for nucleotide (dist=200) ... done
Gap Penalty = -1.53, +0.00, +0.00

Making a distance matrix ..

There are 41412 ambiguous characters.
12801 / 81589 (thread 0)/home/vorthon/miniconda3/envs/qiime2-2018.8/bin/mafft: line 2440: 7582 Segmentation fault (core dumped) "$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"
/home/vorthon/miniconda3/envs/qiime2-2018.8/bin/mafft: fork: Invalid argument
Traceback (most recent call last):
File "/home/vorthon/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/q2cli/commands.py", line 274, in call
results = action(**arguments)
File "", line 2, in mafft
File "/home/vorthon/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/qiime2/sdk/action.py", line 231, in bound_callable
output_types, provenance)
File "/home/vorthon/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/qiime2/sdk/action.py", line 362, in callable_executor
output_views = self._callable(**view_args)
File "/home/vorthon/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/q2_alignment/_mafft.py", line 85, in mafft
run_command(cmd, aligned_fp)
File "/home/vorthon/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/q2_alignment/_mafft.py", line 27, in run_command
subprocess.run(cmd, stdout=output_f, check=True)
File "/home/vorthon/miniconda3/envs/qiime2-2018.8/lib/python3.5/subprocess.py", line 398, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['mafft', '--preservecase', '--inputorder', '--thread', '2', '/tmp/qiime2-archive-9wcqs478/3f68cb7f-a9e8-4e4f-8be8-685d1af4291b/data/dna-sequences.fasta']' returned non-zero exit status 254

Plugin error from alignment:

Command '['mafft', '--preservecase', '--inputorder', '--thread', '2', '/tmp/qiime2-archive-9wcqs478/3f68cb7f-a9e8-4e4f-8be8-685d1af4291b/data/dna-sequences.fasta']' returned non-zero exit status 254

See above for debug info.

I think this usually means your computer is trying to access memory at a location that doesn't exist (or, perhaps it doesn't have access to it?).

Try re-running with --p-n-threads 1, that will use half as much memory. Not sure if that is the problem, but it seems like a place to start. :qiime2: :t_rex:

Hello @thermokarst

I tried to run with --p-n-threads 1 and it still got the same massage. However, I saw that ~95% of memory was used during mafft alignment. May be the ram (8GB) on my computer might not enough for this analysis. Is it possible? If you have any comment, please inform me. Thanks.

Ah bummer, @Vorthon.

Oh yeah, that is likely the case! That is often enough RAM for many analyses we see, but it is certainly likely too little for your case - do you have another machine you could run on, for example, an institutional cluster?

Hi @thermokarst

Yes, I have. I will try it on another computer. Thanks :))

1 Like

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