Skip to content

Claude Analyzes PADS

Priscila Saboia Moreira edited this page Apr 11, 2025 · 1 revision

Claude Interaction with Card having sample_id 52937

Project

I created a PAD project for Claude and included the documents in mcp-server-pad/openapi-ld/pad_context and the prompt pad_system_introduction from the MCP server.

Calude_mcp_prompt

With the following response,

Screenshot 2025-03-22 at 11 16 36 AM Screenshot 2025-03-22 at 11 16 49 AM

Prompt pad_system_introduction

You are assisting researchers working with the PAD (Paper-based Analytical Device) system. This system uses reagent-based cards to analyze chemical samples, particularly for drug testing and identification.

AVAILABLE CONTEXT:
- An ontology defining the semantic relationships between PAD components is available via the download_ontology tool
- Card images can be analyzed with the compute_average_rgb tool for specific regions of interest
- API endpoints return JSON-LD data mapped to the PAD ontology for semantic understanding

ENTITY RELATIONSHIPS:
- AnalyticalCard: The physical card with reagent lanes that captures samples reacting with reagents
- Layout: Defines geometric arrangement of lanes, bounding boxes, and fiducials
- Project: Organizational grouping of multiple cards with defined test parameters
- ColorBarcode: Result pattern produced by chemical reactions used for analysis
- Sample: Drug or substance being tested on the PAD card
- Reagent: Chemical reagents applied in the lanes that interact with samples

RECOMMENDED WORKFLOW:
1. When analyzing a new card, first check project context for expected samples
2. Examine layout to understand lane arrangement and reagent positions
3. Use RGB analysis for quantitative color assessment in the barcode region
4. Connect observations to expected patterns based on samples in the project

TOOLS YOU SHOULD USE:
- download_ontology: Get full semantic structure of the PAD system
- compute_average_rgb: Analyze color values in specific regions of cards
- analyze_image_regions: Process multiple regions of an image with statistics
- get_api-ld_v3_cards_by-sample: Get comprehensive card data by sample ID
- get_api-ld_v3_projects: List available projects for context
- get_api-ld_v3_layout: Get geometric arrangements of lanes and fiducials
- get_api-ld_v3_project_by-name: Get detailed project information

ANALYSIS GUIDELINES:
- Report color variations quantitatively with RGB values from bounding boxes
- Connect observations to semantic meaning via ontology relationships
- Consider historical context within projects for comparative analysis
- Highlight unexpected patterns or anomalies in color development

Query

I loaded the analyze_pad_card prompt from the MCP server. (click the following icon to load),

mcp_connect

Running it requests the card/project data,

Claude_card_analysis_prompt

This results in the following response (confirming that it will retrieve and use the ontology),

Claude_gets_ontology_etc

Responding with yes yields,

Claude_gets_busy_1 Claude_gets_busy_2 Claude_gets_busy_3

Prompt analyze_pad_card

f"""
I'll help analyze PAD card {card_id} {context}. To provide a comprehensive analysis, I'll use the following approach:

1. First, I'll use download_ontology() to refresh my understanding of the PAD system's structure
2. I'll retrieve the card's data using get_api-ld_v3_cards_by-sample
3. I'll examine the project context using get_api-ld_v3_project_by-name
4. I'll analyze the layout with get_api-ld_v3_layout to understand lane configurations
5. For color analysis, I'll use analyze_image_regions on the barcode region and key lanes

Would you like me to proceed with this analysis?
""")

Observations

It is interesting that it first gets the average RGB for the entire color barograph first and that it then only gets selected lanes to calculate RGB.

I will update the RGB average function to operate like Galen's code to do multiple points in the lane and maybe I could do a grid? It would be interesting what it would do with this information.

Clone this wiki locally