Skip to content

Alignment Partition Conversion

Parts of a SEGUL commandThe command segul partition convert --input concat.nex --output-partition raxml has five parts: the program segul, the command partition for the task group, the subcommand convert for the task, the input --input concat.nex (file), and the option --output-partition raxml (output format).segulProgrampartitionCommandtask groupconvertSubcommandtask--input concat.nexInputfile--output-partition raxmlOptionsoutput format

SEGUL CLI can convert single and multiple partition files. It can also extract partitions embedded in NEXUS sequence files.

Terminal window
segul partition convert --input <a-path/wildcard-to-partition> --input-partition <input-partition-format> --output-partition <output-partition-format>

If you output to RaXML partition and it is a DNA sequence, we recommend using the --datatype dna option. The partition format will include the datatype as below:

DNA, locus_1 = 1-100
DNA, locus_2 = 101-150
DNA, locus_3 = 151-200

By default, segul checks the partition format:

  1. The first partition position starts with 1.
  2. The next partition is the next number after the previous partition's end. If using the codon model, the next locus applies the rule.

Passing the --skip-checking flag allows you to ignore format checking. For example, to extract nexus in-file partitions (called charset format in segul):

Terminal window
segul partition convert --input concatenated_alignment.nex --input-partition charset --output-partition nexus

You can also use wildcard to convert multiple concatenated alignment partitions at once:

Terminal window
segul partition convert --input ./*/concatenated_alignment.nex --input-partition charset --output-partition nexus

By default, SEGUL will save the resulting partitions in the parent directory of the input partition (or alignment if the partition is charset).

OptionDescription
-i, --inputPartition files, or alignments with an embedded partition. Allows wildcards
-p, --input-partitionInput partition format: charset, nexus, or raxml
-P, --output-partitionOutput partition format: nexus (default), charset, or raxml
--codonWrite the partition as a codon model
--datatypeData type: dna (default), aa, or ignore. Sets the RAxML datatype label
--skip-checkingSkip checking the partition positions
-f, --input-formatFormat of an alignment with an embedded partition: auto (default), fasta, nexus, or phylip
-F, --output-formatOutput sequence format: nexus (default), phylip, fasta, nexus-int, phylip-int, or fasta-int
-o, --outputOutput directory. Default: Partition-Convert
--forceOverwrite an existing output directory
--logLog file path. Default: segul.log

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.