From fgcz-infrastructure
Promote a one-off R Markdown analysis into a SUSHI-shaped folder on gstore so it can be chained as a parent dataset by downstream SUSHI apps. Use when delivering a custom analysis (a hand-written Rmd, not a SUSHI app) to a user, links custom analysis in the SUSHI analysis tree as well as in B-Fabric. Triggers on "custom analysis", "register analysis in SUSHI", "Hubert blueprint", "promote Rmd to SUSHI", "dataset.tsv parameters.tsv input_dataset.tsv", "wrap manual analysis for B-Fabric", "make this Rmd look like a SUSHI app output".
How this skill is triggered — by the user, by Claude, or both
Slash command
/fgcz-infrastructure:fgcz-custom-analysis-registerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Wrap a hand-written R Markdown analysis so it produces the same on-disk shape a SUSHI app would.
Wrap a hand-written R Markdown analysis so it produces the same on-disk shape a SUSHI app would. The output drops cleanly into the SUSHI dataset graph: any downstream SUSHI app (ScSeurat, exploreSC, etc.) can chain off it, and the B-Fabric + SUSHI registrations (Steps 9–10) make it visible in the SUSHI UI and the B-Fabric audit trail.
A manually written .Rmd file needs to be adapated so that it fits the pattern of references/example-self-contained.Rmd.
analysis_definition chunk: specify the inputs and the parameters. It is important that the input dataset are explicity specified input_dataset.tsv. Those hold then links to the actual datafiles.dataset_generation: final chunk that is executed at the end, generates all the files needed to run the reproducibly and to register the whole analysis in SUSHI and B-FabricThe B-Fabric side is live via Ronald's register_custom_analysis.py (pending merge into btools main).
.Rmd, rendered it locally, and the user now wants the output delivered to gstore.Do NOT use for: - Building a real SUSHI app → use fgcz-sushi-app-dev.
autonomous-render.bfabric.Confirm aloud with the user — echo back project + order before writing anything (the existing "confirm order numbers" rule applies here):
| Field | Example | Notes |
|---|---|---|
project | p40992 | The pXXXXX directory under /srv/gstore/projects/. |
order_id | o41017 | The oXXXXX prefix matching the upstream order. |
analysis_name | SC-FlashSeq_QC_Evaluation | Short, no spaces. Becomes part of the folder name and filenames. |
timestamp | 2026-05-15--12-00-00 | Generate fresh with format(Sys.time(), "%Y-%m-%d--%H-%M-%S") — don't reuse a prior one. |
| Rmd path | ~/git/<your-scripts>/pXXXXX_*/QC.Rmd | The source .Rmd. |
| Upstream SUSHI dataset path | /srv/gstore/projects/pXXXXX/oYYYYY_FeatureCounts_YYYY-MM-DD--... | Used in Step 4 to copy input_dataset.tsv for provenance. Without it, the SUSHI lineage tree has nothing to link back to. |
| Upstream SUSHI dataset ID | e.g. 109531 | The numeric ID from production SUSHI's data_sets table (not the dev SUSHI ID, which is different — look it up via the URL fgcz-sushi.uzh.ch/data_set/pXXXXX/<id> or query the DB via the sushi-framework skill). Needed in Step 10 to set parent_id and build the lineage edge. |
If the upstream SUSHI dataset path is unknown, ask the user; write it into the .Rmd file and make sure it is used — don't guess. Provenance without a real parent is worse than no provenance.
/srv/gstore/projects/{project}/{order_id}_{analysis_name}_{timestamp}/
├── {analysis_name}.Rmd # source (copied from your repo)
├── {analysis_name}.html # rendered report
├── dataset.tsv # output dataset — SUSHI schema
├── parameters.tsv # analysis parameters
├── input_dataset.tsv # provenance — copied from upstream SUSHI dataset
├── *.qs2 # any cached objects the Rmd writes
└── scripts/
├── {order_id}_run-{analysis}.sh # vanilla bash launcher
├── {order_id}_run-{analysis}_o.log
└── {order_id}_run-{analysis}_e.log
The folder name and the three TSVs are the exact contract every SUSHI app honours — that's what makes the output chainable.
Work locally in /srv/GT/analysis/{project}/Analyses_Paul/ (or a /tmp/ scratch dir for dry runs) Take an existing .Rmd fil; inspect it; Make a new folder {analysis_name}_scratch and place the improved versions of the .Rmd file in there.
Never write into /srv/gstore/ directly.
Create the folder
Work on the .Rmd file and improve it when needed.
Writing the parameters is is done via:
params <- list(
analysis_name = analysis_name,
analysis_version = analysis_version
)
paramFrame <- ezFrame(Value = sapply(params, as.character))
ezWrite.table(paramFrame, file = "parameters.tsv", col.names = FALSE)
Keep this honest — add every parameter that materially affected the result (gene annotation version, thresholds, reference paths). Future-you will thank present-you.
dataset_registration only after all editing is done that will create the scripts folder with the timestamp that serves identifies the versiong-req succeeds. CLAUDE.md mandates this./srv/gstore/ directly.references/example-self-contained.Rmd — the initial version that exemplifies the general pattern.fgcz-sushi-app-dev — for the real SUSHI app build path (when this analysis becomes routine and deserves to be a button in the SUSHI UI).autonomous-render — for self-correcting Rmd rendering with retry logic.bfabric — for direct B-Fabric reads/writes once Step 9 lands.register_custom_analysis.py + src/ updates into main btools so users don't have to copy from /home/rdomi/.fgcz-h-083:4071) so Step 10 can become an HTTP call instead of a raw MySQL insert. Until then, Step 10 is the canonical path.evals/evals.json with 2–3 test prompts once the workflow has stabilised.npx claudepluginhub cpanse/skills --plugin fgcz-infrastructureProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.