compare_protective_risk
Compare protective and risk alleles side-by-side to analyze opposite disease associations for mechanism studies and therapeutic target identification.
Instructions
Compare protective vs risk alleles directly.
Side-by-side comparison of alleles with opposite disease associations.
Perfect for: disease mechanism studies, therapeutic target identification.
Example: "Compare APOE protective allele vs risk allele"
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| protective_variant | Yes | ||
| risk_variant | Yes |
Implementation Reference
- src/tools.ts:473-508 (schema)Defines the Tool object for 'compare_protective_risk' including name, description, and input schema requiring protective_variant and risk_variant objects.export const COMPARE_PROTECTIVE_RISK_TOOL: Tool = { name: 'compare_protective_risk', description: `Compare protective vs risk alleles directly. Side-by-side comparison of alleles with opposite disease associations. Perfect for: disease mechanism studies, therapeutic target identification. Example: "Compare APOE protective allele vs risk allele"`, inputSchema: { type: 'object', properties: { protective_variant: { type: 'object', properties: { chromosome: { type: 'string', pattern: '^chr([1-9]|1[0-9]|2[0-2]|X|Y)$' }, position: { type: 'number', minimum: 1 }, ref: { type: 'string', pattern: '^[ATGCatgc]+$' }, alt: { type: 'string', pattern: '^[ATGCatgc]+$' }, }, required: ['chromosome', 'position', 'ref', 'alt'], }, risk_variant: { type: 'object', properties: { chromosome: { type: 'string', pattern: '^chr([1-9]|1[0-9]|2[0-2]|X|Y)$' }, position: { type: 'number', minimum: 1 }, ref: { type: 'string', pattern: '^[ATGCatgc]+$' }, alt: { type: 'string', pattern: '^[ATGCatgc]+$' }, }, required: ['chromosome', 'position', 'ref', 'alt'], }, }, required: ['protective_variant', 'risk_variant'], }, };
- src/tools.ts:709-730 (registration)Registers COMPARE_PROTECTIVE_RISK_TOOL in the ALL_TOOLS array used by the MCP listTools handler.export const ALL_TOOLS: Tool[] = [ PREDICT_VARIANT_TOOL, BATCH_SCORE_TOOL, ASSESS_PATHOGENICITY_TOOL, PREDICT_TISSUE_SPECIFIC_TOOL, COMPARE_VARIANTS_TOOL, PREDICT_SPLICE_IMPACT_TOOL, PREDICT_EXPRESSION_IMPACT_TOOL, ANALYZE_GWAS_LOCUS_TOOL, COMPARE_ALLELES_TOOL, BATCH_TISSUE_COMPARISON_TOOL, PREDICT_TF_BINDING_IMPACT_TOOL, PREDICT_CHROMATIN_IMPACT_TOOL, COMPARE_PROTECTIVE_RISK_TOOL, BATCH_PATHOGENICITY_FILTER_TOOL, COMPARE_VARIANTS_SAME_GENE_TOOL, PREDICT_ALLELE_SPECIFIC_EFFECTS_TOOL, ANNOTATE_REGULATORY_CONTEXT_TOOL, BATCH_MODALITY_SCREEN_TOOL, GENERATE_VARIANT_REPORT_TOOL, EXPLAIN_VARIANT_IMPACT_TOOL, ];
- src/index.ts:221-226 (handler)MCP server request handler for 'compare_protective_risk' tool call, invokes AlphaGenomeClient and returns JSON-formatted result.case 'compare_protective_risk': { const result = await getClient().compareProtectiveRisk(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
- src/alphagenome-client.ts:376-383 (helper)AlphaGenomeClient method that forwards compare_protective_risk parameters to the Python bridge via callPythonBridge.async compareProtectiveRisk(params: any): Promise<any> { try { return await this.callPythonBridge('compare_protective_risk', params); } catch (error) { if (error instanceof ApiError) throw error; throw new ApiError(`Protective vs risk comparison failed: ${error}`, 500); } }
- scripts/alphagenome_bridge.py:505-525 (handler)Core handler function in Python bridge that implements the tool logic by predicting variant effects for protective and risk variants and returning a comparison dictionary.def compare_protective_risk(client, params: Dict[str, Any]) -> Dict[str, Any]: """Compare protective vs risk alleles.""" protective = params.get('protective_variant') risk = params.get('risk_variant') result_protective = predict_variant_effect(client, protective) result_risk = predict_variant_effect(client, risk) return { 'protective': { 'variant': result_protective['variant'], 'impact': result_protective['interpretation']['impact_level'], 'expression_fc': result_protective['predictions'].get('rna_seq', {}).get('fold_change', 0) }, 'risk': { 'variant': result_risk['variant'], 'impact': result_risk['interpretation']['impact_level'], 'expression_fc': result_risk['predictions'].get('rna_seq', {}).get('fold_change', 0) } }