Skip to content

App Design and Architecture

SEGUL is available as a GUI, CLI, and a library. All three versions share the same core functionalities. The SEGUL core library is written in Rust, a systems programming language that is known for its speed, memory safety, and parallelism. The GUI layer uses Flutter and is written in Dart. The CLI is wrapped around the Rust library and is written in Rust.

Dart FFIrun commandsimport pysegulR callsread & write by pathSEGUIGUI · desktop and mobileSEGUL CLITerminal apppysegulPython packagersegulR example packageRust wrapperssegui · rust/src/api/Bridged to DartFRBCLI parserssegul · src/cli/Args to library callsCLAPPython bindingspysegul · src/Built with maturinPYO3R bindingsrsegul · src/rust/Built with rextendrEXTENDRsegul-corecrates/segul-core · crates.io · docs.rsAll analyses, readers, and writers. Parallel with rayonRUSTalignsequencepartitionreadcontigmafplotparserwriterstatsYour filesFASTA · NEXUS · PHYLIP · FASTQ · MAF · BEDRead and written locally, never uploadedDISKApps and packagesRustLocal filesSEGUIDesktop, mobileSEGUL CLITerminalpysegulPythonrsegulR exampleRust wrapperssegui/rust/src/api/Bridged to DartCLI parserssegul/src/cli/Args to library callsPython bindingspysegul/src/Built with maturinR bindingsrsegul/src/rust/Built with rextendrsegul-corecrates/segul-coreAnalyses, readers, and writersalignsequencepartitionreadcontigmafplotparserwriterstatsYour filesFASTA · NEXUS · PHYLIP · FASTQ · MAFRead and written locallyApps and packagesRustLocal files
The SEGUL ecosystem. Every app and package calls the same segul-core library through a thin Rust layer, so a task gives the same result in the GUI, the CLI, Python, or R.

Every app and package calls the same segul-core library. Each one adds only a thin Rust layer that turns its own inputs into library calls:

  • SEGUI wraps the library in Rust functions that Flutter Rust Bridge (FRB) exposes to Dart.
  • SEGUL CLI parses command-line arguments with clap and passes them to the library.
  • pysegul exposes the library to Python with PyO3 and is built with maturin. See Python.
  • rsegul is an example of calling the library from R with rextendr. See R.

Because the analyses live in one place, a task gives the same output whichever interface runs it. Rust developers can also use segul-core directly. See Rust.

We use a multi-repository structure to separate the GUI from the SEGUL core library. The CLI and the core library share one repository as a Cargo workspace:

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.