Sapling SAP
Reference

The study dashboard of the SAS run

A dashboard in plain HTML and JavaScript: no R, no server, no network.

This page is the repository's own document docs/dashboard.md, shown as it is, so that it never drifts from the product.

sapling sas dashboard makes a study dashboard from the products of a SAS run: plain HTML and JavaScript, no R, no server, no network. A team that runs only SAS has the same pages that the R engine's Shiny dashboard (sapling dashboard, which stays as it is) gives a team that runs R. The folder opens by double click (index.html): the data are JavaScript files, so file:// works where fetch of a local JSON file does not.

Commands#

sapling sas dashboard [--no-subjects] [--out DIR] [--open]   SAS DASHBOARD PASS: n pages, m numbers; the path and the size
sapling sas dashboard --check [--no-subjects]                the gate: SAS DASHBOARD PASS / FAIL
sapling sas run --adam-export                                a SAS run that also brings the ADaM data sets back as .xpt

--open opens the built page in your default browser (open, xdg-open or start), only when you give it; no test and no other command ever opens a window. --check --no-subjects builds out/sas/dashboard-no-subjects/ and gates that (the full dashboard stays as it is).

It writes out/sas/dashboard/: index.html, app.js, subjects.js, app.css, data/*.js, figures/*.png and export_adam.sas. Nothing in the build needs R or SAS.

What it reads#

SourceFor
out/sas/ard/*.csvevery number of a table (the one results shape of all engines)
out/sas/programs.jsonthe outputs, their analyses, the SAS program of each, the listings and figures
out/sas/tlf/*.lst, out/sas/listings, out/sas/figures (.csv, .png)the table as SAS printed it, listings, figures and their numbers
out/sas/logs/*.log, out/sas/check.mdthe verdicts of the run; check.md (SAS against R, "759 of 759") is optional: a SAS-only site has none and the page is complete without it
out/tlf/spec/<study>_sap.json, out/sap/sap.json, sap.qmd, protocol/*.json, out/adam/specthe trace: analysis, method, population, records, ADaM derivations, SAP block, protocol sentence
the ADaM data sets as .xptthe subject pages

Which ADaM data the subject pages used is written on the Overview and in the build verdict:

sapling sas run --adam-export brings SAS's own ADaM data sets back: after the programs, DataStep Studio runs the generated export_adam.sas (LIBNAME XPORT and PROC COPY: it reads <root>/adamsas, the data sets of sapling sas adam run, or else <root>/adam, and writes <root>/adamout/*.xpt) and fetches the files into out/sas/adam/data. The next sapling sas dashboard then reads them. The program is generated text in the house style; the build also writes it to out/sas/dashboard/export_adam.sas to run by hand. Its text is unit-tested; it has not been run on a SAS server yet, so that run is the proof of the export itself. --no-subjects builds without any subject-level data.

The pages#

One page, a left navigation, deep links by hash (#/o/T14_2_1/12 is the trace of one number).

The data cut and the subgroups (sex, age group, race, site) of the bar apply to the subject-level pages only. The tables are the SAS results of all the data and are never recomputed in the browser.

The gate (--check)#

  1. the data of the page equal the results files of SAS, read again;
  2. in a headless Chrome (the one Remotion ships in video/node_modules, or CHROME_BIN; never a visible window) every number of every table is one element with its key; the text, none missing, none extra, none twice, equals the results file; 2b. the cells of every table page (header, row labels and values, in order, every block) equal the cells of the SAS .lst of that output, which the gate reads itself with its own reader (parseLst in src/sas_dash_data.ts; the page has its own in app.js); a result that no cell of the .lst holds fails the gate;
  3. the trace of every number reaches its analysis;
  4. every page draws;
  5. the AE explorer's counts of the unfiltered view equal the SAP's AE table (all treatment-emergent events, or serious only for the serious table);
  6. the Kaplan-Meier numbers of the page (subjects, events, median and its 95% limits per arm) equal a second calculation from the transport file;
  7. the log-rank p of the page equals the SAS result where the SAP has a log-rank analysis (otherwise it says so; the SAP's Cox models are shown beside the curves as clickable SAS numbers);
  8. the labs page's n, mean and SD by arm, parameter and visit equal the SAP's table of values by visit where one exists;
  9. a build without subject data (--check --no-subjects): its five subject pages and the subject page say why they are empty, and no subject-level file is in the folder;
  10. the ledger: the chain recomputed by the page and by the gate agrees with out/sas/ledger.jsonl, and every file the build read still has its SHA-256 (a stale dashboard fails).

A number that differs by one character makes the gate FAIL (test/sas_dashboard.test.ts plants one in the page data, one in the .lst, and one wrong log-rank p).

Data and privacy#

The folder holds subject-level data (ADaM records of every subject): handle it like the ADaM data, do not email or publish it. --no-subjects leaves them out (the AE explorer, Subjects, Insights, Kaplan-Meier and Labs say why they are empty). Numbers of the subject data are rounded to 5 decimals in the page data (the tables are not). Dummy data show their made-up label.

What the R dashboard has that this one has not#