# Blastp MSA to the same length

To generate aligned protein sequence truncate to the same length, I use blastp in biopython for MSA. I have multiple queries and one subject sequence. However, the alignment never returns the same length.

How can I align all sequences altogether, thus resulting in a set of sequences of the same length?

• Are you using a local alignment over a global alignment for a reason? Also, it sounds like you'd want a MSA of the whole set and not a set of pairwise ones. If global MSA is what you actually want, try ebi.ac.uk/Tools/msa/muscle. Then to trim the ends before phylogeny there are dozens of tools. Aug 9, 2020 at 12:18
• No. Blast aligns locally, i.e. a window, while a global alignment is the whole entirety of the sequence (viz. wiki. Aug 10, 2020 at 9:42

BLAST isn't appropriate for multiple sequence alignment. BLAST generates pairwise alignments. Furthermore, the aligning regions shown in a BLAST report only include subsets of the hit sequences.

To create multiple sequence alignment of hits you want to:

• run blast
• extract the hit sequences
• perform multiple-sequence-alignment (e.g., using MAFFT)

Extracting hit sequences can be done using the command-line. Check the docs for blastdbcmd.

If you prefer a point-and-click interface, you can also do this using my lab's SequenceServer BLAST software by simply selecting the hits that you want to retain, and in the Download section, clicking "FASTA of selected hits". Or if you want all of them, click "FASTA of all hits".