Alignment Trimming
Trim alignments based on the proportion of missing data or the number of parsimony informative sites. This feature will filter sites based on the specified parameters.
Quick example
Section titled “Quick example”Assume we have an alignment file in FASTA format as follows:
>seq1ATGCAT--A>seq2ATGCATA-->seq3ATGCAA-A->seq4ATGCATA--If we set the proportion of missing data to 0.5. It will generate an output without the last two sites using the following command:
segul align trim --dir alignments/ --missing-data 0.5The output as follows. Note that the last two sites were removed because they had more than 50% missing data.
>seq1ATGCAT->seq2ATGCATA>seq3ATGCAA->seq4ATGCATADetailed usage
Section titled “Detailed usage”Filtering based on the proportion of missing data
Section titled “Filtering based on the proportion of missing data”To trim alignments, use the align trim command with the following options:
segul align trim --dir <alignment-dir> --missing-data <value>For example:
segul align trim --dir alignments/ --missing-data 0.5Filtering based on parsimony informative sites
Section titled “Filtering based on parsimony informative sites”To trim based on the minimum threshold of parsimony informative sites, use the --pinf option:
segul align trim --dir <alignment-dir> --pinf <value>For example, this command will retain sites with at least 50 parsimony informative sites:
segul align trim --dir alignments/ --pinf 50Amino acid alignment trimming
Section titled “Amino acid alignment trimming”If the input is amino acid sequences, you need to use the --datatype aa option. For example:
segul align trim --dir alignments/ --missing-data 0.5 --datatype aaSpecifying the output directory and format
Section titled “Specifying the output directory and format”By default, the output directory is Align-Trim. You can change the output directory name using the --output or -o option. For example, to name the output directory align-trim, use the command below:
segul align trim --dir alignments/ --output align-trimTo specify the output format, use the --output-format or -F option. The default output format is NEXUS. For example, to change the output format to FASTA, use the command below:
segul align trim --dir alignments/ --output-format fastaAll options
Section titled “All options”| Option | Description |
|---|---|
-d, --dir |
Directory with alignments |
-i, --input |
Alignment files. Allows wildcards |
-f, --input-format |
Input format: auto (default), fasta, nexus, or phylip |
--datatype |
Data type: dna (default), aa, or ignore |
--missing-data |
Remove sites with a higher proportion of missing data |
--pinf |
Parsimony informative site threshold for keeping sites |
-F, --output-format |
Output format: nexus (default), phylip, fasta, nexus-int, phylip-int, or fasta-int |
-o, --output |
Output directory. Default: Align-Trim |
--force |
Overwrite an existing output directory |
--log |
Log file path. Default: segul.log |
Copyright © 2026 H. Handika & J. A. Esselstyn.