[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CTSW4YSXHZX65035QH5VQA":3,"skill-same:01M7CTSW4YSXHZX65035QH5VQA":130},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7CTSW4YSXHZX65035QH5VQA","nomogram-construction",null,"Use when constructing a prognosis nomogram from survival-related clinical predictors, exporting the nomogram bundle and C-index table, and optionally rendering the final nomogram PDF. NOT for: univariate\u002Fmultivariable Cox feature screening, calibration curves, ROC analysis, decision-curve analysis, or non-survival outcomes.","mrsonord2240\u002Fopenscience-specialists","mrsonord2240","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76487430?v=4","01M7CTEM40S43GSJZ9A3YCCXZK","Samuel Nord","01M7CTEM4K69JD1GBYNHVJ9ZP4",2,"MIT","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: nomogram-construction\ndescription: \"Use when constructing a prognosis nomogram from survival-related clinical predictors, exporting the nomogram bundle and C-index table, and optionally rendering the final nomogram PDF. NOT for: univariate\u002Fmultivariable Cox feature screening, calibration curves, ROC analysis, decision-curve analysis, or non-survival outcomes.\"\nlicense: MIT\nskill-author: AIPOCH\n---\n\n# Nomogram Construction\n\n## When to Use\n\nUse this skill when you need to:\n- build a prognosis nomogram from already selected clinical prognostic variables;\n- estimate model discrimination with a C-index table;\n- export a nomogram bundle and generate a publication-ready nomogram PDF.\n\nTypical user requests:\n- \"Build a prognosis nomogram from age, stage, and risk score.\"\n- \"Use these Cox-selected predictors to construct a nomogram and calculate the C-index.\"\n- \"Generate a nomogram PDF from a survival prediction model.\"\n\n## When Not to Use\n\nDo not use this skill for:\n- screening prognostic variables from scratch with Cox regression;\n- ROC curves, calibration curves, or decision-curve analysis;\n- diagnosis models, binary classification, or non-survival outcomes;\n- single-cell, differential-expression, or pathway analysis.\n\n## When to Read External Files\n\n| Situation | File to Read | Purpose |\n|-----------|--------------|---------|\n| **Need algorithm details** | `references\u002Falgorithm.md` | Cox-based nomogram workflow, C-index, and assumptions |\n| **Need to run analysis** | `scripts\u002Fmain.R` | Execute `Rscript scripts\u002Fmain.R --mode build ...` or `--mode plot ...` |\n| **Encounter errors** | `references\u002Ftroubleshooting.md` | Common `SKILL_*` errors and solutions |\n| **Need CLI examples** | `references\u002Fcli-guide.md` | Detailed command-line examples |\n| **Need test data** | `tests\u002Fdata\u002F` | Example clinical CSV for smoke testing |\n\n## Input Validation\n\nThis skill accepts:\n\n- A clinical CSV file with survival time, event indicator, and pre-selected prognostic features\n- Requests to build a Cox-based prognostic nomogram and compute the C-index\n- Requests to re-render a nomogram PDF from an existing `.qs` bundle (plot mode)\n\nIf the user's request does not involve nomogram construction from survival data — for example, asking to screen features with Cox regression, generate calibration curves, perform ROC analysis, or analyze non-survival binary outcomes — do not proceed with this workflow. Instead respond:\n\n> \"nomogram-construction is designed to build a prognosis nomogram from pre-selected survival predictors and export the nomogram bundle with C-index table. Your request appears to be outside this scope. Please use a Cox feature-screening skill for variable selection, or a calibration-curve\u002FROC skill for model validation.\"\n\n---\n\n## Prerequisites\n\nR packages required: `rms`, `openxlsx`, `qs`, `optparse`.\n\nInstall with:\n```r\ninstall.packages(c(\"rms\", \"openxlsx\", \"qs\", \"optparse\"), repos = \"https:\u002F\u002Fcloud.r-project.org\")\n```\n\nOr run the bootstrap installer:\n```bash\nRscript scripts\u002Finstall_dependencies.R\n```\n\n> Note: `--help` requires `optparse` to be loaded. If the package check fires before option parsing, install `optparse` first, then run `--help`.\n\n---\n\n## Usage\n\n### Build Nomogram Bundle\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --mode build \\\n  --data_file .\u002Fclinical_data.csv \\\n  --features age,stage,risk \\\n  --time_col futime \\\n  --event_col fustat \\\n  --years 1,2,3 \\\n  --output_dir .\u002Foutput\u002F \\\n  --seed 42\n```\n\n### Render Nomogram Plot\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --mode plot \\\n  --nomo_data_file .\u002Foutput\u002Fdata\u002FNomogram_list.qs \\\n  --plot_save .\u002Foutput\u002Fplot\u002Fnomogram_plot.pdf\n```\n\n---\n\n## Arguments\n\n| Short | Long | Type | Default | Description |\n|-------|------|------|---------|-------------|\n| `-m` | `--mode` | character | `build` | Execution mode: `build` or `plot` |\n| `-d` | `--data_file` | character | **required for build** | Clinical CSV file with sample IDs as row names |\n| `-f` | `--features` | character | **required for build** | Comma-separated prognostic features |\n| `-t` | `--time_col` | character | `futime` | Survival time column |\n| `-e` | `--event_col` | character | `fustat` | Event column encoded as `1=event`, `0=censored` |\n| `-y` | `--years` | character | `1,2,3` | Prediction time points in years |\n| `-o` | `--output_dir` | character | `.\u002Foutput\u002F` | Output directory for build mode |\n|  | `--overwrite` | flag | `FALSE` | Allow writing into a non-empty output directory |\n| `-n` | `--nomo_data_file` | character | **required for plot** | Nomogram bundle in `.qs` format |\n| `-p` | `--plot_save` | character | **required for plot** | Output PDF path |\n| `-w` | `--plot_width` | double | `11` | Plot width in inches |\n| `-H` | `--plot_height` | double | `8` | Plot height in inches |\n| `-F` | `--font_size` | double | `8` | Plot font size |\n| `-l` | `--line_width` | double | `5` | Plot line width |\n|  | `--font_family` | character | `sans` | Font family for PDF output |\n| `-s` | `--seed` | integer | `42` | Random seed for reproducibility |\n| `-T` | `--timeout_seconds` | integer | `0` | Elapsed time limit in seconds; `0` disables timeout |\n\n---\n\n## Input Format\n\n### Clinical Data (`data_file`)\n\nCSV file with sample IDs as row names and one column per feature\u002Fend-point variable.\n\n```csv\n\",age,stage,risk,futime,fustat\nSAMPLE_001,65,StageIII,high,365,1\nSAMPLE_002,52,StageII,low,730,0\nSAMPLE_003,78,StageIV,high,180,1\n```\n\n**Requirements**\n- File format must be CSV.\n- Sample IDs must be stored in the first column as row names.\n- At least 3 prognostic features are required.\n- `time_col` must contain finite numeric values greater than `0`.\n- `event_col` must contain only `0` and `1`.\n- At least 20 complete samples and at least 10 events are required after filtering incomplete rows.\n\n### Nomogram Bundle (`nomo_data_file`)\n\nThe plot mode reads the `.qs` bundle produced by build mode.\n\nRequired bundle objects:\n- `nomogram`\n- `c_index`\n- `model`\n- `data`\n- `features`\n- `time_points`\n\n---\n\n## Output Files\n\n### Build Mode\n\n| File | Description |\n|------|-------------|\n| `data\u002FNomogram_list.qs` | Serialized nomogram bundle |\n| `data\u002Fanalysis_data.rds` | Complete-case dataset used for modeling |\n| `table\u002Fnomogram_c_index.xlsx` | Nomogram discrimination summary |\n| `session_info.txt` | Session information and build parameters |\n\n### Plot Mode\n\n| File | Description |\n|------|-------------|\n| `plot\u002Fnomogram_plot.pdf` | Rendered nomogram PDF |\n| `plot\u002Fsession_info.txt` | Plotting session information and parameters |\n\n### `nomogram_c_index.xlsx`\n\n| Column | Description |\n|--------|-------------|\n| `metric` | Reported metric name |\n| `value` | Metric value |\n\n---\n\n## Workflow\n\n### Step 1: Validate Input\n- Check file existence and CSV format.\n- Validate required feature, time, and event columns.\n- Validate time\u002Fevent values and minimum sample\u002Fevent counts.\n\n### Step 2: Prepare Modeling Dataset\n- Keep only requested features and outcome columns.\n- Convert character predictors to factors.\n- Remove incomplete rows across model variables.\n\n### Step 3: Fit Cox-Based Nomogram Model\n- Fit an `rms::cph` survival model.\n- Build survival functions at requested time points.\n- Construct the nomogram object.\n\n### Step 4: Evaluate Performance\n- Compute the model C-index.\n- Save a compact discrimination summary table.\n\n### Step 5: Save And Plot\n- Save the nomogram bundle and analysis dataset.\n- Render the nomogram PDF in plot mode.\n\n---\n\n## Examples\n\n### Basic Build\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --mode build \\\n  -d clinical_data.csv \\\n  -f age,stage,risk \\\n  -o .\u002Foutput\u002F\n```\n\n### Custom Prediction Horizons\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --mode build \\\n  -d clinical_data.csv \\\n  -f age,stage,risk,treatment \\\n  -y 1,3,5 \\\n  -o .\u002Foutput\u002F\n```\n\n### Plot Existing Bundle\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --mode plot \\\n  -n .\u002Foutput\u002Fdata\u002FNomogram_list.qs \\\n  -p .\u002Foutput\u002Fplot\u002Fnomogram_plot.pdf \\\n  -w 12 -H 9 -F 10\n```\n\n---\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| `SKILL_FILE_NOT_FOUND` | Input file does not exist | Verify the file path |\n| `SKILL_EMPTY_DATA` | Input file is empty or has no usable rows and columns | Re-export the input file with valid rows and columns |\n| `SKILL_MISSING_COLUMNS` | Required columns are absent from the clinical data | Check column names and spelling |\n| `SKILL_INVALID_DATA` | Invalid time\u002Fevent encoding, malformed bundle, or unreadable CSV\u002FQS file | Check input values and file integrity |\n| `SKILL_INSUFFICIENT_DATA` | Too few features, complete samples, or events | Provide more valid predictors or samples |\n| `SKILL_ANALYSIS_ERROR` | `cph()` fitting, nomogram construction, or output writing failed | Check data quality, factor levels, and event distribution |\n| `SKILL_INVALID_PARAMETER` | Missing required CLI value, invalid mode, invalid years, or overwrite conflict | Review command-line arguments |\n| `SKILL_PACKAGE_NOT_FOUND` | Required R package is not installed | Install with: `Rscript -e \"install.packages(c('rms', 'openxlsx', 'qs'), repos='https:\u002F\u002Fcloud.r-project.org')\"` |\n| `SKILL_TIMEOUT` | The configured timeout was exceeded | Increase `--timeout_seconds` or reduce workload |\n\n**IF error persists**, READ: `references\u002Ftroubleshooting.md`\n\n---\n\n## Testing\n\n### Smoke Test With Included Data\n\n```bash\nRscript scripts\u002Fmain.R --help\n\nRscript scripts\u002Fmain.R \\\n  --mode build \\\n  -d tests\u002Fdata\u002Fyuhou_cli_data.csv \\\n  -f age,gender,risk \\\n  -o tests\u002Fexpected_output\u002F \\\n  --overwrite\n\nRscript scripts\u002Fmain.R \\\n  --mode plot \\\n  -n tests\u002Fexpected_output\u002Fdata\u002FNomogram_list.qs \\\n  -p tests\u002Fexpected_output\u002Fplot\u002Fnomogram_plot.pdf\n```\n\n### Automated Smoke Test Script\n\n```bash\nRscript tests\u002Frun_smoke_test.R\n```\n\nOptional shell wrapper:\n\n```bash\nbash tests\u002Frun_smoke_test.sh\n```\n\n### Expected Output\n\n```text\ntests\u002Fexpected_output\u002F\n|-- data\u002Fanalysis_data.rds\n|-- data\u002FNomogram_list.qs\n|-- plot\u002Fnomogram_plot.pdf\n|-- plot\u002Fsession_info.txt\n|-- session_info.txt\n`-- table\u002Fnomogram_c_index.xlsx\n```\n\nHistorical development artifacts may still exist in `tests\u002Foutput\u002F`, but standardized validation uses `tests\u002Fexpected_output\u002F`.\n\n---\n\n## References\n\n1. Harrell FE (2015). *Regression Modeling Strategies*.\n2. Iasonos A et al. (2008). How to build and interpret a nomogram for cancer prognosis. *Journal of Clinical Oncology*.\n3. Balachandran VP et al. (2015). Nomograms in oncology: more than meets the eye. *The Lancet Oncology*.\n\n**For detailed algorithm**, READ: `references\u002Falgorithm.md`\n\n---\n\n## Implementation Checklist\n\n- [x] CLI parsing with `optparse`\n- [x] `set.seed()` for reproducibility\n- [x] `requireNamespace()` dependency checks\n- [x] Session info recording\n- [x] Timeout parameter exposed as CLI option\n- [x] File reading instructions in `SKILL.md`\n- [x] Modular script structure in `scripts\u002F`\n- [x] Test data provided in `tests\u002Fdata\u002F`\n- [x] Error handling with `SKILL_*` codes\n- [x] References documented in `references\u002F`\n\n---\n\n*Last updated: 2026-04-27 | Version: 2.1.0*\n","# Nomogram Construction\n\n## When to Use\n\nUse this skill when you need to:\n- build a prognosis nomogram from already selected clinical prognostic variables;\n- estimate model discrimination with a C-index table;\n- export a nomogram bundle and generate a publication-ready nomogram PDF.\n\nTypical user requests:\n- \"Build a prognosis nomogram from age, stage, and risk score.\"\n- \"Use these Cox-selected predictors to construct a nomogram and calculate the C-index.\"\n- \"Generate a nomogram PDF from a survival prediction model.\"\n\n## When Not to Use\n\nDo not use this skill for:\n- screening prognostic variables from scratch with Cox regression;\n- ROC curves, calibration curves, or decision-curve analysis;\n- diagnosis models, binary classification, or non-survival outcomes;\n- single-cell, differential-expression, or pathway analysis.\n\n## When to Read External Files\n\n| Situation | File to Read | Purpose |\n|-----------|--------------|---------|\n| **Need algorithm details** | `references\u002Falgorithm.md` | Cox-based nomogram workflow, C-index, and assumptions |\n| **Need to run analysis** | `scripts\u002Fmain.R` | Execute `Rscript scripts\u002Fmain.R --mode build ...` or `--mode plot ...` |\n| **Encounter errors** | `references\u002Ftroubleshooting.md` | Common `SKILL_*` errors and solutions |\n| **Need CLI examples** | `references\u002Fcli-guide.md` | Detailed command-line examples |\n| **Need test data** | `tests\u002Fdata\u002F` | Example clinical CSV for smoke testing |\n\n## Input Validation\n\nThis skill accepts:\n\n- A clinical CSV file with survival time, event indicator, and pre-selected prognostic features\n- Requests to build a Cox-based prognostic nomogram and compute the C-index\n- Requests to re-render a nomogram PDF from an existing `.qs` bundle (plot mode)\n\nIf the user's request does not involve nomogram construction from survival data — for example, asking to screen features with Cox regression, generate calibration curves, perform ROC analysis, or analyze non-survival binary outcomes — do not proceed with this workflow. Instead respond:\n\n> \"nomogram-construction is designed to build a prognosis nomogram from pre-selected survival predictors and export the nomogram bundle with C-index table. Your request appears to be outside this scope. Please use a Cox feature-screening skill for variable selection, or a calibration-curve\u002FROC skill for model validation.\"\n\n---\n\n## Prerequisites\n\nR packages required: `rms`, `openxlsx`, `qs`, `optparse`.\n\nInstall with:\n```r\ninstall.packages(c(\"rms\", \"openxlsx\", \"qs\", \"optparse\"), repos = \"https:\u002F\u002Fcloud.r-project.org\")\n```\n\nOr run the bootstrap installer:\n```bash\nRscript scripts\u002Finstall_dependencies.R\n```\n\n> Note: `--help` requires `optparse` to be loaded. If the package check fires before option parsing, install `optparse` first, then run `--help`.\n\n---\n\n## Usage\n\n### Build Nomogram Bundle\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --mode build \\\n  --data_file .\u002Fclinical_data.csv \\\n  --features age,stage,risk \\\n  --time_col futime \\\n  --event_col fustat \\\n  --years 1,2,3 \\\n  --output_dir .\u002Foutput\u002F \\\n  --seed 42\n```\n\n### Render Nomogram Plot\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --mode plot \\\n  --nomo_data_file .\u002Foutput\u002Fdata\u002FNomogram_list.qs \\\n  --plot_save .\u002Foutput\u002Fplot\u002Fnomogram_plot.pdf\n```\n\n---\n\n## Arguments\n\n| Short | Long | Type | Default | Description |\n|-------|------|------|---------|-------------|\n| `-m` | `--mode` | character | `build` | Execution mode: `build` or `plot` |\n| `-d` | `--data_file` | character | **required for build** | Clinical CSV file with sample IDs as row names |\n| `-f` | `--features` | character | **required for build** | Comma-separated prognostic features |\n| `-t` | `--time_col` | character | `futime` | Survival time column |\n| `-e` | `--event_col` | character | `fustat` | Event column encoded as `1=event`, `0=censored` |\n| `-y` | `--years` | character | `1,2,3` | Prediction time points in years |\n| `-o` | `--output_dir` | character | `.\u002Foutput\u002F` | Output directory for build mode |\n|  | `--overwrite` | flag | `FALSE` | Allow writing into a non-empty output directory |\n| `-n` | `--nomo_data_file` | character | **required for plot** | Nomogram bundle in `.qs` format |\n| `-p` | `--plot_save` | character | **required for plot** | Output PDF path |\n| `-w` | `--plot_width` | double | `11` | Plot width in inches |\n| `-H` | `--plot_height` | double | `8` | Plot height in inches |\n| `-F` | `--font_size` | double | `8` | Plot font size |\n| `-l` | `--line_width` | double | `5` | Plot line width |\n|  | `--font_family` | character | `sans` | Font family for PDF output |\n| `-s` | `--seed` | integer | `42` | Random seed for reproducibility |\n| `-T` | `--timeout_seconds` | integer | `0` | Elapsed time limit in seconds; `0` disables timeout |\n\n---\n\n## Input Format\n\n### Clinical Data (`data_file`)\n\nCSV file with sample IDs as row names and one column per feature\u002Fend-point variable.\n\n```csv\n\",age,stage,risk,futime,fustat\nSAMPLE_001,65,StageIII,high,365,1\nSAMPLE_002,52,StageII,low,730,0\nSAMPLE_003,78,StageIV,high,180,1\n```\n\n**Requirements**\n- File format must be CSV.\n- Sample IDs must be stored in the first column as row names.\n- At least 3 prognostic features are required.\n- `time_col` must contain finite numeric values greater than `0`.\n- `event_col` must contain only `0` and `1`.\n- At least 20 complete samples and at least 10 events are required after filtering incomplete rows.\n\n### Nomogram Bundle (`nomo_data_file`)\n\nThe plot mode reads the `.qs` bundle produced by build mode.\n\nRequired bundle objects:\n- `nomogram`\n- `c_index`\n- `model`\n- `data`\n- `features`\n- `time_points`\n\n---\n\n## Output Files\n\n### Build Mode\n\n| File | Description |\n|------|-------------|\n| `data\u002FNomogram_list.qs` | Serialized nomogram bundle |\n| `data\u002Fanalysis_data.rds` | Complete-case dataset used for modeling |\n| `table\u002Fnomogram_c_index.xlsx` | Nomogram discrimination summary |\n| `session_info.txt` | Session information and build parameters |\n\n### Plot Mode\n\n| File | Description |\n|------|-------------|\n| `plot\u002Fnomogram_plot.pdf` | Rendered nomogram PDF |\n| `plot\u002Fsession_info.txt` | Plotting session information and parameters |\n\n### `nomogram_c_index.xlsx`\n\n| Column | Description |\n|--------|-------------|\n| `metric` | Reported metric name |\n| `value` | Metric value |\n\n---\n\n## Workflow\n\n### Step 1: Validate Input\n- Check file existence and CSV format.\n- Validate required feature, time, and event columns.\n- Validate time\u002Fevent values and minimum sample\u002Fevent counts.\n\n### Step 2: Prepare Modeling Dataset\n- Keep only requested features and outcome columns.\n- Convert character predictors to factors.\n- Remove incomplete rows across model variables.\n\n### Step 3: Fit Cox-Based Nomogram Model\n- Fit an `rms::cph` survival model.\n- Build survival functions at requested time points.\n- Construct the nomogram object.\n\n### Step 4: Evaluate Performance\n- Compute the model C-index.\n- Save a compact discrimination summary table.\n\n### Step 5: Save And Plot\n- Save the nomogram bundle and analysis dataset.\n- Render the nomogram PDF in plot mode.\n\n---\n\n## Examples\n\n### Basic Build\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --mode build \\\n  -d clinical_data.csv \\\n  -f age,stage,risk \\\n  -o .\u002Foutput\u002F\n```\n\n### Custom Prediction Horizons\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --mode build \\\n  -d clinical_data.csv \\\n  -f age,stage,risk,treatment \\\n  -y 1,3,5 \\\n  -o .\u002Foutput\u002F\n```\n\n### Plot Existing Bundle\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --mode plot \\\n  -n .\u002Foutput\u002Fdata\u002FNomogram_list.qs \\\n  -p .\u002Foutput\u002Fplot\u002Fnomogram_plot.pdf \\\n  -w 12 -H 9 -F 10\n```\n\n---\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| `SKILL_FILE_NOT_FOUND` | Input file does not exist | Verify the file path |\n| `SKILL_EMPTY_DATA` | Input file is empty or has no usable rows and columns | Re-export the input file with valid rows and columns |\n| `SKILL_MISSING_COLUMNS` | Required columns are absent from the clinical data | Check column names and spelling |\n| `SKILL_INVALID_DATA` | Invalid time\u002Fevent encoding, malformed bundle, or unreadable CSV\u002FQS file | Check input values and file integrity |\n| `SKILL_INSUFFICIENT_DATA` | Too few features, complete samples, or events | Provide more valid predictors or samples |\n| `SKILL_ANALYSIS_ERROR` | `cph()` fitting, nomogram construction, or output writing failed | Check data quality, factor levels, and event distribution |\n| `SKILL_INVALID_PARAMETER` | Missing required CLI value, invalid mode, invalid years, or overwrite conflict | Review command-line arguments |\n| `SKILL_PACKAGE_NOT_FOUND` | Required R package is not installed | Install with: `Rscript -e \"install.packages(c('rms', 'openxlsx', 'qs'), repos='https:\u002F\u002Fcloud.r-project.org')\"` |\n| `SKILL_TIMEOUT` | The configured timeout was exceeded | Increase `--timeout_seconds` or reduce workload |\n\n**IF error persists**, READ: `references\u002Ftroubleshooting.md`\n\n---\n\n## Testing\n\n### Smoke Test With Included Data\n\n```bash\nRscript scripts\u002Fmain.R --help\n\nRscript scripts\u002Fmain.R \\\n  --mode build \\\n  -d tests\u002Fdata\u002Fyuhou_cli_data.csv \\\n  -f age,gender,risk \\\n  -o tests\u002Fexpected_output\u002F \\\n  --overwrite\n\nRscript scripts\u002Fmain.R \\\n  --mode plot \\\n  -n tests\u002Fexpected_output\u002Fdata\u002FNomogram_list.qs \\\n  -p tests\u002Fexpected_output\u002Fplot\u002Fnomogram_plot.pdf\n```\n\n### Automated Smoke Test Script\n\n```bash\nRscript tests\u002Frun_smoke_test.R\n```\n\nOptional shell wrapper:\n\n```bash\nbash tests\u002Frun_smoke_test.sh\n```\n\n### Expected Output\n\n```text\ntests\u002Fexpected_output\u002F\n|-- data\u002Fanalysis_data.rds\n|-- data\u002FNomogram_list.qs\n|-- plot\u002Fnomogram_plot.pdf\n|-- plot\u002Fsession_info.txt\n|-- session_info.txt\n`-- table\u002Fnomogram_c_index.xlsx\n```\n\nHistorical development artifacts may still exist in `tests\u002Foutput\u002F`, but standardized validation uses `tests\u002Fexpected_output\u002F`.\n\n---\n\n## References\n\n1. Harrell FE (2015). *Regression Modeling Strategies*.\n2. Iasonos A et al. (2008). How to build and interpret a nomogram for cancer prognosis. *Journal of Clinical Oncology*.\n3. Balachandran VP et al. (2015). Nomograms in oncology: more than meets the eye. *The Lancet Oncology*.\n\n**For detailed algorithm**, READ: `references\u002Falgorithm.md`\n\n---\n\n## Implementation Checklist\n\n- [x] CLI parsing with `optparse`\n- [x] `set.seed()` for reproducibility\n- [x] `requireNamespace()` dependency checks\n- [x] Session info recording\n- [x] Timeout parameter exposed as CLI option\n- [x] File reading instructions in `SKILL.md`\n- [x] Modular script structure in `scripts\u002F`\n- [x] Test data provided in `tests\u002Fdata\u002F`\n- [x] Error handling with `SKILL_*` codes\n- [x] References documented in `references\u002F`\n\n---\n\n*Last updated: 2026-04-27 | Version: 2.1.0*\n",{"name":5,"license":15,"description":7,"skill-author":24},"AIPOCH","main","e0956dc9606356ab78468936b502e55a365282e2","specialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction",0,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists","https:\u002F\u002Fgithub.com\u002Fmrsonord2240","2026-10-12 03:19:04",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add mrsonord2240\u002Fopenscience-specialists --skill nomogram-construction",{"tool":38,"command":39},"bunx","bunx skills add mrsonord2240\u002Fopenscience-specialists --skill nomogram-construction",{"tool":41,"command":42},"pnpm","pnpm dlx skills add mrsonord2240\u002Fopenscience-specialists --skill nomogram-construction","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002FSKILL.md",true,[46,52,56,60,66,70,74,78,82,86,92,98,102,106,110,114,118,122,126],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Falgorithm.md","REFERENCE","参考文档",3094,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Freferences\u002Falgorithm.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fcli-guide.md",2696,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Freferences\u002Fcli-guide.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Ftroubleshooting.md",3524,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Freferences\u002Ftroubleshooting.md",{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"scripts\u002Ffunctions.R","SCRIPT","脚本",3676,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Fscripts\u002Ffunctions.R",{"path":67,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":68,"sourceHtmlUrl":69},"scripts\u002Fio.R",4213,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Fscripts\u002Fio.R",{"path":71,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":72,"sourceHtmlUrl":73},"scripts\u002Fmain.R",4337,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Fscripts\u002Fmain.R",{"path":75,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":76,"sourceHtmlUrl":77},"scripts\u002Frun_analysis.R",2328,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Fscripts\u002Frun_analysis.R",{"path":79,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":80,"sourceHtmlUrl":81},"scripts\u002Futils.R",991,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Fscripts\u002Futils.R",{"path":83,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":84,"sourceHtmlUrl":85},"scripts\u002Fvalidation.R",2616,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Fscripts\u002Fvalidation.R",{"path":87,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":90,"sourceHtmlUrl":91},"tests\u002Fdata\u002Fyuhou_cli_data.csv","ASSET","资产文件",43139,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Ftests\u002Fdata\u002Fyuhou_cli_data.csv",{"path":93,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":96,"sourceHtmlUrl":97},"tests\u002Fexpected_output\u002Fdata\u002Fanalysis_data.rds","OTHER","其他",4145,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Ftests\u002Fexpected_output\u002Fdata\u002Fanalysis_data.rds",{"path":99,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":100,"sourceHtmlUrl":101},"tests\u002Fexpected_output\u002Fdata\u002FNomogram_list.qs",22142,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Ftests\u002Fexpected_output\u002Fdata\u002FNomogram_list.qs",{"path":103,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":104,"sourceHtmlUrl":105},"tests\u002Fexpected_output\u002Fplot\u002Fsession_info.txt",2792,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Ftests\u002Fexpected_output\u002Fplot\u002Fsession_info.txt",{"path":107,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":108,"sourceHtmlUrl":109},"tests\u002Fexpected_output\u002Fsession_info.txt",2783,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Ftests\u002Fexpected_output\u002Fsession_info.txt",{"path":111,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":112,"sourceHtmlUrl":113},"tests\u002Fexpected_output\u002Ftable\u002Fnomogram_c_index.xlsx",6451,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Ftests\u002Fexpected_output\u002Ftable\u002Fnomogram_c_index.xlsx",{"path":115,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":116,"sourceHtmlUrl":117},"tests\u002Frun_smoke_test.R",2030,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Ftests\u002Frun_smoke_test.R",{"path":119,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":120,"sourceHtmlUrl":121},"tests\u002Frun_smoke_test.sh",127,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Ftests\u002Frun_smoke_test.sh",{"path":123,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":124,"sourceHtmlUrl":125},"tests\u002Ftestthat.R",233,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Ftests\u002Ftestthat.R",{"path":127,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":128,"sourceHtmlUrl":129},"tests\u002Ftestthat\u002Ftest-cli-smoke.R",1289,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fnomogram-construction\u002Ftests\u002Ftestthat\u002Ftest-cli-smoke.R",[131,139,146,153,160,167],{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":135,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":19},"01M7CW36A6QAGWFE2C008M1XPG","bio-workflows-metabolomics-pipeline","Orchestrates the untargeted LC-MS metabolomics pipeline end-to-end (xcms 4.x feature extraction, QC\u002Fdrift\u002Fnormalization, confidence-stratified annotation, permutation-validated statistics, background-aware pathway mapping), naming what each stage decides and where it silently fails. Use when running a full LC-MS metabolomics study from raw mzML to enriched pathways and needing the honest handoffs between stages. Each stage defers to its component skill for parameters and traps; for stable-isotope flux (a separate branch, not this untargeted flow) see metabolomics\u002Fisotope-tracing.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-workflows-metabolomics-pipeline\u002FSKILL.md",[],[],{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":135,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":19},"01M7CW2Y18623NA2S1Y30FRQW1","bio-metabolomics-xcms-preprocessing","Programmatic untargeted LC-MS feature extraction in R with the modern xcms 4.x MsExperiment\u002FXcmsExperiment API, taking raw mzML to a feature table via CentWave peak detection, retention-time alignment, peak-density correspondence, gap-filling, CAMERA redundancy collapse, and built-in QC feature filtering. Use when converting centroided LC-MS runs into a features-by-samples matrix and deciding centWave\u002Fgrouping\u002Falignment parameters. For drift correction and QC\u002FCV filtering execution see metabolomics\u002Fnormalization-qc; for metabolite identification see metabolomics\u002Fmetabolite-annotation; for the MS-DIAL GUI alternative with MS2Dec deconvolution see metabolomics\u002Fmsdial-preprocessing; for downstream statistics see metabolomics\u002Fstatistical-analysis.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-xcms-preprocessing\u002FSKILL.md",[],[],{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":135,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":19},"01M7CW2M364HVWPNQEKE2WP4PP","bio-metabolomics-statistical-analysis","Decision-grade statistical analysis for metabolomics intensity tables. Covers transformation and scaling (Pareto vs unit-variance as a hidden hypothesis), unsupervised structure (PCA\u002FHCA for QC), permutation-validated PLS-DA\u002FOPLS-DA (R2 vs Q2, double CV, VIP as heuristic), univariate testing (Welch\u002FMann-Whitney\u002FANOVA\u002FLMM with covariate adjustment), and dependence-aware multiple testing. Use when testing which metabolites differ, building or validating a discriminant model, choosing a scaling, or correcting many correlated tests. For sample-wise normalization\u002Fdrift correction see metabolomics\u002Fnormalization-qc; for ML classifiers and selection-inside-CV leakage see machine-learning\u002Fbiomarker-discovery and machine-learning\u002Fmodel-validation; for pathway interpretation see metabolomics\u002Fpathway-mapping; for design\u002Fpower\u002Fmultiplicity regime see experimental-design\u002Fmultiple-testing.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-statistical-analysis\u002FSKILL.md",[],[],{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":135,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":19},"01M7CW2BCBF851WYE03Z8XPEDQ","bio-metabolomics-pathway-mapping","Maps metabolomics results to biological pathways via over-representation (ORA), metabolite-set enrichment (MSEA\u002FQEA), mummichog\u002FPSEA on raw m\u002Fz peaks, and network-diffusion enrichment (FELLA), with correct background-set construction and honest interpretive ceilings. Use when interpreting differential metabolites or an untargeted LC-MS feature table in pathway context, choosing ORA vs MSEA vs mummichog vs topology, or setting the reference\u002Fbackground set. For annotation confidence levels feeding ORA see metabolomics\u002Fmetabolite-annotation; for gene-set concepts see pathway-analysis\u002Fgo-enrichment and pathway-analysis\u002Fgsea; for joint gene+metabolite pathways see multi-omics-integration\u002Fmofa-integration.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-pathway-mapping\u002FSKILL.md",[],[],{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":135,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"publishedAt":19},"01M7CW21NSZMCPMF7D9CHJM718","bio-metabolomics-normalization-qc","Designs QC, corrects signal drift, removes batch effects, filters features, normalizes samples, and imputes missing values for untargeted LC-MS\u002FGC-MS metabolomics, framing each step as a measurement model that can create or erase biological signal. Use when processing a peak\u002Ffeature table before statistical analysis, choosing a drift-correction or sample-normalization method, deciding QC RSD vs D-ratio filtering, or handling left-censored missing values. The feature table is produced by metabolomics\u002Fxcms-preprocessing or metabolomics\u002Fmsdial-preprocessing; transformation\u002Fscaling for modeling defers to metabolomics\u002Fstatistical-analysis; cross-study design issues link to experimental-design\u002Fbatch-design.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-normalization-qc\u002FSKILL.md",[],[],{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":135,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":19},"01M7CW1SWVM0NYHVE6Q7MA3G7R","bio-metabolomics-msdial-preprocessing","Runs the MS-DIAL preprocessing workflow (peak picking, MS2Dec spectral deconvolution, alignment, gap-filling) and imports the alignment-result table into R or Python with honest filtering. Use when preprocessing LC-MS DDA\u002FDIA (SWATH) or GC-MS raw data with MS-DIAL, deciding MS-DIAL vs XCMS, configuring the MSDIALCUI console run, or parsing an MS-DIAL export into a clean feature matrix. For programmatic R peak detection and the feature-table-as-artifact framing see metabolomics\u002Fxcms-preprocessing; for lipid annotation mode see metabolomics\u002Flipidomics; for MSI-level confidence honesty see metabolomics\u002Fmetabolite-annotation; for drift correction and QC see metabolomics\u002Fnormalization-qc.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-msdial-preprocessing\u002FSKILL.md",[],[]]