Skip to content

Unalign Alignments

Parts of a SEGUL commandThe command segul align unalign --dir alignments/ --output unaligned has five parts: the program segul, the command align for the task group, the subcommand unalign for the task, the input --dir alignments/ (folder or files), and the option --output unaligned (optional).segulProgramalignCommandtask groupunalignSubcommandtask--dir alignments/Inputfolder or files--output unalignedOptionsoptional

Unalign alignments to produce unaligned sequence files.

Under the hood, SEGUL will read the alignment files and remove all gap characters to produce unaligned sequences. SEGUL can do it for thousands of files in a single command.

Assume we have an alignment file in FASTA format as follows:

>seq1
ATGCAT--A
>seq2
ATGCATA--
>seq3
ATGCAA-A-
>seq4
ATGCATA--

To unalign the sequences, use the following command:

Terminal window
segul align unalign --dir alignments/

The output will be as follows, with all gap characters removed:

>seq1
ATGCATA
>seq2
ATGCATA
>seq3
ATGCAAA
>seq4
ATGCATA

To unalign alignments, use the align unalign command with the following options. It will automatically detect the input format.

Terminal window
segul align unalign --dir <alignment-dir>

To unalign amino acid alignments, use the --datatype aa option as follows:

Terminal window
segul align unalign --dir <alignment-dir> --datatype aa

By default, the output directory will be named Align-Unalign in the current working directory. You can change the output directory name using the --output or -o option. For example, to name the output directory unalign-output, use the command below:

Terminal window
segul align unalign --dir <alignment-dir> --output unalign-output

You can also specify input files using the --input or -i option. This option allows you to provide a single alignment file or multiple alignment files using wildcards. For example:

Terminal window
segul align unalign --input alignments/*.fasta
OptionDescription
-d, --dirDirectory with alignments
-i, --inputAlignment files. Allows wildcards
-f, --input-formatInput format: auto (default), fasta, nexus, or phylip
--datatypeData type: dna (default), aa, or ignore
-F, --output-formatOutput format: fasta-int (default) or fasta
-o, --outputOutput directory. Default: Align-Unalign
--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.