output a consensus sequence from mafft alignment
1
0
Entering edit mode
6.5 years ago
roblogan6 ▴ 30

Creating alignments for 800+ multifasta files
The above link will send you to a post that is very similar to mine. I have multiple multifasta files that need to be aligned using mafft in succession, just as the before mentioned post. However, I need to output not just the alignment, but the consensus sequences of the alignment. It would be great if the consensus sequence could be printed out only, separate from the actual alignment. Any ideas of how to work that into the code provided in the earlier post? Thanks so much, -Rob

mafft multifasta alignment consensus • 5.9k views
1
Entering edit mode
6.5 years ago
roblogan6 ▴ 30

I was able to figure it out. With mafft installed and configured, use the following commands in the directory where all your files are.

for fasta_file in $(ls *.txt) do mafft$fasta_file > \$fasta_file.out

done

2
Entering edit mode

The above script will not solve your problem. If you want to calculate the consensus of a multi sequence alignment from the command line, you may use "cons" from the Emboss package. 'mafft' is a very versatile multi sequence aligner but not suited to calculate consensus.