Roc Diagnostic Performance logo

Roc Diagnostic Performance

OrganizationPopular
aipoch
roc-diagnostic-performance

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.

Overview

Publisheraipoch
Repositorymedical-research-skills
Skill nameroc-diagnostic-performance
Stars
1.9K
Forks
175
Bundled files
21
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 21 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by aipoch on GitHub. Read the source before you install it.

Installation

Install the Roc Diagnostic Performance AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.

Use it in TypingMind

Enable Roc Diagnostic Performance in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Roc Diagnostic Performance on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Roc Diagnostic Performance is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

ROC Diagnostic Performance

When to Use

Use this skill when you need to:

  • evaluate one or more diagnostic marker genes in a case-control cohort;
  • build a multivariable logistic regression diagnostic model from marker expression values;
  • compare the ROC performance of the full model against individual markers.

Typical user requests:

  • "Use these genes to build a diagnostic ROC model for case vs control samples."
  • "Evaluate the AUC of FOXP3, CD45, and CD3E and plot all ROC curves together."
  • "Run logistic regression on biomarker expression and export ROC results."

When Not to Use

Do not use this skill for:

  • survival or prognostic analysis with time-to-event outcomes;
  • multiclass classification tasks;
  • calibration plots, nomograms, or decision-curve analysis;
  • non-expression diagnostic inputs such as imaging, clinical scores, or mutation-only tables.

When to Read External Files

SituationFile to ReadPurpose
Need algorithm detailsreferences/algorithm.mdLogistic regression, ROC, AUC, and modeling assumptions
Need to run analysisscripts/main.RExecute Rscript scripts/main.R --expression_file ... --group_file ...
Encounter errorsreferences/troubleshooting.mdCommon SKILL_* errors and solutions
Need CLI examplesreferences/cli-guide.mdDetailed command-line examples
Need test datatests/data/Example expression matrix and group file

Usage

bash
Rscript scripts/main.R \
  --expression_file ./expression_matrix.csv \
  --group_file ./group_info.csv \
  --marker_genes FOXP3,CD45,CD3E \
  --case_group Disease \
  --output_dir ./output/ \
  --seed 42

Arguments

ShortLongTypeDefaultDescription
-e--expression_filecharacterrequiredExpression matrix file in CSV/TSV format
-g--group_filecharacterrequiredGroup file with sample IDs and labels
-m--marker_genescharacterrequiredComma-separated marker genes
-c--case_groupcharacterrequiredCase group label in the group file
--group_colcharacterNULLOptional group column name; auto-detected if omitted
-o--output_dircharacter./output/Output directory
--overwriteflagFALSEAllow writing into a non-empty output directory
-s--seedinteger42Random seed for reproducibility
-T--timeout_secondsinteger0Elapsed time limit in seconds; 0 disables timeout
--plot_widthdouble6ROC plot width in inches
--plot_heightdouble6ROC plot height in inches
--font_familycharactersansPDF font family
--line_colorscharacter#E64B35,#4DBBD5,#00A087,#3C5488,#F39B7FComma-separated ROC line colors
--line_widthdouble1.2ROC curve line width
--show_diagonalcharactertrueShow diagonal reference line: true or false
--diagonal_colorcharacter#7F7F7FDiagonal line color
--diagonal_ltyinteger2Diagonal line type
--plot_titlecharacterROC Diagnostic PerformanceROC plot title
--x_labelcharacter1 - SpecificityX-axis label
--y_labelcharacterSensitivityY-axis label
--base_cexdouble0.9Base text-size multiplier
--legend_positioncharacterbottomrightLegend position
--legend_cexdouble0.8Legend text size

Input Format

Expression Matrix (expression_file)

CSV or TSV file with genes as rows and samples as columns. The first column must store unique gene identifiers.

csv
gene,Sample1,Sample2,Sample3
FOXP3,8.4,7.1,3.8
CD45,2.1,1.9,5.4
CD3E,5.8,6.2,4.0

Requirements

  • File extension must be .csv, .tsv, or .txt.
  • The first column must contain non-missing, unique gene identifiers.
  • Remaining columns must be sample IDs.
  • Selected marker genes must have numeric finite expression values across matched samples.

Group File (group_file)

CSV or TSV file with sample IDs in the first column and at least one group-label column.

csv
sample,group
Sample1,Disease
Sample2,Disease
Sample3,Control

Requirements

  • File extension must be .csv, .tsv, or .txt.
  • The first column must contain non-missing, unique sample IDs.
  • At least one group column must be present.
  • The case_group value must appear in the selected group column.
  • At least 10 matched samples, 2 case samples, and 2 control samples are required.

Output Files

FileDescription
data/analysis_data.rdsMatched sample-level analysis dataset used for model fitting
data/roc_model.rdsSaved logistic regression model bundle with data and selected genes
table/model_coefficients.csvLogistic regression coefficients, z statistics, p-values, and odds ratios
table/roc_auc_summary.csvAUC values for the full model and each marker
plot/roc_curve.pdfROC curves for the full model and individual markers
session_info.txtSession information and run parameters

model_coefficients.csv

