Bioinforw Data Plotting
Overview
Prefer the local template catalog before inventing a chart from scratch. Start by matching the user's data and analysis goal to existing templates, then adapt the selected Python or R example code to the user's columns and file paths.
Workflow
- Discover the local catalog. Prefer
bioinforw_ngplot_dump/catalog_enriched.jsonl. If the user workspace does not contain one, fall back to the bundled asset catalog under assets/bioinforw_ngplot_dump/.
- Refresh
embedding_input.jsonl when it is missing or stale. Use scripts/build_embedding_input.py. The script can auto-discover the dump root from the current workspace.
- Convert the user request into a structured query when possible. Capture analysis goal, table count, variable roles, grouping, statistical annotation needs, must-have visual features, and families to avoid. Use
references/request-format.md.
- Rank templates with
scripts/recommend_bioinforw_templates.py. Prefer JSON output for downstream use.
- Return the best matches with:
- template id and name
- resolved
chart_family and original source_chart_family
- ranking reasons
python_path, r_path, svg_path, preview_path, and data_paths
- If the user wants an actual figure, open the selected template's
python_example.py or R_example.R, map the user's columns to required_columns, and modify that code in the current repo instead of rewriting everything.
- If no template fits, state that clearly and explain the nearest matching families instead of forcing an unrelated chart.
Query Construction
- Record the user's scientific question first: comparison, distribution, trend, correlation, composition, hierarchy, network, geography, or significance.
- Normalize variables into roles such as
group, category, measurement, time, source, target, geo, or p_value.
- Prefer a structured JSON query when the user provides schema details. Fall back to raw text only when the request is underspecified.
- Penalize templates that conflict with hard constraints such as
不分组, missing statistics, wrong table count, or banned families.
Commands
Run from the user's workspace root when possible.
python C:\Users\ciheb\.codex\skills\bioinforw-data-plotting\scripts\build_embedding_input.py
python C:\Users\ciheb\.codex\skills\bioinforw-data-plotting\scripts\recommend_bioinforw_templates.py --query-file .\bioinforw_ngplot_dump\recommend_query_example.json --top-k 8 --format json
Pass an explicit path when the catalog is not under the current working directory.
Resources
scripts/build_embedding_input.py: Regenerate embedding_input.jsonl from catalog_enriched.jsonl.
scripts/recommend_bioinforw_templates.py: Score templates against natural-language or structured requests and return reusable code paths.
references/request-format.md: Structured query fields, examples, and response expectations.
assets/bioinforw_ngplot_dump/: Bundled 345-template snapshot with catalog_enriched.jsonl, embedding_input.jsonl, local index page, preview images, rendered SVGs, example Python/R code, and example input data.
1---2name: bioinforw-data-plotting3description: Recommend and adapt scientific plotting templates from a local Bioinforw or NGplot catalog for research data visualization. Use when Codex needs to choose a chart type from `catalog_enriched.jsonl`, refresh `embedding_input.jsonl`, return top-k templates with Python/R code paths, map user columns to template-required columns, or turn a research plotting request into an executable plotting starting point.4---56# Bioinforw Data Plotting78## Overview910Prefer the local template catalog before inventing a chart from scratch. Start by matching the user's data and analysis goal to existing templates, then adapt the selected Python or R example code to the user's columns and file paths.1112## Workflow13141. Discover the local catalog. Prefer `bioinforw_ngplot_dump/catalog_enriched.jsonl`. If the user workspace does not contain one, fall back to the bundled asset catalog under `assets/bioinforw_ngplot_dump/`.152. Refresh `embedding_input.jsonl` when it is missing or stale. Use `scripts/build_embedding_input.py`. The script can auto-discover the dump root from the current workspace.163. Convert the user request into a structured query when possible. Capture analysis goal, table count, variable roles, grouping, statistical annotation needs, must-have visual features, and families to avoid. Use `references/request-format.md`.174. Rank templates with `scripts/recommend_bioinforw_templates.py`. Prefer JSON output for downstream use.185. Return the best matches with:19 - template id and name20 - resolved `chart_family` and original `source_chart_family`21 - ranking reasons22 - `python_path`, `r_path`, `svg_path`, `preview_path`, and `data_paths`236. If the user wants an actual figure, open the selected template's `python_example.py` or `R_example.R`, map the user's columns to `required_columns`, and modify that code in the current repo instead of rewriting everything.247. If no template fits, state that clearly and explain the nearest matching families instead of forcing an unrelated chart.2526## Query Construction2728- Record the user's scientific question first: comparison, distribution, trend, correlation, composition, hierarchy, network, geography, or significance.29- Normalize variables into roles such as `group`, `category`, `measurement`, `time`, `source`, `target`, `geo`, or `p_value`.30- Prefer a structured JSON query when the user provides schema details. Fall back to raw text only when the request is underspecified.31- Penalize templates that conflict with hard constraints such as `不分组`, missing statistics, wrong table count, or banned families.3233## Commands3435Run from the user's workspace root when possible.3637```powershell38python C:\Users\ciheb\.codex\skills\bioinforw-data-plotting\scripts\build_embedding_input.py39python C:\Users\ciheb\.codex\skills\bioinforw-data-plotting\scripts\recommend_bioinforw_templates.py --query-file .\bioinforw_ngplot_dump\recommend_query_example.json --top-k 8 --format json40```4142Pass an explicit path when the catalog is not under the current working directory.4344## Resources4546- `scripts/build_embedding_input.py`: Regenerate `embedding_input.jsonl` from `catalog_enriched.jsonl`.47- `scripts/recommend_bioinforw_templates.py`: Score templates against natural-language or structured requests and return reusable code paths.48- `references/request-format.md`: Structured query fields, examples, and response expectations.49- `assets/bioinforw_ngplot_dump/`: Bundled `345`-template snapshot with `catalog_enriched.jsonl`, `embedding_input.jsonl`, local index page, preview images, rendered SVGs, example Python/R code, and example input data.