neoantigen-predictor

Predict neoantigens that may be recognized by the immune system based.

53 stars

Best use case

neoantigen-predictor is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Predict neoantigens that may be recognized by the immune system based.

Teams using neoantigen-predictor should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/neoantigen-predictor/SKILL.md --create-dirs "https://raw.githubusercontent.com/aipoch/medical-research-skills/main/scientific-skills/Data Analysis/neoantigen-predictor/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/neoantigen-predictor/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How neoantigen-predictor Compares

Feature / Agentneoantigen-predictorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Predict neoantigens that may be recognized by the immune system based.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)
# Neoantigen Predictor

Predicts patient-specific neoantigen candidate peptides with high immunogenicity based on HLA typing and tumor mutation profiles, providing target screening for tumor immunotherapy.

## When to Use

- Use this skill when the task is to Predict neoantigens that may be recognized by the immune system based.
- Use this skill for data analysis tasks that require explicit assumptions, bounded scope, and a reproducible output format.
- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.

## Key Features

- Scope-focused workflow aligned to: Predict neoantigens that may be recognized by the immune system based.
- Packaged executable path(s): `scripts/main.py`.
- Reference material available in `references/` for task-specific guidance.
- Structured execution path designed to keep outputs consistent and reviewable.

## Dependencies

**Required:**
- Python 3.8+
- biopython (sequence processing)
- pandas, numpy (data analysis)
- requests (API calls)

**Optional (enhanced features):**
- NetMHCpan 4.1 local installation (improved performance)
- samtools (VCF processing)
- matplotlib, seaborn (visualization)

## Example Usage

See `## Usage` above for related details.

```bash
cd "20260318/scientific-skills/Data Analytics/neoantigen-predictor"
python -m py_compile scripts/main.py
python scripts/main.py --help
```

Example run plan:
1. Confirm the user input, output path, and any required config values.
2. Edit the in-file `CONFIG` block or documented parameters if the script uses fixed settings.
3. Run `python scripts/main.py` with the validated inputs.
4. Review the generated output and return the final artifact with any assumptions called out.

## Implementation Details

See `## Workflow` above for related details.

- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.
- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.
- Primary implementation surface: `scripts/main.py`.
- Reference guidance: `references/` contains supporting rules, prompts, or checklists.
- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.
- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.

## Quick Check

Use this command to verify that the packaged script entry point can be parsed before deeper execution.

```bash
python -m py_compile scripts/main.py
```

## Audit-Ready Commands

Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.

```bash
python -m py_compile scripts/main.py
python scripts/main.py --help
```

## Workflow

1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
2. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.

## Function Overview

Neoantigens are variant peptides generated by non-synonymous mutations in tumor cells, which can be presented by the patient's own HLA molecules and recognized by T cells. This tool integrates the following analysis workflows:

1. **Mutant Peptide Generation** - Extract 8-11mer variant peptides from mutation sites
2. **HLA Binding Prediction** - Predict peptide binding affinity to patient HLA molecules
3. **Immunogenicity Assessment** - Assess potential to elicit immune response
4. **Priority Ranking** - Comprehensive scoring to screen optimal neoantigen candidates

## Input Format

### HLA Typing Input

| Format | Example | Description |
|------|------|------|
| **Standard Nomenclature** | `HLA-A*02:01` | WHO standard HLA nomenclature |
| **Simplified Nomenclature** | `A0201` | Omit HLA- and *|: |
| **Multi-alleles** | `HLA-A*02:01,A*11:01,B*07:02` | Multiple alleles separated by commas |

### Mutation Data Input

**VCF Format Example:**
```
#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO
chr17	7579472	.	G	A	100	PASS	GENE=TP53;AA=p.R273H
chr13	32915005	.	C	T	100	PASS	GENE=BRCA2;AA=p.S1172L
```

**Table Format:**
| Gene | Chrom | Position | Ref | Alt | Protein_Change |
|------|-------|----------|-----|-----|----------------|
| TP53 | chr17 | 7579472 | G | A | p.R273H |
| BRCA2 | chr13 | 32915005 | C | T | p.S1172L |

**FASTA Format (Variant Peptides):**
```
>TP53_R273H_mut
GSDLWPGYFSH
>TP53_R273H_wt
GSDLWPGYFSP
```

## Usage

### Python API

```python
from scripts.main import NeoantigenPredictor

# Initialize predictor
predictor = NeoantigenPredictor()

# Set patient HLA typing
hla_alleles = ["HLA-A*02:01", "HLA-A*11:01", "HLA-B*07:02"]

# Define mutation data
mutations = [
    {
        "gene": "TP53",
        "chrom": "chr17",
        "pos": 7579472,
        "ref": "G",
        "alt": "A",
        "protein_change": "p.R273H"
    }
]

# Predict neoantigens
results = predictor.predict(
    hla_alleles=hla_alleles,
    mutations=mutations,
    peptide_length=[9, 10],  # 9-10mer peptides
    mhc_method="netmhcpan"   # Use NetMHCpan prediction
)

# Get high-affinity neoantigens
high_affinity = predictor.filter_by_binding(results, rank_threshold=0.5)
```

