Skip to main content

Module interactive

Module interactive 

Source
Expand description

Full-screen terminal views (feature tui), and line prompts for when there is no terminal.

  • ui: the shared pieces for building a view. The palette (terminal foreground plus one accent), ui::panel, ui::header, ui::help_line, ui::input_line, the ui::Screen trait driven by ui::run_screen, and histograms: ui::Scale, ui::Binning, ui::Binned, ui::HistPlot, and ui::MirrorPlot for two series around one zero line.
  • qc_tui: qc’s view: cell QC rules moved on their histograms.
  • list_tui: a list to browse, flat (names) or a tree (a file’s hierarchy): filter, mark, write, copy.
  • plan_tui: what a command is about to write, with its settings on keys: Enter writes, q does not.
  • sim_tui (feature sim): a reference-mode simulation against its reference, from its fidelity report.
  • stat_tui: table-and-histogram explorer over plain name and value columns, optionally marking entries and handing them back.

Open a view only when tui_available; otherwise fall back to text.

The views run in a legume-tui session (TOOL): a command opens it first thing and hands it to ui::Tui or ui::run_screen_in; where the session is hosted, the command keeps running when the connection drops. ui::run_screen runs a view in a plain session of its own (legume_tui::Session::plain).

Modules§

list_tui
A list to browse, flat or a tree: the names of a matrix’s rows or columns (row-names, column-names), or the hierarchy of a file (list-h5, list-zarr).
plan_tui
What a command is about to write, before it writes it: a table of the inputs or outputs (rows, columns, what is shared), notes, and the command’s settings, each on a key. A flag flips on its key; a number asks for a new value. Every change redraws the plan; Enter writes with the settings shown, q writes nothing. A plan that cannot be written says why, and Enter waits for a setting that can.
qc_tui
data-beans qc’s full-screen view: the cell QC rules in a table, each with its edge, how many cells it fails and how many it alone removes; the selected rule’s histogram in three layers (every cell, the cells passing the other rules, the cells only it removes); total counts against detected genes; and the removed cells by the rules they fail.
stat_tui
Full-screen explorer for per-row and per-column statistics.
ui
Shared pieces of the full-screen views: the palette, panels, header and help lines, the event loop, histogram scales and binning, and a histogram plot with a y gutter, an x axis, and markers.

Constants§

BATCH_ENV
Set, to anything but empty or 0, to run every command straight through as --batch-process does: for a script or pipeline started from a terminal, which its commands would otherwise take for the user’s.
TOOL
The tool data-beans’ sessions belong to: they are named data-beans-qc-1, data-beans-stat-2, and data-beans attach finds them.

Functions§

opens_view
Whether command opens its view, for a command that runs without one too (qc, stat): not when batch is asked (batch, its --batch-process, or BATCH_ENV), and only on a terminal. A view skipped for want of a terminal (output redirected, say) is said in one line on stderr, so the switch is never silent; asked for, it is quiet.
picks
Whether command picks its rows or columns in the explorer, for a command that takes them on the command line too (columns, subset-rows, …): only when the command line selected none. Then batch asked (batch, or BATCH_ENV) or no terminal is an error naming options, what selects them instead.
session_help
The paragraph a command’s long help ends with about its session: lead first, for a command whose view is optional (when it runs as a session), then how it runs, the detach and switch keys, how to return, and more at the end. Its views are always opened on something named, so a new start never offers the live sessions; data-beans attach does.
session_keys
The detach and switch keys for a title bar (ui::title_bar), each with what it does in a word (detach, switch); none when the views run plain.
tui_available
Whether a full-screen view can run: stdin and stdout are a terminal, and one that can draw it (TERM is not dumb).