scientific-skills/Data Analysis/neoantigen-predictor/SKILL.md
Predict neoantigens that may be recognized by the immune system based.
npx skillsauth add aipoch/medical-research-skills neoantigen-predictorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Predicts patient-specific neoantigen candidate peptides with high immunogenicity based on HLA typing and tumor mutation profiles, providing target screening for tumor immunotherapy.
scripts/main.py.references/ for task-specific guidance.Required:
Optional (enhanced features):
See ## Usage above for related details.
cd "20260318/scientific-skills/Data Analytics/neoantigen-predictor"
python -m py_compile scripts/main.py
python scripts/main.py --help
Example run plan:
CONFIG block or documented parameters if the script uses fixed settings.python scripts/main.py with the validated inputs.See ## Workflow above for related details.
scripts/main.py.references/ contains supporting rules, prompts, or checklists.Use this command to verify that the packaged script entry point can be parsed before deeper execution.
python -m py_compile scripts/main.py
Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
python -m py_compile scripts/main.py
python scripts/main.py --help
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:
| 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 |
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
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)
# 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
{
"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
}
}
}
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 = Σ(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 = (
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)
}
⚠️ AI Autonomous Acceptance Status: Manual review required
This skill involves complex immunoinformatics calculations:
| 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 |
⚠️ Important Notice: This tool is for research purposes only; prediction results should not be the sole basis for clinical decisions.
See references/ directory:
Core script: scripts/main.py
Key functions:
extract_variant_peptides() - Extract variant peptides from mutation sitespredict_mhc_binding() - MHC binding affinity predictioncalculate_foreignness() - Foreignness/self-similarity assessmentscore_immunogenicity() - Comprehensive immunogenicity scoringrank_candidates() - Multi-criteria candidate ranking| 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 |
# Python dependencies
pip install -r requirements.txt
Every final response should make these items explicit when they are relevant:
scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.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-predictoronly handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
Use the following fixed structure for non-trivial requests:
If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
tools
Generates complete conventional oncology bulk-transcriptome biomarker and hub-gene research designs from a user-provided cancer type and study direction. Always use this skill whenever a user wants to design, plan, or build a tumor bioinformatics study centered on differential expression, prognostic filtering or risk modeling, PPI-based hub-gene prioritization, diagnostic/prognostic evaluation, clinical association, immune infiltration context, methylation context, and optional tissue or cell validation. Covers five study patterns (signature-first prognostic workflow, hub-gene-first biomarker workflow, hybrid signature-to-hub workflow, immune-context biomarker workflow, translational validation workflow) and always outputs four workload configs (Lite / Standard / Advanced / Publication+) with recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, publication upgrade path...
development
Generates complete conventional non-oncology bioinformatics research designs from a user-provided disease context, process-related gene family or biological theme, and validation direction. Use when a study centers on multi-dataset bulk transcriptome integration, DEG analysis, process-gene intersection, enrichment analysis, GSEA, PPI hub-gene prioritization, TF/miRNA regulatory networks, ROC-based biomarker evaluation, and immune infiltration analysis. Covers five study patterns (process-DEG discovery, enrichment/GSEA interpretation, hub-gene prioritization, regulatory-network and immune interpretation, multi-layer public validation) and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.
tools
Plans confounder control, variable adjustment logic, and bias mitigation strategies at the protocol stage for clinical, epidemiologic, translational, observational, and biomarker studies. Always use this skill when a user needs to identify major confounders, decide which variables should or should not be adjusted for, compare matching/stratification/weighting approaches, anticipate selection or measurement bias, or pressure-test a study design before execution. Focus on bias sensing, causal structure awareness, variable-role classification, and critical design review rather than generic statistical advice.
testing
Generates complete comparative network-toxicology research designs from a user-provided exposure pair, shared toxic phenotype, and validation direction. Use when a study centers on two related exposures under one outcome and needs target collection, shared-vs-specific target decomposition, enrichment, PPI hub prioritization, docking, optional transcriptomic cross-checks, and conservative mechanistic synthesis. Covers five study patterns and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.