\documentclass[10pt]{article}

\usepackage{fullpage}
\usepackage{setspace}
\usepackage{parskip}
\usepackage{titlesec}
\usepackage[section]{placeins}
\usepackage{xcolor}
\usepackage{breakcites}
\usepackage{lineno}
\usepackage{hyphenat}





\PassOptionsToPackage{hyphens}{url}
\usepackage[colorlinks = true,
            linkcolor = blue,
            urlcolor  = blue,
            citecolor = blue,
            anchorcolor = blue]{hyperref}
\usepackage{etoolbox}
\makeatletter
\patchcmd\@combinedblfloats{\box\@outputbox}{\unvbox\@outputbox}{}{%
  \errmessage{\noexpand\@combinedblfloats could not be patched}%
}%
\makeatother


\usepackage{natbib}




\renewenvironment{abstract}
  {{\bfseries\noindent{\abstractname}\par\nobreak}\footnotesize}
  {\bigskip}

\titlespacing{\section}{0pt}{*3}{*1}
\titlespacing{\subsection}{0pt}{*2}{*0.5}
\titlespacing{\subsubsection}{0pt}{*1.5}{0pt}


\usepackage{authblk}


\usepackage{graphicx}
\usepackage[space]{grffile}
\usepackage{latexsym}
\usepackage{textcomp}
\usepackage{longtable}
\usepackage{tabulary}
\usepackage{booktabs,array,multirow}
\usepackage{amsfonts,amsmath,amssymb}
\providecommand\citet{\cite}
\providecommand\citep{\cite}
\providecommand\citealt{\cite}
% You can conditionalize code for latexml or normal latex using this.
\newif\iflatexml\latexmlfalse
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}%

\AtBeginDocument{\DeclareGraphicsExtensions{.pdf,.PDF,.eps,.EPS,.png,.PNG,.tif,.TIF,.jpg,.JPG,.jpeg,.JPEG}}

\usepackage[utf8]{inputenc}
\usepackage[ngerman,english]{babel}



\usepackage{float}








\begin{document}

\title{SEGUL: An ultrafast, memory-efficient alignment manipulation and summary
tool for phylogenomics}



\author[1]{Heru Handika}%
\author[1]{Jacob Esselstyn}%
\affil[1]{Louisiana State University and A\&M College}%


\vspace{-1em}



  
  \date{June 15, 2024}


\begingroup
\let\center\flushleft
\let\endcenter\endflushleft
\maketitle
\endgroup





\selectlanguage{english}
\begin{abstract}
Phylogenetic studies now routinely require manipulating and summarizing
thousands of data files. For most of these tasks, currently available
software requires considerable computing resources and substantial
knowledge of command-line applications. We develop ultrafast and
memory-efficient software that performs over a dozen common phylogenomic
manipulations and calculates statistics summarizing essential data
features. Our software is available as standalone command-line (CLI) and
graphical user interface (GUI) applications, and as a programming
language library for Rust, R, and Python, with possible support of other
languages. The CLI and library versions, SEGUL, run native on Windows,
Linux, and macOS, including Apple ARM Macs. The GUI version extends
support to include mobile iOS and Android operating systems. SEGUL offer
fast execution times and low memory footprints regardless of dataset
size and platform choice. The inclusion of a GUI minimizes
bioinformatics barriers to phylogenomics while SEGUL's efficiency
reduces economic barriers by enabling analysis on inexpensive hardware.
Our support for mobile operating systems further enables teaching
phylogenomics where access to computing power is limited.%
\end{abstract}%



\sloppy


\textbf{Introduction}

The declining cost of DNA sequencing has increased the adoption of
phylogenetic studies using thousands of loci, but this trend has also
brought substantial analytical challenges. The most demanding parts of
typical phylogenomic workflows, such as raw sequence read cleaning and
adapter trimming (e.g. Fasp (Chen et al., 2018)), contig assembly (e.g.,
SPAdes (Bankevich et al., 2012)), sequence alignment (e.g., MAFFT (Katoh
et al., 2002)), phylogenetic tree estimation (e.g., RAxML-NG (Kozlov et
al., 2019) and IQ-TREE (Minh et al., 2020; Nguyen et al., 2015)), and
species delimitation (e.g., BPP (Yang, 2015)), use high-performance
programming languages (e.g., C and C++). However, other essential
workflow processes, such as alignment manipulation (e.g., filtering,
splitting, extracting, and concatenating) and summary statistic
calculation (e.g., number of parsimony informative sites, percent
missing data, etc), are typically carried out with applications written
in interpreted languages, such as Python (e.g., Borowiec, 2016;
Faircloth, 2016), R (e.g., Hutter et al., 2022), or Perl (e.g., K\selectlanguage{ngerman}ück \&
Longo, 2014). The computational efficiency of this approach is limited
by the requirement of an interpreter running alongside the application,
type inference at runtime, and garbage collection memory management,
which together result in a high memory footprint. One program, goalign
(Lemoine \& Gascuel, 2021), uses a compiled programming language and
eliminates dependencies required at runtime. Many of the program
functions, however, only operate on a single file, forcing users to
write custom scripts to work on thousands of genomic files.

