-
Notifications
You must be signed in to change notification settings - Fork 0
Claude Analyzes PADS
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.
With the following response,
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
I loaded the analyze_pad_card prompt from the MCP server.
(click the following icon to load),
Running it requests the card/project data,
This results in the following response (confirming that it will retrieve and use the ontology),
Responding with yes yields,
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?
""")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.