[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CTTRDT2S1NESDWPC4YH888":3,"skill-same:01M7CTTRDT2S1NESDWPC4YH888":133},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7CTTRDT2S1NESDWPC4YH888","roc-diagnostic-performance",null,"Use when evaluating diagnostic biomarker performance from case-control expression data with logistic regression and ROC curves, exporting coefficient and AUC tables together with a ROC PDF. NOT for: survival analysis, time-to-event outcomes, multiclass classification, calibration curves, decision-curve analysis, or nomogram construction.","mrsonord2240\u002Fopenscience-specialists","mrsonord2240","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76487430?v=4","01M7CTEM40S43GSJZ9A3YCCXZK","Samuel Nord","01M7CTEM4K69JD1GBYNHVJ9ZP4",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: roc-diagnostic-performance\ndescription: \"Use when evaluating diagnostic biomarker performance from case-control expression data with logistic regression and ROC curves, exporting coefficient and AUC tables together with a ROC PDF. NOT for: survival analysis, time-to-event outcomes, multiclass classification, calibration curves, decision-curve analysis, or nomogram construction.\"\n---\n\n# ROC Diagnostic Performance\n\n## When to Use\n\nUse this skill when you need to:\n- evaluate one or more diagnostic marker genes in a case-control cohort;\n- build a multivariable logistic regression diagnostic model from marker expression values;\n- compare the ROC performance of the full model against individual markers.\n\nTypical user requests:\n- \"Use these genes to build a diagnostic ROC model for case vs control samples.\"\n- \"Evaluate the AUC of FOXP3, CD45, and CD3E and plot all ROC curves together.\"\n- \"Run logistic regression on biomarker expression and export ROC results.\"\n\n## When Not to Use\n\nDo not use this skill for:\n- survival or prognostic analysis with time-to-event outcomes;\n- multiclass classification tasks;\n- calibration plots, nomograms, or decision-curve analysis;\n- non-expression diagnostic inputs such as imaging, clinical scores, or mutation-only tables.\n\n## When to Read External Files\n\n| Situation | File to Read | Purpose |\n|-----------|--------------|---------|\n| **Need algorithm details** | `references\u002Falgorithm.md` | Logistic regression, ROC, AUC, and modeling assumptions |\n| **Need to run analysis** | `scripts\u002Fmain.R` | Execute `Rscript scripts\u002Fmain.R --expression_file ... --group_file ...` |\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 expression matrix and group file |\n\n---\n\n## Usage\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --expression_file .\u002Fexpression_matrix.csv \\\n  --group_file .\u002Fgroup_info.csv \\\n  --marker_genes FOXP3,CD45,CD3E \\\n  --case_group Disease \\\n  --output_dir .\u002Foutput\u002F \\\n  --seed 42\n```\n\n---\n\n## Arguments\n\n| Short | Long | Type | Default | Description |\n|-------|------|------|---------|-------------|\n| `-e` | `--expression_file` | character | **required** | Expression matrix file in CSV\u002FTSV format |\n| `-g` | `--group_file` | character | **required** | Group file with sample IDs and labels |\n| `-m` | `--marker_genes` | character | **required** | Comma-separated marker genes |\n| `-c` | `--case_group` | character | **required** | Case group label in the group file |\n|  | `--group_col` | character | `NULL` | Optional group column name; auto-detected if omitted |\n| `-o` | `--output_dir` | character | `.\u002Foutput\u002F` | Output directory |\n|  | `--overwrite` | flag | `FALSE` | Allow writing into a non-empty output directory |\n| `-s` | `--seed` | integer | `42` | Random seed for reproducibility |\n| `-T` | `--timeout_seconds` | integer | `0` | Elapsed time limit in seconds; `0` disables timeout |\n|  | `--plot_width` | double | `6` | ROC plot width in inches |\n|  | `--plot_height` | double | `6` | ROC plot height in inches |\n|  | `--font_family` | character | `sans` | PDF font family |\n|  | `--line_colors` | character | `#E64B35,#4DBBD5,#00A087,#3C5488,#F39B7F` | Comma-separated ROC line colors |\n|  | `--line_width` | double | `1.2` | ROC curve line width |\n|  | `--show_diagonal` | character | `true` | Show diagonal reference line: `true` or `false` |\n|  | `--diagonal_color` | character | `#7F7F7F` | Diagonal line color |\n|  | `--diagonal_lty` | integer | `2` | Diagonal line type |\n|  | `--plot_title` | character | `ROC Diagnostic Performance` | ROC plot title |\n|  | `--x_label` | character | `1 - Specificity` | X-axis label |\n|  | `--y_label` | character | `Sensitivity` | Y-axis label |\n|  | `--base_cex` | double | `0.9` | Base text-size multiplier |\n|  | `--legend_position` | character | `bottomright` | Legend position |\n|  | `--legend_cex` | double | `0.8` | Legend text size |\n\n---\n\n## Input Format\n\n### Expression Matrix (`expression_file`)\n\nCSV or TSV file with genes as rows and samples as columns. The first column must store unique gene identifiers.\n\n```csv\ngene,Sample1,Sample2,Sample3\nFOXP3,8.4,7.1,3.8\nCD45,2.1,1.9,5.4\nCD3E,5.8,6.2,4.0\n```\n\n**Requirements**\n- File extension must be `.csv`, `.tsv`, or `.txt`.\n- The first column must contain non-missing, unique gene identifiers.\n- Remaining columns must be sample IDs.\n- Selected marker genes must have numeric finite expression values across matched samples.\n\n### Group File (`group_file`)\n\nCSV or TSV file with sample IDs in the first column and at least one group-label column.\n\n```csv\nsample,group\nSample1,Disease\nSample2,Disease\nSample3,Control\n```\n\n**Requirements**\n- File extension must be `.csv`, `.tsv`, or `.txt`.\n- The first column must contain non-missing, unique sample IDs.\n- At least one group column must be present.\n- The `case_group` value must appear in the selected group column.\n- At least 10 matched samples, 2 case samples, and 2 control samples are required.\n\n---\n\n## Output Files\n\n| File | Description |\n|------|-------------|\n| `data\u002Fanalysis_data.rds` | Matched sample-level analysis dataset used for model fitting |\n| `data\u002Froc_model.rds` | Saved logistic regression model bundle with data and selected genes |\n| `table\u002Fmodel_coefficients.csv` | Logistic regression coefficients, z statistics, p-values, and odds ratios |\n| `table\u002Froc_auc_summary.csv` | AUC values for the full model and each marker |\n| `plot\u002Froc_curve.pdf` | ROC curves for the full model and individual markers |\n| `session_info.txt` | Session information and run parameters |\n\n### model_coefficients.csv\n\n| Column | Description |\n|--------|-------------|\n| `term` | Model term name |\n| `estimate` | Logistic regression coefficient |\n| `std_error` | Standard error of the coefficient |\n| `z_value` | Wald z statistic |\n| `p_value` | Wald test p-value |\n| `odds_ratio` | Exponentiated coefficient |\n| `odds_ratio_95_ci` | Odds ratio with 95% confidence interval |\n\n### roc_auc_summary.csv\n\n| Column | Description |\n|--------|-------------|\n| `model` | Full model or marker name |\n| `auc` | Area under the ROC curve |\n\n---\n\n## Workflow\n\n### Step 1: Validate Input\n- Check that the expression matrix and group file exist and have supported formats.\n- Validate unique gene identifiers and sample IDs.\n- Match samples shared by both files.\n\n### Step 2: Prepare Analysis Dataset\n- Keep only the requested marker genes that exist in the expression matrix.\n- Merge matched expression values with group labels.\n- Convert the selected case group to binary outcome labels.\n\n### Step 3: Fit Logistic Regression\n- Fit a multivariable logistic regression model using the selected markers.\n- Extract coefficient estimates, standard errors, p-values, and odds ratios.\n\n### Step 4: Compute ROC Performance\n- Generate the ROC curve of the full logistic model.\n- Generate ROC curves for each individual marker.\n- Calculate AUC values for the full model and each marker.\n\n### Step 5: Save Outputs\n- Save the matched analysis dataset and model bundle as `.rds` files.\n- Save coefficient and AUC summary tables as `.csv` files.\n- Save the combined ROC plot as a PDF.\n\n---\n\n## Examples\n\n### Basic Usage\n\n```bash\nRscript scripts\u002Fmain.R \\\n  -e expression_matrix.csv \\\n  -g group_info.csv \\\n  -m FOXP3,CD45,CD3E \\\n  -c Disease \\\n  -o .\u002Foutput\u002F\n```\n\n### With Explicit Group Column and Custom Plot\n\n```bash\nRscript scripts\u002Fmain.R \\\n  -e expression_matrix.csv \\\n  -g group_info.csv \\\n  -m FOXP3,CD45,CD3E \\\n  -c Disease \\\n  --group_col diagnosis \\\n  --plot_width 8 \\\n  --plot_height 6 \\\n  --plot_title \"Biomarker ROC Comparison\" \\\n  --legend_position topright \\\n  -o .\u002Foutput\u002F\n```\n\n### With Test Data\n\n```bash\nRscript scripts\u002Fmain.R \\\n  -e tests\u002Fdata\u002Fsample_expression_matrix.csv \\\n  -g tests\u002Fdata\u002Fsample_group_info.csv \\\n  -m FOXP3,CD45,CD3E \\\n  -c Disease \\\n  -o tests\u002Fexpected_output\u002F \\\n  --overwrite\n```\n\n---\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| `SKILL_INVALID_PARAMETER` | Missing required argument, invalid option value, invalid matrix\u002Fgroup structure, invalid case label, insufficient case-control counts, or logistic fitting failure | Check argument names, input content, class balance, and model stability |\n| `SKILL_FILE_NOT_FOUND` | Input file does not exist | Verify the file path |\n| `SKILL_EMPTY_DATA` | Input file contains no usable rows, or no requested markers remain after filtering | Check file content, delimiter, and marker names |\n| `SKILL_MISSING_COLUMNS` | Requested group column is absent | Verify `--group_col` and the group file header |\n| `SKILL_SAMPLE_MISMATCH` | Expression matrix and group file do not share sample IDs | Verify that sample IDs match exactly between files |\n| `SKILL_PACKAGE_NOT_FOUND` | Required R package is not installed | Install the missing CRAN package |\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  -e tests\u002Fdata\u002Fsample_expression_matrix.csv \\\n  -g tests\u002Fdata\u002Fsample_group_info.csv \\\n  -m FOXP3,CD45,CD3E \\\n  -c Disease \\\n  -o tests\u002Fexpected_output\u002F \\\n  --overwrite\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\u002Froc_model.rds\n|-- plot\u002Froc_curve.pdf\n|-- session_info.txt\n|-- table\u002Fmodel_coefficients.csv\n`-- table\u002Froc_auc_summary.csv\n```\n\n---\n\n## References\n\n1. Hosmer DW, Lemeshow S, Sturdivant RX (2013). *Applied Logistic Regression*.\n2. Fawcett T (2006). An Introduction to ROC Analysis. *Pattern Recognition Letters*.\n3. Robin X et al. (2011). pROC: an open-source package for R and S+ to analyze and compare ROC curves. *BMC Bioinformatics*.\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-17 | Version: 2.1.0*\n","# ROC Diagnostic Performance\n\n## When to Use\n\nUse this skill when you need to:\n- evaluate one or more diagnostic marker genes in a case-control cohort;\n- build a multivariable logistic regression diagnostic model from marker expression values;\n- compare the ROC performance of the full model against individual markers.\n\nTypical user requests:\n- \"Use these genes to build a diagnostic ROC model for case vs control samples.\"\n- \"Evaluate the AUC of FOXP3, CD45, and CD3E and plot all ROC curves together.\"\n- \"Run logistic regression on biomarker expression and export ROC results.\"\n\n## When Not to Use\n\nDo not use this skill for:\n- survival or prognostic analysis with time-to-event outcomes;\n- multiclass classification tasks;\n- calibration plots, nomograms, or decision-curve analysis;\n- non-expression diagnostic inputs such as imaging, clinical scores, or mutation-only tables.\n\n## When to Read External Files\n\n| Situation | File to Read | Purpose |\n|-----------|--------------|---------|\n| **Need algorithm details** | `references\u002Falgorithm.md` | Logistic regression, ROC, AUC, and modeling assumptions |\n| **Need to run analysis** | `scripts\u002Fmain.R` | Execute `Rscript scripts\u002Fmain.R --expression_file ... --group_file ...` |\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 expression matrix and group file |\n\n---\n\n## Usage\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --expression_file .\u002Fexpression_matrix.csv \\\n  --group_file .\u002Fgroup_info.csv \\\n  --marker_genes FOXP3,CD45,CD3E \\\n  --case_group Disease \\\n  --output_dir .\u002Foutput\u002F \\\n  --seed 42\n```\n\n---\n\n## Arguments\n\n| Short | Long | Type | Default | Description |\n|-------|------|------|---------|-------------|\n| `-e` | `--expression_file` | character | **required** | Expression matrix file in CSV\u002FTSV format |\n| `-g` | `--group_file` | character | **required** | Group file with sample IDs and labels |\n| `-m` | `--marker_genes` | character | **required** | Comma-separated marker genes |\n| `-c` | `--case_group` | character | **required** | Case group label in the group file |\n|  | `--group_col` | character | `NULL` | Optional group column name; auto-detected if omitted |\n| `-o` | `--output_dir` | character | `.\u002Foutput\u002F` | Output directory |\n|  | `--overwrite` | flag | `FALSE` | Allow writing into a non-empty output directory |\n| `-s` | `--seed` | integer | `42` | Random seed for reproducibility |\n| `-T` | `--timeout_seconds` | integer | `0` | Elapsed time limit in seconds; `0` disables timeout |\n|  | `--plot_width` | double | `6` | ROC plot width in inches |\n|  | `--plot_height` | double | `6` | ROC plot height in inches |\n|  | `--font_family` | character | `sans` | PDF font family |\n|  | `--line_colors` | character | `#E64B35,#4DBBD5,#00A087,#3C5488,#F39B7F` | Comma-separated ROC line colors |\n|  | `--line_width` | double | `1.2` | ROC curve line width |\n|  | `--show_diagonal` | character | `true` | Show diagonal reference line: `true` or `false` |\n|  | `--diagonal_color` | character | `#7F7F7F` | Diagonal line color |\n|  | `--diagonal_lty` | integer | `2` | Diagonal line type |\n|  | `--plot_title` | character | `ROC Diagnostic Performance` | ROC plot title |\n|  | `--x_label` | character | `1 - Specificity` | X-axis label |\n|  | `--y_label` | character | `Sensitivity` | Y-axis label |\n|  | `--base_cex` | double | `0.9` | Base text-size multiplier |\n|  | `--legend_position` | character | `bottomright` | Legend position |\n|  | `--legend_cex` | double | `0.8` | Legend text size |\n\n---\n\n## Input Format\n\n### Expression Matrix (`expression_file`)\n\nCSV or TSV file with genes as rows and samples as columns. The first column must store unique gene identifiers.\n\n```csv\ngene,Sample1,Sample2,Sample3\nFOXP3,8.4,7.1,3.8\nCD45,2.1,1.9,5.4\nCD3E,5.8,6.2,4.0\n```\n\n**Requirements**\n- File extension must be `.csv`, `.tsv`, or `.txt`.\n- The first column must contain non-missing, unique gene identifiers.\n- Remaining columns must be sample IDs.\n- Selected marker genes must have numeric finite expression values across matched samples.\n\n### Group File (`group_file`)\n\nCSV or TSV file with sample IDs in the first column and at least one group-label column.\n\n```csv\nsample,group\nSample1,Disease\nSample2,Disease\nSample3,Control\n```\n\n**Requirements**\n- File extension must be `.csv`, `.tsv`, or `.txt`.\n- The first column must contain non-missing, unique sample IDs.\n- At least one group column must be present.\n- The `case_group` value must appear in the selected group column.\n- At least 10 matched samples, 2 case samples, and 2 control samples are required.\n\n---\n\n## Output Files\n\n| File | Description |\n|------|-------------|\n| `data\u002Fanalysis_data.rds` | Matched sample-level analysis dataset used for model fitting |\n| `data\u002Froc_model.rds` | Saved logistic regression model bundle with data and selected genes |\n| `table\u002Fmodel_coefficients.csv` | Logistic regression coefficients, z statistics, p-values, and odds ratios |\n| `table\u002Froc_auc_summary.csv` | AUC values for the full model and each marker |\n| `plot\u002Froc_curve.pdf` | ROC curves for the full model and individual markers |\n| `session_info.txt` | Session information and run parameters |\n\n### model_coefficients.csv\n\n| Column | Description |\n|--------|-------------|\n| `term` | Model term name |\n| `estimate` | Logistic regression coefficient |\n| `std_error` | Standard error of the coefficient |\n| `z_value` | Wald z statistic |\n| `p_value` | Wald test p-value |\n| `odds_ratio` | Exponentiated coefficient |\n| `odds_ratio_95_ci` | Odds ratio with 95% confidence interval |\n\n### roc_auc_summary.csv\n\n| Column | Description |\n|--------|-------------|\n| `model` | Full model or marker name |\n| `auc` | Area under the ROC curve |\n\n---\n\n## Workflow\n\n### Step 1: Validate Input\n- Check that the expression matrix and group file exist and have supported formats.\n- Validate unique gene identifiers and sample IDs.\n- Match samples shared by both files.\n\n### Step 2: Prepare Analysis Dataset\n- Keep only the requested marker genes that exist in the expression matrix.\n- Merge matched expression values with group labels.\n- Convert the selected case group to binary outcome labels.\n\n### Step 3: Fit Logistic Regression\n- Fit a multivariable logistic regression model using the selected markers.\n- Extract coefficient estimates, standard errors, p-values, and odds ratios.\n\n### Step 4: Compute ROC Performance\n- Generate the ROC curve of the full logistic model.\n- Generate ROC curves for each individual marker.\n- Calculate AUC values for the full model and each marker.\n\n### Step 5: Save Outputs\n- Save the matched analysis dataset and model bundle as `.rds` files.\n- Save coefficient and AUC summary tables as `.csv` files.\n- Save the combined ROC plot as a PDF.\n\n---\n\n## Examples\n\n### Basic Usage\n\n```bash\nRscript scripts\u002Fmain.R \\\n  -e expression_matrix.csv \\\n  -g group_info.csv \\\n  -m FOXP3,CD45,CD3E \\\n  -c Disease \\\n  -o .\u002Foutput\u002F\n```\n\n### With Explicit Group Column and Custom Plot\n\n```bash\nRscript scripts\u002Fmain.R \\\n  -e expression_matrix.csv \\\n  -g group_info.csv \\\n  -m FOXP3,CD45,CD3E \\\n  -c Disease \\\n  --group_col diagnosis \\\n  --plot_width 8 \\\n  --plot_height 6 \\\n  --plot_title \"Biomarker ROC Comparison\" \\\n  --legend_position topright \\\n  -o .\u002Foutput\u002F\n```\n\n### With Test Data\n\n```bash\nRscript scripts\u002Fmain.R \\\n  -e tests\u002Fdata\u002Fsample_expression_matrix.csv \\\n  -g tests\u002Fdata\u002Fsample_group_info.csv \\\n  -m FOXP3,CD45,CD3E \\\n  -c Disease \\\n  -o tests\u002Fexpected_output\u002F \\\n  --overwrite\n```\n\n---\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| `SKILL_INVALID_PARAMETER` | Missing required argument, invalid option value, invalid matrix\u002Fgroup structure, invalid case label, insufficient case-control counts, or logistic fitting failure | Check argument names, input content, class balance, and model stability |\n| `SKILL_FILE_NOT_FOUND` | Input file does not exist | Verify the file path |\n| `SKILL_EMPTY_DATA` | Input file contains no usable rows, or no requested markers remain after filtering | Check file content, delimiter, and marker names |\n| `SKILL_MISSING_COLUMNS` | Requested group column is absent | Verify `--group_col` and the group file header |\n| `SKILL_SAMPLE_MISMATCH` | Expression matrix and group file do not share sample IDs | Verify that sample IDs match exactly between files |\n| `SKILL_PACKAGE_NOT_FOUND` | Required R package is not installed | Install the missing CRAN package |\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  -e tests\u002Fdata\u002Fsample_expression_matrix.csv \\\n  -g tests\u002Fdata\u002Fsample_group_info.csv \\\n  -m FOXP3,CD45,CD3E \\\n  -c Disease \\\n  -o tests\u002Fexpected_output\u002F \\\n  --overwrite\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\u002Froc_model.rds\n|-- plot\u002Froc_curve.pdf\n|-- session_info.txt\n|-- table\u002Fmodel_coefficients.csv\n`-- table\u002Froc_auc_summary.csv\n```\n\n---\n\n## References\n\n1. Hosmer DW, Lemeshow S, Sturdivant RX (2013). *Applied Logistic Regression*.\n2. Fawcett T (2006). An Introduction to ROC Analysis. *Pattern Recognition Letters*.\n3. Robin X et al. (2011). pROC: an open-source package for R and S+ to analyze and compare ROC curves. *BMC Bioinformatics*.\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-17 | Version: 2.1.0*\n",{"name":5,"description":7},"main","e0956dc9606356ab78468936b502e55a365282e2","specialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance",0,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists","https:\u002F\u002Fgithub.com\u002Fmrsonord2240","2026-10-12 03:19:04",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add mrsonord2240\u002Fopenscience-specialists --skill roc-diagnostic-performance",{"tool":37,"command":38},"bunx","bunx skills add mrsonord2240\u002Fopenscience-specialists --skill roc-diagnostic-performance",{"tool":40,"command":41},"pnpm","pnpm dlx skills add mrsonord2240\u002Fopenscience-specialists --skill roc-diagnostic-performance","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002FSKILL.md",true,[45,51,55,59,65,69,73,77,81,85,89,93,99,103,109,113,117,121,125,129],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"references\u002Falgorithm.md","REFERENCE","参考文档",2911,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Freferences\u002Falgorithm.md",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fcli-guide.md",2759,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Freferences\u002Fcli-guide.md",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Ftroubleshooting.md",2878,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Freferences\u002Ftroubleshooting.md",{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"scripts\u002Fcli.R","SCRIPT","脚本",3802,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Fscripts\u002Fcli.R",{"path":66,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":67,"sourceHtmlUrl":68},"scripts\u002Ffunctions.R",6056,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Fscripts\u002Ffunctions.R",{"path":70,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":71,"sourceHtmlUrl":72},"scripts\u002Fio.R",1329,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Fscripts\u002Fio.R",{"path":74,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":75,"sourceHtmlUrl":76},"scripts\u002Fmain.R",1894,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Fscripts\u002Fmain.R",{"path":78,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":79,"sourceHtmlUrl":80},"scripts\u002Fplotting.R",2453,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Fscripts\u002Fplotting.R",{"path":82,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":83,"sourceHtmlUrl":84},"scripts\u002Frun_analysis.R",2894,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Fscripts\u002Frun_analysis.R",{"path":86,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":87,"sourceHtmlUrl":88},"scripts\u002Futils.R",2537,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Fscripts\u002Futils.R",{"path":90,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":91,"sourceHtmlUrl":92},"scripts\u002Fvalidation.R",2316,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Fscripts\u002Fvalidation.R",{"path":94,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":97,"sourceHtmlUrl":98},"tests\u002Fdata\u002Fsample_expression_matrix.csv","ASSET","资产文件",7744,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Ftests\u002Fdata\u002Fsample_expression_matrix.csv",{"path":100,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":101,"sourceHtmlUrl":102},"tests\u002Fdata\u002Fsample_group_info.csv",2209,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Ftests\u002Fdata\u002Fsample_group_info.csv",{"path":104,"resourceType":105,"resourceTypeDesc":106,"sizeBytes":107,"sourceHtmlUrl":108},"tests\u002Fexpected_output\u002Fdata\u002Fanalysis_data.rds","OTHER","其他",2847,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Ftests\u002Fexpected_output\u002Fdata\u002Fanalysis_data.rds",{"path":110,"resourceType":105,"resourceTypeDesc":106,"sizeBytes":111,"sourceHtmlUrl":112},"tests\u002Fexpected_output\u002Fdata\u002Froc_model.rds",17440,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Ftests\u002Fexpected_output\u002Fdata\u002Froc_model.rds",{"path":114,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":115,"sourceHtmlUrl":116},"tests\u002Fexpected_output\u002Fsession_info.txt",1798,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Ftests\u002Fexpected_output\u002Fsession_info.txt",{"path":118,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":119,"sourceHtmlUrl":120},"tests\u002Fexpected_output\u002Ftable\u002Fmodel_coefficients.csv",568,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Ftests\u002Fexpected_output\u002Ftable\u002Fmodel_coefficients.csv",{"path":122,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":123,"sourceHtmlUrl":124},"tests\u002Fexpected_output\u002Ftable\u002Froc_auc_summary.csv",76,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Ftests\u002Fexpected_output\u002Ftable\u002Froc_auc_summary.csv",{"path":126,"resourceType":105,"resourceTypeDesc":106,"sizeBytes":127,"sourceHtmlUrl":128},"tests\u002Frun_smoke_test.R",2116,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Froc-diagnostic-performance\u002Ftests\u002Frun_smoke_test.R",{"path":130,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":131,"sourceHtmlUrl":132},"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\u002Froc-diagnostic-performance\u002Ftests\u002Frun_smoke_test.sh",[134,141,148,155,162,169],{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"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.","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":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"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":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":154,"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":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"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":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"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":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"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",[],[]]