Skip to content

pwm: the logo by default, output folders as input, a file picker; saves never overwrite (0.16.7) - #20

Merged
YPARK merged 7 commits into
mainfrom
pwm-view
Oct 13, 2026
Merged

YPARK merged 7 commits into
mainfrom
pwm-view

Conversation

@YPARK

@YPARK YPARK commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What changes

  • The logo by default. faba pwm shows the sequence logo full screen unless --batch-process (alias --batch-mode) is given, or there is no terminal. -I/--interactive is gone from pwm, pileup and metagene: the view is the default, so --batch-process is the only switch. Old command lines with -I now fail to parse.
  • Output folders as input. faba pwm out/ reads the folder's site table of --modality (m6A, else A-to-I) against its recorded genome; a run record in it works too.
  • A picker when no sites are given. The same browser as pileup and metagene: mark site tables, or choose a faba folder.
  • Several site tables. They are read in parallel and pooled into one set of sites. With --source reference they must record the same genome, or --genome names one; this is checked before any reading.
  • A genome when none is recorded. In the view, with no -f and no recorded genome found on this machine, a picker lists FASTA files; Tab downloads one from GENCODE or Ensembl into ~/faba_refs/, as faba run does, starting on the source whose chromosome names match the sites. --batch-process still stops with the error.
  • Parallel reference reads. --source reference reads the FASTA across threads, a reader per chunk of sites (same output, byte for byte, on the chr19 test set).
  • APA sites keep their strand. apa_components.parquet gains a strand column (the UTR's), and the site reader uses it, so pwm reverse-complements minus-strand APA sites as it does m6A and A-to-I ones. Tables written before have none: read as forward, with a warning to rerun faba apa.
  • BAMs stay positional. .bam, .cram and .sam arguments are reads, the rest sites, so faba pwm -s sites.parquet sample.bam --source reads works as before. BAMs given without --source reads are named in a warning.
  • -o is optional. With --batch-process and no -o, the PWM goes to {sites}.pwm.tsv in the current folder; in the view it is written only when -o is given.
  • A BAM read error is an error. It used to panic; under the new spinner that left the view spinning forever.

Saved figures never overwrite

The save prompt every figure view shares (pileup, metagene, pwm) now offers a name no save has used yet (pwm_logo, pwm_logo_2, …). Typing a name whose .pdf or .png exists keeps the prompt open with the next free one and says why.

The picker's key hints

They no longer get cut off: three lines (moving, marking, finishing), with the list sized to leave room for them.

One set of key rules

An audit of every view's keys, applied:

  • Enter opens or chooses, never quits; Ctrl+R applies, starts, or submits any open line (save names, searches, typed values).
  • Esc goes back one level (pileup's browser → its gene list; a top-level view quits); q quits; Ctrl-C asks first wherever q does (faba run setup, now on any change; qc with changed thresholds).
  • Downloads: s stops, Esc hides, the folder is named first, and the pop-up lists its keys, in faba run and the reference picker alike.
  • Same letter, same meaning: +/- finer/coarser in metagene as in pileup; m/M modality in pileup as in qc (mirror → v, previous site → N); pwm's bits/frequency → b; qc's annotation browser g → a (g is pileup's gene list).
  • Asks before losing work: R (reset every flag); Space on a folder with files marked.
  • Feedback: the busy spinner says it cannot stop halfway; Enter on a file in the input picker says Space marks.
  • Footers never cut a key off: tui::wrap_help wraps them onto more lines at any width, keeping each key with its description; tests check every footer at 80 (60) columns.
  • Documented as one paragraph in docs/profiling-methods.md §7.

Shared pieces

  • crate::tui::batch: "batch, or no terminal" in one place, used by pileup, metagene and pwm. metagene now also writes its TSV when there is no terminal, instead of computing and dropping it.
  • output_dir: site-table resolution, the default output name and the view title, shared by metagene and pwm.
  • Reference downloads: the download pop-ups moved beside the download code (pipeline::tui::fetch), so faba run and pwm draw the same ones; the hint names whose chromosome names it matched (your BAMs, or your sites). is_fasta joins is_annotation in the shared browser.
  • The spinner ends when its work dies, rather than spinning on.
  • when_terminal is gone; its warning named the retired --interactive.

Checks

  • cargo test: all pass but pipeline::tui::tests::a_folder_with_files_is_refused_as_the_output, which fails on main too.
  • cargo clippy --all-targets -D warnings is clean, with and without --features hdf5.
  • cargo fmt is applied.

YPARK added 7 commits October 13, 2026 10:26
…es never overwrite (0.16.7)

faba pwm opens the sequence logo full screen unless --batch-process (or
there is no terminal), takes a faba output directory or run record for its
site table and recorded genome, and with no sites opens the file picker.
Saved figures never replace a file; the picker's key hints take three lines.
The view is the default; --batch-process is the only switch.
In the view, with no -f and no recorded genome found here, a picker lists
FASTA files; Tab downloads one from GENCODE or Ensembl into ~/faba_refs, as
faba run does, starting on the source whose chromosome names match the sites.
The download pop-ups now live beside the download code, shared by both.
apa_components.parquet gains a strand column (the UTR's). The site reader
takes it, so pwm reverse-complements minus-strand APA sites as it does m6A
and A-to-I ones; a table written before has none, read as forward with a
warning to rerun faba apa.
The pwm genome picker becomes a reference picker for a genome or an
annotation. In the pileup browser, with no --gtf and no recorded GFF on this
machine, it lists GTF/GFF files; Tab downloads a GENCODE or Ensembl
reference into ~/faba_refs. Esc browses on without gene models.
- Enter opens or chooses and never quits (pileup, metagene, pwm quit on it).
- Esc goes back one level: pileup's browser returns to its gene list; a
  view with nothing above it quits; q quits.
- Ctrl-C asks first wherever q does: faba run (now also when any setting
  changed, not only with BAMs picked) and qc with changed thresholds.
- Ctrl+R submits any open line: save names, pileup's search, qc's typed
  value, the gene list, the reference picker.
- Downloads: s stops, Esc hides (Tab shows it again in the picker), the
  folder is named first, and the pop-up lists its keys.
- metagene's + is finer and - coarser, as pileup's zoom; 0 fits.
- m/M switch modality in pileup as in qc; mirror moves to v, the previous
  site to N, pwm's bits/frequency to b, qc's annotation browser to a.
- R asks before resetting every flag; Space on a folder asks before
  dropping marked files; Enter on a file only says Space marks it.
- The busy spinner says it cannot stop halfway when a key is pressed.
- Footers wrap onto more lines at any width (tui::wrap_help), keeping each
  key with what it does; tests check every key shows at 80 (or 60) columns.
@YPARK
YPARK merged commit 83b24d7 into main Oct 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant