Preprint
Article

This version is not peer-reviewed.

Termal: A Terminal-Based Multiple Sequence Alignment (MSA) Viewer

A peer-reviewed article of this preprint also exists.

Submitted:

18 August 2025

Posted:

19 August 2025

You are already at the latest version

Abstract
We present termal, a fast, interactive terminal-based viewer for multiple se- quence alignments (MSAs), designed for use on remote systems such as high-performance computing (HPC) clusters. Unlike traditional graphical viewers, termal runs entirely within a terminal and offers features such as scrolling, zooming, consensus/conservation visualization, and customizable colour schemes. It is implemented in Rust, ensuring high performance and minimal dependencies.
Keywords: 
;  ;  ;  

Introduction

Visualising multiple sequence alignments (MSAs) is a common task in computational biology. Many alignment viewers have a graphical user interface (GUI) and are hence unsuitable for use on headless or remote systems such as high-performance computing (HPC) clusters. Command-line tools do exist, for example alan[1], which stands out as a particularly elegant solution, since it is built on standard Unix tools such as awk and less — indeed, it served as the initial inspiration for the present work. This means, however, that alan’s interactivity is limited to that of a pager: features such as zooming, reordering sequences, as well as computing and displaying a consensus sequence are absent. While showalign[2] can compute a consensus, it does not support colouring residues, and the user must explicitly call a pager in order to scroll through the alignment. Other programs like alen[3] are interactive, but not all have built-in residue colour schemes or the ability to visually represent metrics such as similarity to the consensus, or to reorder sequences according to such metrics. The capacity to fit a large alignment on screen, typically by only displaying a subset of the sequences and columns, is also rare. In summary, text-based MSA viewers collectively provide a substantial range of functions, but no viewer implements all, or even most, of them. In this work we introduce termal, which combines most of these features in a single application.

Interface

Apart from the alignment sequences, which occupy the main pane, termal also displays sequence labels and ordinal numbers, a consensus sequence, and a conservation bar plot; it also displays sequence metrics such as similarity to the consensus, or (ungapped) length (Figure 1). The alignment can be scrolled one sequence/column at a time using arrow keys or familiar Vim-style motion keys h, j, k, and l; similar keystrokes allow jumping by screenfuls or to the edges of the alignment.
By default, residues of nucleotide alignments are coloured according to Jalview’s[4] nucleotide colour scheme, while protein alignments use that of ClustalX[5]. An alternative colour scheme for protein is Lesk’s[6], and all alignments can be rendered in monochrome.
Alignments that exceed the screen size—horizontally, vertically, or both—can be zoomed out to display only the first and last row and column, along with a sample of equidistant intermediates in both dimensions; the sample size is adjusted to fill the available screen space. This allows regions of high conservation to be spotted without scrolling. An alternative zoomed-out mode preserves the alignment’s aspect ratio, at the cost of some unused space.
The sequences can be reordered according to the currently-displayed sequence metric, in increasing or decreasing order. This allows e.g. to group the most complete sequences together, or those that best match the consensus.
The width of the label pane can be adjusted to fit label length, and both the side and bottom panes can be hidden to maximise the space allocated to the alignment.
termal includes a built-in help screen that lists all key bindings.

Comparison with Other TUI Tools

Dependencies and Installation

termal and alen are written in Rust[7] and compile to a single binary with no dependencies. By contrast, alv[8] requires BioPython and showalign is part of the EMBOSS suite.

Features

termal features zooming, interactive navigation, selectable themes and color maps, as well as ordering according to metrics. This combination of features is not found in the other programs considered, although all of them offer at least some of these features.

Performance and Limitations

termal has been tested on alignments exceeding 15,000 sequences and 1,500 columns (~22 million alignment cells), with startup and initial rendering completing in under one second on a machine with a 12th-generation Intel® CoreTM i5-1240P processor and 16 GB of RAM running Linux 6.14.2. In practice, interactive performance is limited more by the speed of the terminal emulator than by termal itself. GPU-accelerated terminals such as Alacritty[9], Kitty[10] and Ghostty[11] offer smoother scrolling at large screen sizes than do more traditional emulators, and terminals that support 24-bit colours give better results. termal is currently restricted to alignments in Fasta and Stockholm formats.

Availability

termal is distributed under the MIT license. It is available as a precompiled, statically-linked binary (for Linux, MacOS, and Windows), with no external dependencies or runtime environment required, from https://github.com/sib-swiss/termal.git. Alternatively, users with Rust installed can install it via cargo install termal-msa. The source code has also been deposited on Zenodo (https://zenodo.org/records/15472432).

