Skip to content

Sequence Addition

Parts of a SEGUL commandThe command segul sequence add --dir source/ --to-dir destination/ has five parts: the program segul, the command sequence for the task group, the subcommand add for the task, the input --dir source/ (sequences to add), and the option --to-dir destination/ (destination).segulProgramsequenceCommandtask groupaddSubcommandtask--dir source/Inputsequences to add--to-dir destination/Optionsdestination

Add sequences to existing sequence files/alignments. Allow adding sequences from multiple sources to multiple destinations. The file formats for the source and destinations can be different, but SEGUL requires matching file names for both to add the sequences. If the destination files are aligned, all the output sequences will be unaligned. We recommend using MAFFT to align the resulting sequence files.

To add sequences, use the add command with the following options:

Terminal window
segul sequence add -d <source-sequence-dir> --to-dir <destination-sequence-dir>

For example:

Terminal window
segul sequence add -d source-sequence/ --to-dir destination-sequence/

The command above will look for any FASTA, NEXUS, or PHYLIP format sequences in the source directory and add them to the destination directory. You can specify the input format using the --input-format option. For example, to add sequences in NEXUS format, use the command below:

Terminal window
segul sequence add -d <source-sequence-dir> --to-dir <destination-sequence-dir> --input-format nexus

You can specify the destination format using the --to-fmt option. For example, to add sequences in NEXUS format to the destination directory in FASTA format, use the command below:

Terminal window
segul sequence add -d <source-sequence-dir> --to-dir <destination-sequence-dir> --input-format nexus --to-fmt fasta

Specify the output directory name and format

Section titled “Specify the output directory name and format”

By default, the output directory will be named Sequence-Addition. You can change the output directory name using the --output or -o option. For example, to name the output directory seq-add, use the command below:

Terminal window
segul sequence add -d <source-sequence-dir> --to-dir <destination-sequence-dir> --output seq-add

The output format will be in interleaved FASTA format. The other option is in sequential FASTA format. Use the --output-format fasta or -F fasta option to change the output to sequential FASTA format. For example:

Terminal window
segul sequence add -d <source-sequence-dir> --to-dir <destination-sequence-dir> --output-format fasta

By default, SEGUL will output all sequences in the destination directory. If the destination directory format differs from the output format, all the output will be changed to the selected output format. If you only want to output files with the added sequences, use the --added-only flag. For example:

Terminal window
segul sequence add -d <source-sequence-dir> --to-dir <destination-sequence-dir> --added-only
OptionDescription
-d, --dirDirectory with the sequences to add
-i, --inputSequence files. Allows wildcards
-f, --input-formatInput format: auto (default), fasta, nexus, or phylip
--datatypeData type: dna (default), aa, or ignore
--to-dirDirectory with the files to add sequences to
--to-inputFiles to add sequences to. Allows wildcards
--to-fmtFormat of the files to add to: auto (default), fasta, nexus, or phylip
--to-fileAdd all sequences to a single file instead
--added-onlyOnly write files that received new sequences
--include-filenameAdd the source file name to sequence IDs. Only with --to-file
-F, --output-formatOutput format: fasta-int (default) or fasta
-o, --outputOutput directory. Default: Sequence-Addition
--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.