### Command Line Usage

```text

# Basic prediction
python scripts/main.py \
  --hla "HLA-A*02:01,HLA-A*11:01,B*07:02" \
  --vcf mutations.vcf \
  --output neoantigen_results.json

# Use table format input
python scripts/main.py \
  --hla-file hla_genotype.txt \
  --mutations mutations.csv \
  --peptide-length 9,10,11 \
  --rank-cutoff 0.5 \
  --output results.json

# Predict HLA binding for existing variant peptides
python scripts/main.py \
  --hla "A*02:01" \
  --variant-peptides peptides.fasta \
  --wildtype-peptides wt_peptides.fasta \
  --output binding_predictions.csv
```

## Output Format

```json
{
  "patient_hla": ["HLA-A*02:01", "HLA-A*11:01", "HLA-B*07:02"],
  "prediction_method": "NetMHCpan 4.1",
  "total_predictions": 156,
  "strong_binders": 12,
  "neoantigens": [
    {
      "rank": 1,
      "mutation_id": "TP53_R273H",
      "gene": "TP53",
      "chromosome": "chr17",
      "position": 7579472,
      "ref_aa": "R",
      "alt_aa": "H",
      "hla_allele": "HLA-A*02:01",
      "peptide_sequence": "S DDLWPGYFSH",
      "peptide_length": 9,
      "mutant_position": 9,
      "mhc_binding": {
        "rank_percentile": 0.12,
        "affinity_nM": 34.5,
        "binding_level": "Strong",
        "core_peptide": "DLWPGYFSH",
        "anchor_residues": [2, 9]
      },
      "immunogenicity": {
        "foreignness_score": 0.87,
        "self_similarity": 0.23,
        "amino_acid_change": "R->H",
        "anchor_mutation": true,
        "hydrophobicity_change": -0.45
      },
      "priority_score": 0.92,
      "clinical_relevance": {
        "variant_allele_frequency": 0.42,
        "expression_level": "High",
        "clonality": "Clonal"
      }
    }
  ],
  "summary": {
    "top_candidates": 5,
    "binding_distribution": {
      "strong": 12,
      "weak": 44,
      "non_binder": 100
    }
  }
}
```

## Scoring Algorithms

### MHC Binding Affinity Prediction

Using **NetMHCpan 4.1** algorithm to predict peptide binding to HLA molecules:

| Metric | Description | Threshold |
|------|------|------|
| **Rank %** | Binding rank percentile compared to natural ligand library | <0.5% = Strong, <2% = Weak |
| **IC50 (nM)** | Half-maximal inhibitory concentration | <50nM = High, <500nM = Intermediate |
| **Binding Level** | Comprehensive binding strength classification | Strong/Weak/Non-binder |

### Immunogenicity Score

```
Immunogenicity Score = Σ(wi × fi)

Components:
1. Foreignness Score (w=0.30): Difference from wild-type protein
2. Anchor Mutation (w=0.25): Whether mutation is at HLA binding anchor position
3. Self-similarity (w=0.20): Similarity to self-antigen pool (lower is better)
4. Hydrophobicity Change (w=0.15): Magnitude of hydrophobicity change
5. Clonality (w=0.10): Tumor clonality (clonal mutation > subclonal)
```

### Priority Score

```python
priority_score = (
    binding_weight × (1 - rank_percentile) +
    immunogenicity_weight × immunogenicity_score +
    clinical_weight × clinical_score
)

# Weight configuration
weights = {
    'mhc_binding': 0.40,      # MHC binding affinity
    'immunogenicity': 0.35,   # Immunogenicity
    'clinical': 0.25          # Clinical relevance (expression, clonality)
}
```

## HLA Support List

### MHC Class I Molecules
- **HLA-A**: A*01:01, A*02:01, A*02:03, A*02:06, A*03:01, A*11:01, A*23:01, A*24:02, A*26:01, A*30:01, A*30:02, A*31:01, A*32:01, A*33:01, A*68:01, A*68:02
- **HLA-B**: B*07:02, B*08:01, B*15:01, B*27:05, B*35:01, B*40:01, B*44:02, B*44:03, B*51:01, B*53:01, B*57:01, B*58:01
- **HLA-C**: C*03:03, C*04:01, C*05:01, C*06:02, C*07:01, C*07:02, C*08:02, C*12:03, C*14:02, C*15:02

### Mouse MHC (for preclinical research)
- H2-Db, H2-Kb, H2-Kd, H2-Ld

