Alignment Concatenation
Install PySEGUL using pip if you haven’t done it yet
pip install pysegulCreate a new Python script, import the library, and write python code
import pysegul
def concat_alignments(): input_dir = 'tests/data' input_format = 'nexus' datatype = 'dna' output_format = 'fasta' partition_format = 'raxml' prefix = 'concatenated' output_dir = 'tests/output' concat = pysegul.AlignmentConcatenation( input_format, datatype, output_dir, output_format, partition_format, prefix ) concat.from_dir(input_dir)You can also input the alignment paths in a list directly instead of using a directory. Replace the input_dir with input_files and provide a list of paths. Then, call the from_files method instead of from_dir.
import pysegul
def concat_alignments(): input_path = ['tests/data/alignment1.nex', 'tests/data/alignment2.nex'] input_format = 'nexus' datatype = 'dna' output_format = 'fasta' partition_format = 'raxml' prefix = 'concatenated' output_dir = 'tests/output' concat = pysegul.AlignmentConcatenation( input_format, datatype, output_dir, output_format, partition_format, prefix ) concat.from_files(input_path)Copyright © 2026 H. Handika & J. A. Esselstyn.
This material is based upon work supported by the National Science Foundation under grant numbers: DEB-1754393 and DEB-2244754. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.