Convert a Clustal alignment sequence file to PHYLIP alignment (interleaved).
Move one Clustal alignment to PHYLIP
Clustal to PHYLIP writes one interleaved PHYLIP alignment from one Clustal alignment. It carries the aligned sequence rows, but not Clustal consensus lines or alignment scores. The converter refuses a file containing multiple alignments.
Check row names and gap symbols
Standard PHYLIP keeps the first ten characters of each ID and changes : or ; to |. The converter refuses names that collide after those changes. It also refuses . in sequence rows and suggests - for gaps. The supplied three-row Clustal sample converts and reads back with the same sequence letters.
For longer IDs without spaces, use the available relaxed-name PHYLIP route. That output still omits Clustal alignment annotations. x
The converter writes one alignment per PHYLIP alignment (interleaved) file, so upload one alignment at a time. A file with several alignments (for example several MAF blocks or Stockholm sections) is refused rather than merged into one.
Run it with Biopython
For batch work, you can use Biopython's SeqIO.convert function. This pair needs no molecule type argument.
from Bio import SeqIO
count = SeqIO.convert("input.clustal", "clustal",
"output.phylip", "phylip")
print("Converted %i records" % count)
Sample input file: Clustal alignment
Copy this example into a file, or download it, to try a Clustal alignment conversion.
Download sample (sample.aln, 277 bytes)
Samples are small illustrative files. Some come from the Biopython test suite (see the project's sample notes); they are not real study data.