Skip to content

Alignment Partition Conversion

Convert partition files between RAxML, NEXUS, and charset formats. Charset is a NEXUS format that stores the partitions in the same file as a NEXUS alignment.

import pysegul
def convert_partitions():
convert = pysegul.PartitionConversion(
input_fmt='raxml',
datatype='dna',
output_dir='tests/output',
output_fmt='nexus',
)
convert.from_files([
'tests/partition-data/partition_codon.txt',
'tests/partition-data/partition.txt',
])
OptionDefaultDescription
input_fmtRequiredInput partition format: 'charset', 'nexus', 'raxml'
datatypeRequired'dna', 'aa', 'ignore'
output_dirRequiredOutput directory
output_fmtRequiredOutput partition format: 'charset', 'nexus', 'raxml'. Add -codon for codon partitions, e.g. 'nexus-codon'
check_partitionTrueCheck that the partitions are valid before converting
MethodDescription
from_files(input_files)Convert a list of partition files

Partition conversion does not take an input directory.

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.