Skip to content

Command Options

Every SEGUL task runs as a command and a subcommand, followed by options. Most tasks share the same input, output, and format options, so once you learn them for one task, they work for the rest. This page covers the shared options. Options specific to a task are listed on its own page.

Parts of a SEGUL commandThe command segul align concat --dir alignments/ --output aln-concat has five parts: the program segul, the command align for the task group, the subcommand concat for the task, the input option --dir alignments/, and the optional --output option.segulProgramalignCommandtask groupconcatSubcommandtask--dir alignments/Inputfolder or files--output aln-concatOptionsoptional
Without --output, SEGUL writes to a default folder named after the task, such as Align-Concat.

The program is segul on Linux, macOS, and Windows Subsystem for Linux, and segul.exe in the Windows Command Prompt. SEGUL keeps its options consistent:

PartFormExample
Long optionTwo dashes, followed by a value--dir alignments/
Short optionOne dash. Not every option has one-d alignments/
FlagNo value. Turns a setting on--force
= optionValue in single or double quotes--re="^Genus"

Every short option also has a long form. Some options, such as --datatype, only have a long form.

SEGUL groups its tasks by the kind of input they take. Each command has its own subcommands:

CommandInputSubcommands
alignAlignmentsconcat, convert, distance, filter, split, summary, trim, unalign
sequenceAlignments or sequencesadd, extract, filter, id, remove, rename, translate, transpose
partitionPartition filesconvert
mafMultiple alignment formatconvert, summary
readFASTQ readssummary
contigContigssummary

The help output lists every option of a task, with its default and allowed values:

Terminal window
segul --help # All commands
segul align --help # Subcommands of a command
segul align concat --help # Options of a task
segul --version # Installed version

Use -h and -V as short forms of --help and --version. The options on these pages match SEGUL v0.24.0.

OptionDescriptionAvailable in
-d, --dirDirectory with the input files. Searched recursivelyAll, except align split and partition convert
-i, --inputInput files. Allows wildcardsAll
-f, --input-formatInput format. Default: autoAll, except maf
--datatypeData type: dna (default), aa, or ignorealign, sequence, partition
-o, --outputOutput directory. Default: named after the taskAll
-F, --output-formatOutput sequence formatTasks that write sequences
--prefixPrefix of the output filesTasks that write a single file or summary
--forceOverwrite an existing output directory without askingAll
--logLog file path. Default: segul.logAll
-h, --helpPrint helpAll

Use one of the two input options:

Point SEGUL to a directory. It finds every matching file in the directory and its subdirectories, and writes the directory path to the log:

Terminal window
segul align summary --dir alignments/

Most tasks should use --dir. Versions before v0.19.0 also need --input-format with --dir.

SEGUL detects the input format from the file extension, so most commands need no --input-format. Set it for unusual extensions. Interleaved and sequential files are both read.

CommandFormats
align, sequence, partitionauto (default), fasta, nexus, phylip
readauto (default), fastq, gzip
contigauto (default), fasta, gzip

read commands detect gzip and BGZF compression from the file content, so the input format only decides which files -d finds.

maf commands read .maf and .maf.gz files and take no input format.

:::note SEGUL reads relaxed PHYLIP, where names and sequences are separated by spaces and names can be any length. Strict PHYLIP, with blocks of ten characters separated by spaces, is not supported:

3 20
Seq1 ATCGATCGATATCGATCGAT
Seq2 ATCGATCGATATCGATCGAT
Seq3 ATCGATCGATATCGATCGAT

:::

Sequences are DNA by default. Use --datatype aa for amino acid sequences. SEGUL then checks that every sequence holds only valid IUPAC characters.

ValueUse for
dnaDNA sequences (default)
aaAmino acid sequences
ignoreSkip the character check. Up to 40% faster

--datatype ignore is safe when:

  1. The sequences are DNA.
  2. The sequences are amino acids, and either the input or the output is not NEXUS.
  3. You have already run the same dataset through SEGUL, or you are sure it holds only IUPAC characters and no spaces in sequence names.

Tasks that compute statistics, such as align summary and align distance, need dna or aa.

Every task writes to its own default directory in the current working directory, such as Align-Concat for align concat. Use --output or -o to choose another directory:

Terminal window
segul align concat --dir alignments/ --output concat

If the directory exists, SEGUL asks before removing it. Add --force to remove it without asking. Use --force on HPC clusters and in scripts, where no one can answer the prompt.

Tasks that write sequences take --output-format or -F. Most default to nexus. Check each task's default with --help.

SequentialInterleaved
nexusnexus-int
phylipphylip-int
fastafasta-int

align unalign, sequence add, and sequence transpose write FASTA only: fasta or fasta-int.

--prefix sets the name of the output files of tasks that write a single file or a summary, such as align concat, align summary, and read summary. sequence id also takes -p as a short form.

SEGUL records every run in segul.log in the current working directory. Use --log to write it elsewhere. See Log file.

Each task page ends with an All options table that lists the shared and task-specific options together.