## Technical Difficulty: **HIGH**

⚠️ **AI Autonomous Acceptance Status**: Manual review required

This skill involves complex immunoinformatics calculations:
- MHC binding prediction algorithms (NetMHCpan neural network)
- Peptide sequence processing and variant positioning
- Multi-dimensional immunogenicity assessment
- Large-scale parallel computing optimization
- Tumor genomics data integration

## Data Dependencies

| Data Source | Type | Purpose |
|--------|------|------|
| **NetMHCpan 4.1** | MHC binding prediction | Core prediction algorithm |
| **Ensembl/GENCODE** | Genome annotation | Transcript sequence extraction |
| **UniProt** | Protein sequences | Wild-type reference sequences |
| **IEDB** | Immune epitope data | Immunogenicity assessment reference |
| **TCGA** | Tumor mutation data | Mutation signature analysis |

## Algorithm Limitations

- MHC binding prediction accuracy: ~85% (Rank < 0.5 threshold)
- Immunogenicity prediction requires experimental validation, correlation ~60-70%
- Does not consider HLA molecule expression levels on cell surface
- Cannot predict immune tolerance or suppressive T cell responses
- Uncertainty in the correlation between neoantigen generation and T cell response

## Clinical Application Notes

⚠️ **Important Notice**: This tool is for research purposes only; prediction results should not be the sole basis for clinical decisions.

- All candidate neoantigens require experimental validation (e.g., ELISPOT, tetramer staining)
- Consider patient's own immune status and treatment history
- Assess potential autoimmune toxicity risks
- Combine with tumor microenvironment immune infiltration status

## References

See `references/` directory:
- NetMHCpan 4.1 algorithm paper (Reynisson et al., 2020)
- Neoantigen prediction best practice guidelines
- Tumor immunotherapy clinical trial design references
- Immunopeptidomics databases

## Core Implementation

Core script: `scripts/main.py`

Key functions:
- `extract_variant_peptides()` - Extract variant peptides from mutation sites
- `predict_mhc_binding()` - MHC binding affinity prediction
- `calculate_foreignness()` - Foreignness/self-similarity assessment
- `score_immunogenicity()` - Comprehensive immunogenicity scoring
- `rank_candidates()` - Multi-criteria candidate ranking

## Validation Status

- **Unit Test Coverage**: 78%
- **Benchmark Validation**: Prediction consistency with published neoantigen datasets
- **Status**: ⏳ Requires experimental validation - Prediction results require in vitro/in vivo validation

## Risk Assessment

| Risk Indicator | Assessment | Level |
|----------------|------------|-------|
| Code Execution | Python scripts with tools | High |
| Network Access | External API calls | High |
| File System Access | Read/write data | Medium |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | Data handled securely | Medium |

## Security Checklist

- [ ] No hardcoded credentials or API keys
- [ ] No unauthorized file system access (../)
- [ ] Output does not expose sensitive information
- [ ] Prompt injection protections in place
- [ ] API requests use HTTPS only
- [ ] Input validated against allowed patterns
- [ ] API timeout and retry mechanisms implemented
- [ ] Output directory restricted to workspace
- [ ] Script execution in sandboxed environment
- [ ] Error messages sanitized (no internal paths exposed)
- [ ] Dependencies audited
- [ ] No exposure of internal service architecture

## Prerequisites

```text

# Python dependencies
pip install -r requirements.txt
```

## Evaluation Criteria

### Success Metrics
- [ ] Successfully executes main functionality
- [ ] Output meets quality standards
- [ ] Handles edge cases gracefully
- [ ] Performance is acceptable

### Test Cases
1. **Basic Functionality**: Standard input → Expected output
2. **Edge Case**: Invalid input → Graceful error handling
3. **Performance**: Large dataset → Acceptable processing time

## Lifecycle Status

- **Current Stage**: Draft
- **Next Review Date**: 2026-03-06
- **Known Issues**: None
- **Planned Improvements**: 
  - Performance optimization
  - Additional feature support

## Output Requirements

Every final response should make these items explicit when they are relevant:

- Objective or requested deliverable
- Inputs used and assumptions introduced
- Workflow or decision path
- Core result, recommendation, or artifact
- Constraints, risks, caveats, or validation needs
- Unresolved items and next-step checks

## Error Handling

- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
- If `scripts/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.
- Do not fabricate files, citations, data, search results, or execution outcomes.

## Input Validation

This skill accepts requests that match the documented purpose of `neoantigen-predictor` and include enough context to complete the workflow safely.

Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:

> `neoantigen-predictor` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.

## Response Template

Use the following fixed structure for non-trivial requests:

1. Objective
2. Inputs Received
3. Assumptions
4. Workflow
5. Deliverable
6. Risks and Limits
7. Next Checks

If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.

Related Skills

lab-inventory-predictor

53
from aipoch/medical-research-skills

Predict depletion time of critical lab reagents based on historical usage frequency, and automatically generate purchase alerts when stock falls below safety thresholds.

blockbuster-therapy-predictor

53
from aipoch/medical-research-skills

Comprehensive analytics tool for forecasting breakthrough therapeutic technologies by integrating multi-dimensional data sources including clinical development pipelines, intellectual property landscapes, and capital mar.

variant-pathogenicity-predictor

53
from aipoch/medical-research-skills

Integrate REVEL, CADD, PolyPhen scores to predict variant pathogenicity.

adme-property-predictor

53
from aipoch/medical-research-skills

Analyze data with `adme-property-predictor` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.

treatment-response-predictor-planner

53
from aipoch/medical-research-skills

Designs studies for predicting treatment response or resistance in biomedical and clinical research. Always use this skill when the user needs a treatment-response or resistance prediction study blueprint rather than a prognostic biomarker protocol, diagnostic test design, causal treatment-effect estimation, or a completed manuscript. Focus on responder definition, treatment context, baseline comparability, feature integration strategy, model development logic, validation architecture, and interpretation boundaries. Do not invent response rates, cohort size, assay readiness, regimen uniformity, literature support, or validation access.

skill-auditor

53
from aipoch/medical-research-skills

A comprehensive auditor for any agent skill — including Manus, OpenClaw/ClawHub, Claude, LobeHub, or custom SKILL.md-based skills. Use this skill whenever a user wants to evaluate, audit, review, score, or quality-check an agent skill before publishing, updating, or deploying. Covers two hard veto gates (structural redlines + research integrity redlines), static quality scoring across 25 criteria (ISO 25010 + OpenSSF + Agent), dynamic test input generation, multi-mode execution testing, multi-layer output evaluation with five specialized category rubrics (Evidence Insight / Protocol Design / Data Analysis / Academic Writing / Other), a Research Veto that applies to all four research categories, human eval viewer generation, actionable P0/P1/P2 optimization recommendations, and automatic skill improvement that outputs a polished, production-ready SKILL.md. Also use whenever a user says "audit my skill", "evaluate my skill", "improve my skill", or wants a corrected version after evaluation.

two-sample-mr-research-planner

53
from aipoch/medical-research-skills

Generates complete two-sample Mendelian randomization (MR) research designs from a user-provided research direction. Use when users want to design, plan, or build a study using two-sample MR to test causal relationships. Triggers:"design a two-sample MR study", "build a publishable MR paper", "test whether this biomarker causally affects this disease", "generate Lite/Standard/Advanced MR plans", "screen multiple exposures with MR", "bidirectional MR design", "causal inference using GWAS summary statistics", or "I want to study X and Y using MR". Always outputs four workload configurations (Lite / Standard / Advanced / Publication+) with a recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, and publication upgrade path.

research-proposal-generator

53
from aipoch/medical-research-skills

Generates a comprehensive research proposal design based on input literature, including hypothesis, mechanism verification, and budget. Use when the user wants to design a research project from a paper.

research-grants

53
from aipoch/medical-research-skills

Write competitive research proposals for NSF, NIH, DOE, DARPA, and Taiwan's NSTC when you need agency-compliant narratives, budgets, and review-criteria alignment for a specific solicitation/FOA/BAA.

protocol-standardization

53
from aipoch/medical-research-skills

Standardize fragmented experimental steps into reproducible protocol documents when you need method organization, lab SOP drafting, or cross-operator reproducibility; missing parameters must be explicitly marked as "To be supplemented/Not provided".

prospero-registration-helper

53
from aipoch/medical-research-skills

Assists researchers in generating PROSPERO registration content for meta-analyses from a title and optional protocol. Use when the user wants to draft a PROSPERO registration form.

non-tumor-ml-research-planner

53
from aipoch/medical-research-skills

Generates complete non-tumor biomedical machine learning research designs from a user-provided research direction. Always use this skill when users want to plan bioinformatics + ML papers for non-cancer diseases (metabolic, cardiovascular, kidney, inflammatory, autoimmune, infectious, neurological, endocrine, wound healing, chronic multifactor), design diagnostic biomarker studies, combine GEO datasets with feature selection and ML modeling, or generate Lite/Standard/Advanced/Publication+ workload plans. Trigger for:"non-tumor ML study", "bioinformatics paper outside oncology", "key genes and diagnostic model for a disease", "pyroptosis/ferroptosis/senescence/autophagy + disease", "GEO datasets + machine learning", "RF + LASSO diagnostic model", "DEG + feature selection + validation", "immune infiltration + biomarker", "non-cancer biomarker paper". Trigger even for casual phrasings like "I want to study X using machine learning", "help me design a non-tumor bioinformatics paper", or "how do I build a diagnostic model for disease Y".