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.
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.