Question: Parallelizing MAFFT alignment of multiple FASTA files
1
gravatar for ropolocan
2.5 years ago by
ropolocan500
Canada
ropolocan500 wrote:

Hello,

I want to align multiple FASTA files in a directory with MAFFT.

Is it correct to do this with parallel(where --thread n is the maximum number of cores in the machine):

ls *.fasta | parallel 'mafft --adjustdirection --thread n {} > {.}_mafft.fasta'

If I am interpreting the line above correctly, each alignment will be performed in parallel using the maximum number of cores possible. Am I correct in setting the --thread option to the maximum number of cores for each alignment, or is parallel already taking care of that?

Or is it preferable to perform something like the for loop below and align the FASTA files sequentially:

for i in *.fasta; do
mafft --adjustdirection --thread n ${i} > ${i%.*}_mafft.fasta;
done

Thanks.

mafft parallel alignment • 1.2k views
ADD COMMENTlink modified 2.5 years ago • written 2.5 years ago by ropolocan500
4
gravatar for genomax
2.5 years ago by
genomax62k
United States
genomax62k wrote:

It would be more efficient to do the alignments sequentially using the maximum number of cores you have available (since you are able to use multiple threads). If you started multiple parallel jobs (each with multiple cores) they would compete for the same cores and the jobs would bog each other down.

ADD COMMENTlink written 2.5 years ago by genomax62k

Thanks @genomax2 for the clear and concise answer. Your explanation makes sense and it makes it clear why it is more efficient to run the for loop.

ADD REPLYlink written 2.5 years ago by ropolocan500
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1151 users visited in the last hour