With some exceptions (e.g., BPP (Yang, 2015) and FastQC (Andrews,
2010)), most commonly used phylogenomic programs are available only as
command-line interface (CLI) applications. CLI programs use computer
resources more efficiently than graphical user interface (GUI)
applications, and they are easier to develop than comparable GUI
software, but they present barriers for scientists with limited
computing knowledge or support. An approach using a high-performance
programming language with a GUI would produce fast execution and
efficient memory usage while minimizing the computing skills needed to
study phylogenomics.

A fast, memory efficient, reduced dependency application for
phylogenomic studies would enhance research efficiency and
repeatability, while also improving accessibility for evolutionary
biologists with limited computing resources. Furthermore, efficient
computing reduces the carbon footprint of bioinformatics (Grealey et
al., 2022). Such applications often require programmers to use a fast,
compiled programming language that allows fine control over how data are
managed in computer memory. In this context, the two commonly used
programming languages are C and C++. They require programmers to ensure
valid memory access, correct variable type to store data, and ensure no
data races (i.e., multiple cores/threads modify data concurrently),
which make them challenging to use (Perkel, 2020). These
code-correctness issues are difficult to avoid and represent common
problems in phylogenetic software (Darriba et al., 2018). The recently
emergent programming language, Rust, offers a memory-safe alternative to
C/C++ (Köster, 2016; Perkel, 2020). It comes with efficient development
tools (e.g., a package manager and a simple build system), guarantees
valid memory access, does not require garbage collection, and prevents
data races for multithreading applications. As a compiled programming
language, Rust has zero dependency at runtime and can be distributed as
a single executable CLI. Developing phylogenomic tools in Rust promises
efficient performance, while eliminating dependency issues at runtime.
Reducing dependencies minimizes conflict with other applications when
used as part of analysis pipelines and leads to improved research
reproducibility.

GUI development is more complicated than CLI development, especially
when targeting multiple platforms. A common cross-platform approach uses
Java (e.g., BEAST (Suchard et al., 2018), BEAST2 (Bouckaert et al.,
2019), FastQC (Andrews, 2010)), but this strategy is often limited by
the language's memory management. Furthermore, it is challenging to
maintain a consistent user interface (UI) across operating systems (see
TaxonDNA documentation, https://github.com/gaurav/taxondna (commit hash:
50584ac)). An alternative uses the Shiny package in R (e.g., phruta
(Román-Palacios, 2023), treehouse (Steenwyk \& Rokas, 2019)), but is
less efficient because the application runs in the R environment and a
browser. An emergent cross-platform framework, Flutter, promises mobile
and desktop support with consistent UI across platforms. The programming
language Dart, required to write Flutter applications, uses
garbage-collected memory management, and features an excellent
foreign-function interface to interact with higher-performance
programming languages. Writing our application using the Flutter
framework and Rust allows us to develop a cross-platform,
high-performance GUI application for phylogenomics.

We developed the SEGUL applications for phylogenomic data manipulation
and summarization. They are available as a CLI, GUI, and programming
language library, with support for MacOS, Linux, Windows, iOS, and
Android. We designed SEGUL with beginners in mind, while still providing
advanced features for experienced users. As such, they are suitable for
both research and teaching.

\textbf{Implementation}