ColumnDescription
termModel term name
estimateLogistic regression coefficient
std_errorStandard error of the coefficient
z_valueWald z statistic
p_valueWald test p-value
odds_ratioExponentiated coefficient
odds_ratio_95_ciOdds ratio with 95% confidence interval

roc_auc_summary.csv

ColumnDescription
modelFull model or marker name
aucArea under the ROC curve

Workflow

Step 1: Validate Input

  • Check that the expression matrix and group file exist and have supported formats.
  • Validate unique gene identifiers and sample IDs.
  • Match samples shared by both files.

Step 2: Prepare Analysis Dataset

  • Keep only the requested marker genes that exist in the expression matrix.
  • Merge matched expression values with group labels.
  • Convert the selected case group to binary outcome labels.

Step 3: Fit Logistic Regression

  • Fit a multivariable logistic regression model using the selected markers.
  • Extract coefficient estimates, standard errors, p-values, and odds ratios.

Step 4: Compute ROC Performance

  • Generate the ROC curve of the full logistic model.
  • Generate ROC curves for each individual marker.
  • Calculate AUC values for the full model and each marker.

Step 5: Save Outputs

  • Save the matched analysis dataset and model bundle as .rds files.
  • Save coefficient and AUC summary tables as .csv files.
  • Save the combined ROC plot as a PDF.

Examples

Basic Usage

bash
Rscript scripts/main.R \
  -e expression_matrix.csv \
  -g group_info.csv \
  -m FOXP3,CD45,CD3E \
  -c Disease \
  -o ./output/

With Explicit Group Column and Custom Plot

bash
Rscript scripts/main.R \
  -e expression_matrix.csv \
  -g group_info.csv \
  -m FOXP3,CD45,CD3E \
  -c Disease \
  --group_col diagnosis \
  --plot_width 8 \
  --plot_height 6 \
  --plot_title "Biomarker ROC Comparison" \
  --legend_position topright \
  -o ./output/

With Test Data

bash
Rscript scripts/main.R \
  -e tests/data/sample_expression_matrix.csv \
  -g tests/data/sample_group_info.csv \
  -m FOXP3,CD45,CD3E \
  -c Disease \
  -o tests/expected_output/ \
  --overwrite

Error Handling

ErrorCauseSolution
SKILL_INVALID_PARAMETERMissing required argument, invalid option value, invalid matrix/group structure, invalid case label, insufficient case-control counts, or logistic fitting failureCheck argument names, input content, class balance, and model stability
SKILL_FILE_NOT_FOUNDInput file does not existVerify the file path
SKILL_EMPTY_DATAInput file contains no usable rows, or no requested markers remain after filteringCheck file content, delimiter, and marker names
SKILL_MISSING_COLUMNSRequested group column is absentVerify --group_col and the group file header
SKILL_SAMPLE_MISMATCHExpression matrix and group file do not share sample IDsVerify that sample IDs match exactly between files
SKILL_PACKAGE_NOT_FOUNDRequired R package is not installedInstall the missing CRAN package

IF error persists, READ: references/troubleshooting.md


Testing

Smoke Test With Included Data

bash
Rscript scripts/main.R --help

Rscript scripts/main.R \
  -e tests/data/sample_expression_matrix.csv \
  -g tests/data/sample_group_info.csv \
  -m FOXP3,CD45,CD3E \
  -c Disease \
  -o tests/expected_output/ \
  --overwrite

Automated Smoke Test Script

bash
Rscript tests/run_smoke_test.R

Optional shell wrapper:

bash
bash tests/run_smoke_test.sh

Expected Output

text
tests/expected_output/
|-- data/analysis_data.rds
|-- data/roc_model.rds
|-- plot/roc_curve.pdf
|-- session_info.txt
|-- table/model_coefficients.csv
`-- table/roc_auc_summary.csv

References

  1. Hosmer DW, Lemeshow S, Sturdivant RX (2013). Applied Logistic Regression.
  2. Fawcett T (2006). An Introduction to ROC Analysis. Pattern Recognition Letters.
  3. Robin X et al. (2011). pROC: an open-source package for R and S+ to analyze and compare ROC curves. BMC Bioinformatics.

For detailed algorithm, READ: references/algorithm.md


Implementation Checklist

  • CLI parsing with optparse
  • set.seed() for reproducibility
  • requireNamespace() dependency checks
  • Session info recording
  • Timeout parameter exposed as CLI option
  • File reading instructions in SKILL.md
  • Modular script structure in scripts/
  • Test data provided in tests/data/
  • Error handling with SKILL_* codes
  • References documented in references/

Last updated: 2026-04-17 | Version: 2.1.0

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Roc Diagnostic Performance AI skill do?

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.

Why use Roc Diagnostic Performance on TypingMind?

Because you install it once and use it with any model. Roc Diagnostic Performance is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Roc Diagnostic Performance in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/aipoch/medical-research-skills/tree/main/awesome-med-research-skills/Data%20Analysis/roc-diagnostic-performance. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Roc Diagnostic Performance?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Roc Diagnostic Performance?

As many as you like. As long as a model supports skills, you can use Roc Diagnostic Performance with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Roc Diagnostic Performance AI skill free?

Yes. It is published on GitHub by aipoch under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