Conclusion

While this work is not intended as a comprehensive review of terminal-based alignment viewers, we surveyed several of them, including showalign, alan, alv, and alen. To our knowledge, termal combines a unique set of features in a terminal interface. Its minimal dependencies and fast startup make termal suitable for both ad-hoc use and for integration into semi-automated workflows requiring alignments to be reviewed in a terminal. Accordingly, termal fills a niche for fast, interactive MSA exploration directly in the terminal, making it an ideal tool for remote bioinformatics workflows.

Author Contributions

Thomas Junier: Conceptualization, Software, Validation, Visualization Writing – Original Draft, Writing – Review & Editing.

Acknowledgments

The development of termal was funded by Swiss National Science Foundation BRIDGE Discovery grant 40B2-0_194701. The author wishes to thank Drs Guillaume Cailleau and Sébastien Moretti for insightful comments on the program.

Conflicts of Interest

The author declares no conflict of interest.

References

  1. Dunne, M. Alan: A lightweight alignment viewer for the terminal. https://github.com/mpdunne/alan, 2020. Accessed 2025-04-13.
  2. Rice, P.; Longden, I.; Bleasby, A. EMBOSS: the European Molecular Biology Open Software Suite. Trends in Genetics 2000, 16, 276–277. [Google Scholar] [CrossRef] [PubMed]
  3. Nissen, J. alen: Interactive terminal-based MSA viewer. https://github.com/jakobnissen/alen, 2023–2024. Accessed 2025-04-13.
  4. Waterhouse, A.M.; Procter, J.B.; Martin, D.M.; Clamp, M.; Barton, G.J. Jalview Version 2—a multiple sequence alignment editor and analysis workbench. Bioinformatics 2009, 25, 1189–1191. [Google Scholar] [CrossRef] [PubMed]
  5. Larkin, M.; Blackshields, G.; Brown, N.; Chenna, R.; McGettigan, P.; McWilliam, H.; Valentin, F.; Wallace, I.; Wilm, A.; Lopez, R.; et al. Clustal W and Clustal X version 2.0. Bioinformatics 2007, 23, 2947–2948. [Google Scholar] [CrossRef] [PubMed]
  6. Lesk, A.M. Introduction to bioinformatics; Oxford university press, 2019.
  7. Klabnik, S.; Nichols, C. The Rust Programming Language; No Starch Press, 2019.
  8. Arvestad, L. alv: a console-based viewer for molecular sequence alignments. Journal of Open Source Software 2018, 3, 955. [Google Scholar] [CrossRef]
  9. Wilm, J. ; contributors. Alacritty - A cross-platform, GPU-accelerated terminal emulator. https://github.com/alacritty/alacritty, 2017–2024. Accessed 2025-04-13.
  10. Goyal, K. Kitty - The fast, feature-rich, GPU-based terminal emulator. https://sw.kovidgoyal.net/kitty/, 2017–2024. Accessed 2025-04-13.
  11. Hashimoto, M. Ghostty - A modern, GPU-accelerated terminal emulator. https://github.com/mitchellh/ghostty, 2023–2024. Accessed 2025-04-13.
Figure 1. A snapshot of the interface of termal v1.0.0, showing a protein alignment. A: alignment filename and dimensions, B: sequence numbers pane, C: sequence labels pane, D: metric bar plot pane (currently displaying sequence similarity with the consensus), E: alignment pane, F: bottom pane, displaying sequence position, consensus, and conservation bar plot.
In this example the sequences are in the original (file) order, and use the ClustalX colour scheme. The view is zoomed in, that is, only a fraction of the alignment is displayed. To reproduce: run termal on the example datafile supplied in the distribution.
Figure 1. A snapshot of the interface of termal v1.0.0, showing a protein alignment. A: alignment filename and dimensions, B: sequence numbers pane, C: sequence labels pane, D: metric bar plot pane (currently displaying sequence similarity with the consensus), E: alignment pane, F: bottom pane, displaying sequence position, consensus, and conservation bar plot.
In this example the sequences are in the original (file) order, and use the ClustalX colour scheme. The view is zoomed in, that is, only a fraction of the alignment is displayed. To reproduce: run termal on the example datafile supplied in the distribution.
Preprints 173015 g001
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2025 MDPI (Basel, Switzerland) unless otherwise stated