SEGUL is a compiled, single executable, command-line application with no
dependencies. This version supports Windows (native and Windows
Subsystem for Linux), MacOS, and Linux. We provide a static executable
for old Linux distributions and a dynamically linked executable to GLIBC
(https://www.gnu.org/software/libc/) for more optimized performance in
newer Linux distributions. Users can install the pre-compiled executable
provided in the source code repository or compile the application from
the source code (see the Software Availability section below). The
latter installation method expands SEGUL platform support to any
operating system supported by Rust
(\emph{https://doc.rust-lang.org/nightly/rustc/platform-support.html}).
The compiler also fine-tunes the resulting executable for the user's
computer.

The GUI version is written in Dart using the Flutter framework. All
expensive computation uses the same Rust code base as our CLI and
library. The application is available in beta supporting Windows, MacOS,
iOS, iPadOS, and Android. We anticipate future support for Linux. The
current version is available to test using Apple TestFlight for iOS,
iPadOS, and macOS, and by downloading the application at the GitHub
repository page for other operating systems (see Software Availability
below). We expect to distribute the stable version via the official
store of each operating system, such as AppStore for iOS and PlayStore
for Android.

SEGUL is also available as a Rust library (called crates in the Rust
programming term), allowing developers to access SEGUL functions through
the application programming interface (API). For Rust, the installation
process is as easy as typing ``cargo add segul'' or by manually adding
segul as a dependency in the Rust cargo.toml file. The versality of the
Rust programming language and the performance of our library will be
attractive for usage in slower programming languages (e.g., Python and
R). For these languages, programmers can bind SEGUL via the C
programming interface. In R and Python, however, Rust support is growing
due its value for developing high-performance software without the
challenging aspects of C/C++ memory management models. Packages exist to
simplify the binding of Rust. In R, programmers can use rextendr
package; in Python, PyO3 is available. Python or R code can also
interact with the SEGUL CLI using the operating system process. While
SEGUL CLI is a single executable with no dependency, for published
software, interacting through SEGUL API yields a cleaner application
design and avoids common dependency issues, such as improper setup of
environment variables. We used a similar approach to develop the GUI
version. We provide more detailed instructions in our application
documentation (https://docs.page/hhandika/segul-docs/).

\textbf{Feature and Usages}

SEGUL development focuses on improved efficiency when working with
thousands of alignment files, enabling analysis on computers with
limited capabilities. We achieve this goal by reducing execution time
and RAM usages. SEGUL has a growing list of features for phylogenomic
data manipulation and summary statistic calculation (Table 1). Although
phylogenomic analyses are growing in frequency, Sanger sequencing
remains common in certain circumstances. Several features of our
applications, such as alignment concatenation, sequence removal and
translation, are applicable to both phylogenomic and Sanger datasets.

All versions of SEGUL work on FASTA, NEXUS, and relaxed-PHYLIP for
alignment and processed sequence files, NEXUS and RaXML standards for
partitions, and uncompressed and gunzip compressed FASTQ files for
raw-read sequences. All sequence and alignment files are supported in
interleaved and sequential format. Except for alignment splitting, all
the features support multiple input files. All application versions
provide detailed log file output. SEGUL-critical and some non-critical
functions are tested using the unittest system provided by the Rust and
Dart programming languages. We implement a continuous integration system
using GitHub Action (https://github.com/features/actions) to
automatically validate code changes and ensure that failures in the
designed tests are publicly displayed in the source code repository.

The command-line version, SEGUL, features an informative terminal output
with information on the application input, processing stages, and output
(see example in Figure S1). Multiple file outputs will always be written
to a directory. The applications do not automatically overwrite existing
files but do provide an overwrite option for automated phylogenomic
pipelines.

The GUI version offers interactive access to SEGUL features, while
keeping similar performance to its CLI sibling. We leverage Flutter
cross-platform and adaptive UI support to adapt UI elements to different
screen sizes and platforms. For example, on a small screen, such as on a
smartphone, features are accessed through a bottom navigation bar,
whereas on larger screens (e.g., tablets, laptops, and desktops), the
navigation bar is placed vertically on the left side of the screen to
take advantage of greater screen width. We anticipate future development
to provide more interactive UI element to view the results and better
space usages when running SEGUL GUI on large-screen devices.

The first version of SEGUL GUI supports all the features of the CLI
version, while outputting similar log files and equivalent SEGUL command
lines to enable reproducibility. We also include a share function to
simplify cross-device file sharing using operating system features. For
example, on iOS and MacOS, users can send files between Apple devices
via AirDrop without leaving SEGUL GUI. We anticipate future development
to provide interactive statistics and simplify checking application
input and output.

\textbf{Comparison to similar phylogenomic applications}

\emph{Feature comparison}

We compare SEGUL to goalign (Lemoine \& Gascuel, 2021) and AMAS
(Borowiec, 2016) because they share similar performance and use cases.
goalign is the most feature-rich (Table 1), however, most of its
functions operate on a single file; two exceptions are alignment
concatenation (multiple files) and sequence alignment (two files). AMAS
and SEGUL, on the other hand, operate on single or multiple files
without extra effort from the user. All applications provide APIs, but
neither AMAS nor goalign offers a GUI. Several features (e.g., sample
mapping, sequence unique ID parsing, and partition format conversion)
are unique to SEGUL.

While several SEGUL features overlap with AMAS and goalign, SEGUL
provides more functionalities. For instance, SEGUL generates summary
statistics for alignment files, raw read sequences, and contiguous
sequence, whereas AMAS and goalign only support alignment files. The
application raw summary statistics provides a simple version of the
statistics generated by FastQC (Andrew, 2010). It outputs csv files and
is designed to compare many raw read sequences quickly without an
additional application (e.g., multiQC to summarize FastQC results). For
alignment files, SEGUL always checks that the sequences within each
alignment are the same length and by default checking for the sequence
containing valid \emph{IUPAC} characters. To speed up processing for
most features, users can skip the \emph{IUPAC} checking using the
``---ignore-datatype'' option, but alignment length is always checked.
AMAS does not check for \emph{IUPAC} characters and checking the
sequence alignment is optional. goalign checks both but does not
generate alignment partitions. Another example, the SEGUL sequence
removal feature supports regular expression, file, and terminal input,
while AMAS supports only terminal input. As noted above, the goalign
sequence removal works on only a single file.

Table 1. Feature comparison among SEGUL v0.19.0, AMAS v1.02, and goalign
v0.3.5.\selectlanguage{english}
\begin{longtable}[]{@{}llll@{}}
\toprule
Features & SEGUL & AMAS & goalign\tabularnewline
\midrule
\endhead
Alignment compression & & & yes\tabularnewline
Alignment concatenation & yes & yes & limited\tabularnewline
Alignment consensus & & & yes\tabularnewline
Alignment conversion & multiple files & multiple files & single
file\tabularnewline
Alignment drawing & & & yes\tabularnewline
Alignment filtering & yes & &\tabularnewline
Alignment masking & & & yes\tabularnewline
Alignment shuffling & & & yes\tabularnewline
Alignment splitting & yes & yes & yes\tabularnewline
Alignment summary statistics & rich & moderate & limited\tabularnewline
Alignment to unaligned sequence conversion & & & yes\tabularnewline
Alignment transposal & & & yes\tabularnewline
Contiguous sequence summary statistics & yes & &\tabularnewline
Duplicate sequence removal & & & yes\tabularnewline
Multi-sequence alignment & & & yes\tabularnewline
Open reading frame finder & & & yes\tabularnewline
Partition format conversion & yes & &\tabularnewline
Raw read summary statistics & limited & &\tabularnewline
Sample distribution mapping & yes & &\tabularnewline
Sample mapping & yes & &\tabularnewline
Sequence comparison & & & yes\tabularnewline
Sequence extraction & multiple files & & single file\tabularnewline
Sequence ID renaming & multiple files & & single file\tabularnewline
Sequence removal & multiple files & multiple files & single
file\tabularnewline
Sequence replication & & multiple files & single file\tabularnewline
Sequence translation & multiple files & multiple files & single
file\tabularnewline
Sequence trimming & & & yes\tabularnewline
Sequence unique ID parsing & yes & &\tabularnewline
API support & yes & yes & yes\tabularnewline
GUI version availability & yes & &\tabularnewline
Mobile support & yes & &\tabularnewline
\bottomrule
\end{longtable}

\emph{Performance comparison}

To highlight SEGUL performance, we compared features of the command line
version SEGUL v0.19.0 to AMAS v1.02 (see Borowiec 2016), the fastest
alternative application and the most comparable with SEGUL. We test the
applications under different settings to see how performance differs
between similar features of the programs. For example, we test AMAS
using ``--check-align'' command to make it more comparable with SEGUL
that checks the alignment by default. We include goalign v0.3.5 for the
alignment concatenation performance test.

We recorded CPU core usages to see how they impact the performance of
the programs. SEGUL detects available CPU cores and uses them according
to the current workload. AMAS and goalign, on the other hand, have
settings for the core counts. We set AMAS to use all available cores in
comparisons with SEGUL. Like SEGUL, the actual number of cores being
used by AMAS would depend on workload, and to some extent, on the
multithreading algorithm implemented by the programming language.

Our early tests showed the optimal performance for all applications was
in the Linux operating system (Figure S1). Thus, we ran all our
subsequent performance tests on Linux. We used six published genomic
datasets (four DNA sequence datasets and two amino acid sequence
datasets (AA)) with a range of taxon, site, and character counts (Table
2). We downloaded the datasets either directly from the original sources
or using BenchmarkAlignments scripts
(\emph{https://github.com/roblanf/BenchmarkAlignments}). To simplify
visualization, we transformed the execution time using natural log
(Figure 1).

Except for alignment concatenation, SEGUL was consistently faster than
AMAS (Table 3, Figure 1). The starkest difference is for summary
statistic calculations. SEGUL is 51.7 times faster than AMAS, despite
producing more statistics. AMAS was noticeably slow when using the
``--check-align'' setting. For example, on average across all datasets,
AMAS ``--check-align'' was 53.4 times slower than SEGUL for alignment
concatenation, whereas without the ``--check-align'' setting, it is 1.2
times faster. SEGUL was 2.2 times faster than goalign for alignment
concatenation.

Regardless of the compared features, SEGUL used less RAM than AMAS.
Across all tested datasets, the starkest contrast is when removing
sequences. On average, SEGUL used 0.05 of the RAM that AMAS used. To our
surprise, goalign, written in the compiled programming language, Go,
used 1.4 times more RAM than AMAS, which was written in Python, when
concatenating alignments.

CPU usages varied across tested features. For alignment concatenation,
when AMAS was faster than SEGUL, AMAS used five times more cores than
SEGUL, while providing 1.2 speed up. For the summary statistics, SEGUL
used five times more cores than AMAS, while providing 51 times speed up.
Other feature comparisons showed nearly equal CPU usages. The multi core
settings of goalign is slower than the single core settings.

Table 2. Dataset sources and alignment statistics.\selectlanguage{english}
\begin{longtable}[]{@{}llllll@{}}
\toprule
\begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Datasets\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Datatype\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Taxon count\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Locus count\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Site count\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Dataset url\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Chan et al. (2020)\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
DNA\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
50\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
13,181\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
6,180,393\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
\emph{dx.doi.org/10.5061/dryad.8cz8w9gn7}\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.16\columnwidth}\raggedright\strut
Esselstyn et al. (2021)\strut
\end{minipage} & \begin{minipage}[t]{0.16\columnwidth}\raggedright\strut
DNA\strut
\end{minipage} & \begin{minipage}[t]{0.16\columnwidth}\raggedright\strut
102\strut
\end{minipage} & \begin{minipage}[t]{0.16\columnwidth}\raggedright\strut
4040\strut
\end{minipage} & \begin{minipage}[t]{0.16\columnwidth}\raggedright\strut
5,398,947\strut
\end{minipage} & \begin{minipage}[t]{0.16\columnwidth}\raggedright\strut
\emph{dx.doi.org/10.5281/zenodo.6459213}

{\label{dx.doi.org10.5281zenodo.6459213}}\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Jarvis et al. (2014)\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
DNA\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
49\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
3679\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
9,251,694\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
\emph{http://gigadb.org/dataset/101041\#}\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Oliveros et al. (2019)\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
DNA\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
221\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
4060\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
2,464,926\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
\emph{dx.doi.org/10.5061/dryad.2vd01gr}\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Shen et al. (2018)\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Amino acid\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
343\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
2408\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
1,162,805\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
\emph{dx.doi.org/10.6084/m9.figshare.5854692}\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Wu et al. (2018)\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
Amino acid\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
90\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
5162\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
3,050,198\strut
\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedright\strut
\emph{dx.doi.org/10.6084/m9.figshare.6031190.v2}\strut
\end{minipage}\tabularnewline
\bottomrule
\end{longtable}\selectlanguage{english}
\begin{figure}[H]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/image1/image1}

\end{center}
\end{figure}

Figure 1. SEGUL, AMAS, and goalign average execution time and RAM usage
on three selected datasets. All analyses were completed on Linux. SEGUL
(--datatype ignore) is not available for summary statistics.

Table 3. Mean execution time (in seconds), random access memory (RAM)
usage (in megabytes), and central processing unit (CPU) usage (in
percent) across all six tested datasets. A single core usage is equal to
100 percent CPU usages.\selectlanguage{english}
\begin{longtable}[]{@{}lllll@{}}
\toprule
Analyses & Applications & Execution time (secs) & RAM usages (Mb) & CPU
usages (\%)\tabularnewline
\midrule
\endhead
Alignment Concatenation & AMAS & 2.0 & 1701.0 & 791.4\tabularnewline
Alignment Concatenation & AMAS (--check-align) & 128.3 & 1700.6 &
192.1\tabularnewline
Alignment Concatenation & SEGUL & 2.4 & 509.5 & 156.2\tabularnewline
Alignment Concatenation & SEGUL (--datatype ignore) & 0.9 & 509.5 &
239.2\tabularnewline
Alignment Concatenation & goalign (multi-core) & 5.2 & 2394.0 &
104.1\tabularnewline
Alignment Concatenation & goalign (single core) & 4.8 & 2366.3 &
99.9\tabularnewline
Alignment Conversion & AMAS & 1.3 & 487.1 & 1083.3\tabularnewline
Alignment Conversion & AMAS (--check-align) & 134.0 & 487.0 &
194.7\tabularnewline
Alignment Conversion & SEGUL & 0.3 & 33.6 & 1634.4\tabularnewline
Alignment Conversion & SEGUL (--datatype ignore) & 0.3 & 33.7 &
774.4\tabularnewline
Alignment Splitting & AMAS & 4.2 & 700.5 & 100.5\tabularnewline
Alignment Splitting & AMAS (--remove-empty) & 4.8 & 618.9 &
99.8\tabularnewline
Alignment Splitting & SEGUL & 1.7 & 314.9 & 166.4\tabularnewline
Alignment Splitting & SEGUL (--datatype ignore) & 0.6 & 316.3 &
267.5\tabularnewline
Sequence Removal & AMAS & 1.8 & 722.0 & 1013.9\tabularnewline
Sequence Removal & AMAS (--check-align) & 209.3 & 722.7 &
107.3\tabularnewline
Sequence Removal & SEGUL & 0.5 & 32.9 & 1140.3\tabularnewline
Sequence Removal & SEGUL (--datatype ignore) & 0.5 & 32.3 &
561.8\tabularnewline
Summary Statistics & AMAS & 48.8 & 1382.6 & 368.0\tabularnewline
Summary Statistics & SEGUL & 0.9 & 301.9 & 1734.7\tabularnewline
\bottomrule
\end{longtable}

\textbf{Discussion}

The field of phylogenomics relies on a broad range of efficient software
for many operations in a typical workflow (e.g., raw read assembly, tree
inference), but other aspects of standard analysis pipelines are
neglected. We developed SEGUL to fill a need for software that can
manipulate alignment files and calculate summary statistics in a manner
suitable for computational experts and novices alike. SEGUL offers
consistently fast operations, low memory demands, and efficient CPU use
across all supported features. The convenient features of SEGUL (e.g.,
GUI support, safe command line application) offer an easy introduction
for beginners with no cost to performance for advanced users.

There is an increasing trend of relaying to containerized applications
(i.e., using Docker and Singularity) to solve dependency issues, but
this fix makes it harder for computing novices to study phylogenomics.
We take a different approach by minimizing dependencies to simplify
installation. We add GUI support to further aid evolutionary biologists
who prefer the convenience of a GUI, while retaining efficiency and
reproducibility. Using GUI version may also be more convenient to
perform the tasks on small datasets (e.g., Sanger sequencing datasets),
and for introductory teaching situations.

SEGUL support for mobile devices enables a new way to perform
phylogenomic data manipulation and summary statistics. Our application
facilitates teaching phylogenomics to students who use mobile devices
(e.g., tablets) as their primary computers. Many authors publish their
alignments (e.g., Jarvis et al., 2014; Oliveros et al., 2019,
https://github.com/roblanf/BenchmarkAlignments) and phylogenetic tree
estimation can be conducted on the web (DeSalle et al., 2020). Our
application allows the entire process from alignment inspection and
concatenation to phylogenetic tree estimation to be conducted from a
mobile device. Mobile devices are becoming more powerful, with some
tablets, such as Apple's iPad Pro and iPad Air, using the same
processors as their laptop and desktop counterparts. Future
implementations to exploit mobile device strengths, such as touch input,
would enhance the benefits of mobile applications for phylogenomic data
manipulations.

We achieve a cross-platform, high-performance application by writing our
GUI code in Flutter and handling expensive computation in Rust. Our
implementation of this approach in the neglected aspects of typical
phylogenomic workflows provides proof of concept in the development and
scaling of high-performance applications with GUI interaction on desktop
and mobile operating systems. Extension of our approach to other aspects
of phylogenomic workflows would pave the way for more user-friendly
software to study phylogenomics and enable teaching students with
limited access to computational power.

\textbf{Conclusions}

SEGUL is an ultrafast, memory-efficient tool to manipulate alignments
and generate summary statistics for phylogenomics. It is consistently
fast with low memory usages regardless of dataset, operating system, and
CPU architecture, while providing extra features, such as a log file, a
more informative terminal output, GUI application, and a broad array of
summary statistics. SEGUL support devices from smartphones, tablets,
laptops, and desktops, to high-performance computers. Their efficient
use of computing resources, cross-platform support, and the inclusion of
a log file offers greater repeatability and accessibility than
alternative applications.

\textbf{Software Availability}

SEGUL is open source and freely available under the Massachusetts
Institute of Technology (MIT) license. It is a cross-platform
application and has been tested through automatic and manual testing on
Windows (including Windows Subsystem for Linux), Linux, and macOS (both
Intel and ARM CPUs). Source code is available on GitHub
at\emph{https://github.com/hhandika/segul}and
https://github.com/hhandika/segui for the GUI version. We provide
extensive documentation on installing and using all versions of the
application at https://docs.page/hhandika/segul-docs. Source code
documentation is available at https://docs.rs/segul/latest/segul/.

\textbf{Data Accessibility}

All datasets used for testing software performance are provided by the
authors as described in Table 2. The code for performance tests is
available at https://github.com/hhandika/segul-bench
(https://doi.org/10.5281/zenodo.8115116).

\textbf{Acknowledgements}

We thank Andre E. Moncrieff, Austin S. Chipps, Carl R. Hutter, Diego J.
Elias, Giovani Hern\selectlanguage{ngerman}ández-Canchola, Glaucia C. Del-Rio, Roberta C.
Canton, Samantha L. Rutledge, Sarin Tiatragul, and Spenser J.
Babb-Biernacki for their feedback on the application and its
documentation. Several SEGUL features are inspired by Phyluce, AMAS, and
FrogCap. SEGUL benefited greatly from general-purpose libraries,
particularly those provided by the Rust and Flutter Programming
Communities. Alana Alexander and three anonymous reviewers provided
helpful suggestions on an earlier version of this manuscript.

\textbf{Author Contributions}

H.H. conceived the project, designed the application, and wrote the
code, documentation, and manuscript. J. A. E. provided feedback on the
application design, documentation, and manuscript.

\textbf{References}

Andrews, S. (2010). \emph{FastQC A Quality Control tool for High
Throughput Sequence Data} .
http://www.bioinformatics.babraham.ac.uk/projects/fastqc/

Bankevich, A., Nurk, S., Antipov, D., Gurevich, A. A., Dvorkin, M.,
Kulikov, A. S., Lesin, V. M., Nikolenko, S. I., Pham, S., Prjibelski, A.
D., Pyshkin, A. V., Sirotkin, A. V., Vyahhi, N., Tesler, G., Alekseyev,
M. A., \& Pevzner, P. A. (2012). SPAdes: a new genome assembly algorithm
and its applications to single-cell sequencing. \emph{Journal of
Computational Biology: A Journal of Computational Molecular Cell
Biology} , \emph{19} (5), 455--477.
https://doi.org/10.1089/cmb.2012.0021

Borowiec, M. L. (2016). AMAS: a fast tool for alignment manipulation and
computing of summary statistics. In \emph{PeerJ} (Vol. 4, p. e1660).
https://doi.org/10.7717/peerj.1660

Bouckaert, R., Vaughan, T. G., Barido-Sottani, J., Duchêne, S.,
Fourment, M., Gavryushkina, A., Heled, J., Jones, G., Kühnert, D., De
Maio, N., Matschiner, M., Mendes, F. K., Müller, N. F., Ogilvie, H. A.,
du Plessis, L., Popinga, A., Rambaut, A., Rasmussen, D., Siveroni, I.,
\ldots{} Drummond, A. J. (2019). BEAST 2.5: An advanced software
platform for Bayesian evolutionary analysis. \emph{PLoS Computational
Biology} , \emph{15} (4), e1006650.
https://doi.org/10.1371/journal.pcbi.1006650

Chen, S., Zhou, Y., Chen, Y., \& Gu, J. (2018). fastp: an ultra-fast
all-in-one FASTQ preprocessor. In \emph{Bioinformatics} (Vol. 34, Issue
17, pp. i884--i890). https://doi.org/10.1093/bioinformatics/bty560

Darriba, D., Flouri, T., \& Stamatakis, A. (2018). The state of software
for evolutionary biology. \emph{Molecular Biology and Evolution}
,\emph{35} (5), 1037--1046. https://doi.org/10.1093/molbev/msy014

DeSalle, R., Tessler, M., \& Rosenfeld, J. (2020). Phylogenetic Programs
and Websites. In \emph{Phylogenomics} (pp. 213--222). CRC Press.
https://doi.org/10.1201/9780429397547-20

Faircloth, B. C. (2016). PHYLUCE is a software package for the analysis
of conserved genomic loci. \emph{Bioinformatics} , \emph{32} (5),
786--788. https://doi.org/10.1093/bioinformatics/btv646

Grealey, J., Lannelongue, L., Saw, W.-Y., Marten, J., Méric, G.,
Ruiz-Carmona, S., \& Inouye, M. (2022). The Carbon Footprint of
Bioinformatics. \emph{Molecular Biology and Evolution} , \emph{39} (3).
https://doi.org/10.1093/molbev/msac034

Hutter, C. R., Cobb, K. A., Portik, D. M., Travers, S. L., Wood, P. L.,
Jr, \& Brown, R. M. (2022). FrogCap: A modular sequence capture
probe-set for phylogenomics and population genetics for all frogs,
assessed across multiple phylogenetic scales. \emph{Molecular Ecology
Resources} , \emph{22} (3), 1100--1119.
https://doi.org/10.1111/1755-0998.13517

Jarvis, E. D., Mirarab, S., Aberer, A. J., Li, B., Houde, P., Li, C.,
Ho, S. Y. W., Faircloth, B. C., Nabholz, B., Howard, J. T., Suh, A.,
Weber, C. C., da Fonseca, R. R., Li, J., Zhang, F., Li, H., Zhou, L.,
Narula, N., Liu, L., \ldots{} Zhang, G. (2014). Whole-genome analyses
resolve early branches in the tree of life of modern
birds.\emph{Science} , \emph{346} (6215), 1320--1331.
https://doi.org/10.1126/science.1253451

Katoh, K., Misawa, K., Kuma, K.-I., \& Miyata, T. (2002). MAFFT: a novel
method for rapid multiple sequence alignment based on fast Fourier
transform. \emph{Nucleic Acids Research} , \emph{30} (14), 3059--3066.
https://doi.org/10.1093/nar/gkf436

Köster, J. (2016). Rust-Bio: a fast and safe bioinformatics
library.\emph{Bioinformatics} , \emph{32} (3), 444--446.
https://doi.org/10.1093/bioinformatics/btv573

Kozlov, A. M., Darriba, D., Flouri, T., Morel, B., \& Stamatakis, A.
(2019). RAxML-NG: a fast, scalable and user-friendly tool for maximum
likelihood phylogenetic inference. \emph{Bioinformatics} ,\emph{35}
(21), 4453--4455. https://doi.org/10.1093/bioinformatics/btz305

Kück, P., \& Longo, G. C. (2014). FASconCAT-G: extensive functions for
multiple sequence alignment preparations concerning phylogenetic
studies. \emph{Frontiers in Zoology} , \emph{11} (1), 81.
https://doi.org/10.1186/s12983-014-0081-x

Lemoine, F., \& Gascuel, O. (2021). Gotree/Goalign: toolkit and Go API
to facilitate the development of phylogenetic workflows. \emph{NAR
Genomics and Bioinformatics} , \emph{3} (3), lqab075.
https://doi.org/10.1093/nargab/lqab075

Minh, B. Q., Schmidt, H. A., Chernomor, O., Schrempf, D., Woodhams, M.
D., von Haeseler, A., \& Lanfear, R. (2020). IQ-TREE 2: New Models and
Efficient Methods for Phylogenetic Inference in the Genomic
Era.\emph{Molecular Biology and Evolution} , \emph{37} (5), 1530--1534.
https://doi.org/10.1093/molbev/msaa015

Nguyen, L.-T., Schmidt, H. A., von Haeseler, A., \& Minh, B. Q. (2015).
IQ-TREE: a fast and effective stochastic algorithm for estimating
maximum-likelihood phylogenies. \emph{Molecular Biology and Evolution}
,\emph{32} (1), 268--274. https://doi.org/10.1093/molbev/msu300

Oliveros, C. H., Field, D. J., Ksepka, D. T., Barker, F. K., Aleixo, A.,
Andersen, M. J., Alström, P., Benz, B. W., Braun, E. L., Braun, M. J.,
Bravo, G. A., Brumfield, R. T., Chesser, R. T., Claramunt, S., Cracraft,
J., Cuervo, A. M., Derryberry, E. P., Glenn, T. C., Harvey, M. G.,
\ldots{} Faircloth, B. C. (2019). Earth history and the passerine
superradiation. \emph{Proceedings of the National Academy of Sciences of
the United States of America} , \emph{116} (16), 7916--7925.
https://doi.org/10.1073/pnas.1813206116

Perkel, J. M. (2020). Why scientists are turning to Rust. \emph{Nature}
,\emph{588} (7836), 185--186. https://doi.org/10.1038/d41586-020-03382-2

Román-Palacios, C. (2023). The `phruta' R package and `salphycon' shiny
app: increasing access, reproducibility, and transparency in
phylogenetic analyses. In \emph{bioRxiv} (p. 2023.01.11.523621).
https://doi.org/10.1101/2023.01.11.523621

Steenwyk, J. L., \& Rokas, A. (2019). Treehouse: a user-friendly
application to obtain subtrees from large phylogenies. \emph{BMC
Research Notes} , \emph{12} (1), 541.
https://doi.org/10.1186/s13104-019-4577-5

Suchard, M. A., Lemey, P., Baele, G., Ayres, D. L., Drummond, A. J., \&
Rambaut, A. (2018). Bayesian phylogenetic and phylodynamic data
integration using BEAST 1.10. \emph{Virus Evolution} , \emph{4} (1),
vey016. https://doi.org/10.1093/ve/vey016

Yang, Z. (2015). The BPP program for species tree estimation and species
delimitation. \emph{Current Zoology} , \emph{61} (5), 854--865.
https://doi.org/10.1093/czoolo/61.5.854

\selectlanguage{english}
\FloatBarrier
\end{document}

