{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-data-analysis-western-blot-quantifier-ce75bb775214","title":"Western Blot Quantifier for Densitometric Analysis","summary":"Automatically identify Western Blot gel bands, perform densitometric analysis, and calculate normalized values relative to loading controls. Generate CSV output for quantitative results.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-western-blot-quantifier-ce75bb775214","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-western-blot-quantifier-ce75bb775214","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-western-blot-quantifier-ce75bb775214.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-western-blot-quantifier-ce75bb775214\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"Ensure Python dependencies are installed using `pip install -r requirements.txt` before running the script. Edit the in-file `CONFIG` block or use command-line parameters to specify input image path, reference bands, target bands, lane positions, and detection threshold.","instructions":"---\nname: western-blot-quantifier\ndescription: Automatically identify Western Blot gel bands, perform densitometric analysis, and calculate normalized values relative to loading controls.\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n# Western Blot Quantifier\n\nAutomatically identify Western Blot gel bands, perform densitometric analysis, and calculate normalized values relative to loading controls.\n\n## When to Use\n\n- Use this skill when the task needs Automatically identify Western Blot gel bands, perform densitometric analysis, and calculate normalized values relative to loading controls.\n- Use this skill for data analysis tasks that require explicit assumptions, bounded scope, and a reproducible output format.\n- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.\n\n## Key Features\n\nSee `## Features` above for related details.\n\n- Scope-focused workflow aligned to: Automatically identify Western Blot gel bands, perform densitometric analysis, and calculate normalized values relative to loading controls.\n- Packaged executable path(s): `scripts\/__init__.py` plus 1 additional script(s).\n- Structured execution path designed to keep outputs consistent and reviewable.\n\n## Dependencies\n\n```\nnumpy>=1.21.0\nopencv-python>=4.5.0\npandas>=1.3.0\nmatplotlib>=3.4.0\nscipy>=1.7.0\nscikit-image>=0.18.0\n```\n\n## Example Usage\n\nSee `## Usage` above for related details.\n\n```bash\ncd \"20260318\/scientific-skills\/Data Analytics\/western-blot-quantifier\"\npython -m py_compile scripts\/main.py\npython scripts\/main.py --help\n```\n\nExample run plan:\n1. Confirm the user input, output path, and any required config values.\n2. Edit the in-file `CONFIG` block or documented parameters if the script uses fixed settings.\n3. Run `python scripts\/main.py` with the validated inputs.\n4. Review the generated output and return the final artifact with any assumptions called out.\n\n## Implementation Details\n\nSee `## Workflow` above for related details.\n\n- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.\n- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.\n- Primary implementation surface: `scripts\/__init__.py` with additional helper scripts under `scripts\/`.\n- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.\n- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.\n\n## Quick Check\n\nUse this command to verify that the packaged script entry point can be parsed before deeper execution.\n\n```bash\npython -m py_compile scripts\/main.py\n```\n\n## Audit-Ready Commands\n\nUse these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.\n\n```bash\npython -m py_compile scripts\/main.py\npython scripts\/main.py --help\n```\n\n## Workflow\n\n1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.\n2. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.\n3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.\n4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.\n5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.\n\n## Features\n\n- **Automatic Band Detection**: Detect protein band positions in gel images\n- **Densitometric Analysis**: Calculate grayscale\/optical density values for each band\n- **Normalization**: Normalize relative to loading control proteins (e.g., GAPDH, \u03b2-actin, Tubulin)\n- **Data Export**: Output quantitative results in CSV format\n\n## Usage\n\n### Basic Usage\n\n```python\n\n# Call in Python\nfrom skills.western_blot_quantifier.scripts.main import WesternBlotQuantifier\n\n# Create analyzer\nanalyzer = WesternBlotQuantifier()\n\n# Analyze single image\nresult = analyzer.analyze(\n    image_path=\"path\/to\/wb_image.png\",\n    reference_bands=[\"GAPDH\"],  # Loading control band names\n    target_bands=[\"p53\", \"Bcl-2\"],  # Target protein band names\n    lane_positions=[0.2, 0.4, 0.6, 0.8]  # Lane positions (relative to image width)\n)\n\nprint(result.summary())\nresult.save(\"output\/quantification_results.csv\")\n```\n\n### Command Line Usage\n\n```text\npython -m skills.western_blot_quantifier.scripts.main \\\n    --input path\/to\/wb_image.png \\\n    --reference GAPDH \\\n    --targets p53,Bcl-2 \\\n    --lanes 4 \\\n    --output results.csv\n```\n\n## Parameter Description\n\n| Parameter | Description | Default |\n|------|------|--------|\n| `image_path` | Gel image path | Required |\n| `reference_bands` | Loading control protein name list | [\"GAPDH\"] |\n| `target_bands` | Target protein name list | [] |\n| `lane_positions` | Lane position list | Auto-detect |\n| `threshold` | Band detection threshold | 0.1 |\n| `background_correction` | Background correction method | \"rolling_ball\" |\n\n## Output Format\n\n### CSV Output Example\n\n```csv\nLane,Protein,Raw_Intensity,Background,Corrected_Intensity,Normalized_to_Reference\n1,GAPDH,125000.5,5000.2,120000.3,1.00\n1,p53,85000.2,3000.1,82000.1,0.68\n1,Bcl-2,62000.8,2500.5,59500.3,0.50\n2,GAPDH,118000.3,4800.2,113200.1,1.00\n...\n```\n\n### Return Object\n\n```python\n{\n    \"raw_data\": DataFrame,           # Raw optical density data\n    \"normalized_data\": DataFrame,    # Normalized data\n    \"band_regions\": List[Dict],      # Detected band region coordinates\n    \"statistics\": Dict,              # Statistical analysis results\n    \"figures\": Dict                  # Visualization chart paths\n}\n```\n\n## Installation\n\n```text\npip install -r requirements.txt\n```\n\n## Notes\n\n1. **Image Quality**: High resolution, good contrast grayscale or black and white gel images are recommended\n2. **Loading Control Selection**: Common loading controls include GAPDH, \u03b2-actin, Tubulin; selection depends on experimental conditions\n3. **Background Correction**: Supports rolling_ball, median, none three background correction methods\n4. **Lane Marking**: If auto-detection is inaccurate, lane positions can be manually specified\n\n## Examples\n\n### Example 1: Basic Analysis\n\n```python\nfrom skills.western_blot_quantifier.scripts.main import WesternBlotQuantifier\n\nanalyzer = WesternBlotQuantifier()\n\n# Analyze 4-lane Western Blot results\nresult = analyzer.analyze(\n    image_path=\"experiment_data\/wb_gel.png\",\n    reference_bands=[\"GAPDH\"],\n    target_bands=[\"p53\", \"p21\"],\n    lane_count=4\n)\n\n# View normalized results\nprint(result.normalized_data)\n\n# Save charts\nresult.save_figures(\"output\/\")\n```\n\n### Example 2: Batch Processing\n\n```python\nimport glob\n\nanalyzer = WesternBlotQuantifier()\n\nfor image_path in glob.glob(\"experiments\/*.png\"):\n    result = analyzer.analyze(\n        image_path=image_path,\n        reference_bands=[\"\u03b2-actin\"],\n        target_bands=[\"Target_Protein\"],\n        lane_count=6\n    )\n    result.save(f\"output\/{Path(image_path).stem}_results.csv\")\n```\n\n## Algorithm Description\n\n1. **Image Preprocessing**: Grayscale conversion \u2192 Background correction \u2192 Denoising\n2. **Lane Detection**: Automatic lane boundary identification based on vertical projection analysis\n3. **Band Detection**: Band localization using 1D Gaussian fitting or peak detection algorithms\n4. **Optical Density Calculation**: Integrate grayscale values in band region, subtract background\n5. **Normalization**: Target protein value \/ Loading control protein value\n\n## Author\n\nOpenClaw Skills\n\n## Risk Assessment\n\n| Risk Indicator | Assessment | Level |\n|----------------|------------|-------|\n| Code Execution | Python\/R scripts executed locally | Medium |\n| Network Access | No external API calls | Low |\n| File System Access | Read input files, write output files | Medium |\n| Instruction Tampering | Standard prompt guidelines | Low |\n| Data Exposure | Output files saved to workspace | Low |\n\n## Security Checklist\n\n- [ ] No hardcoded credentials or API keys\n- [ ] No unauthorized file system access (..\/)\n- [ ] Output does not expose sensitive information\n- [ ] Prompt injection protections in place\n- [ ] Input file paths validated (no ..\/ traversal)\n- [ ] Output directory restricted to workspace\n- [ ] Script execution in sandboxed environment\n- [ ] Error messages sanitized (no stack traces exposed)\n- [ ] Dependencies audited\n\n## Prerequisites\n\n```text\n\n# Python dependencies\npip install -r requirements.txt\n```\n\n## Evaluation Criteria\n\n### Success Metrics\n- [ ] Successfully executes main functionality\n- [ ] Output meets quality standards\n- [ ] Handles edge cases gracefully\n- [ ] Performance is acceptable\n\n### Test Cases\n1. **Basic Functionality**: Standard input \u2192 Expected output\n2. **Edge Case**: Invalid input \u2192 Graceful error handling\n3. **Performance**: Large dataset \u2192 Acceptable processing time\n\n## Lifecycle Status\n\n- **Current Stage**: Draft\n- **Next Review Date**: 2026-03-06\n- **Known Issues**: None\n- **Planned Improvements**: \n  - Performance optimization\n  - Additional feature support\n\n## Output Requirements\n\nEvery final response should make these items explicit when they are relevant:\n\n- Objective or requested deliverable\n- Inputs used and assumptions introduced\n- Workflow or decision path\n- Core result, recommendation, or artifact\n- Constraints, risks, caveats, or validation needs\n- Unresolved items and next-step checks\n\n## Error Handling\n\n- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.\n- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.\n- If `scripts\/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.\n- Do not fabricate files, citations, data, search results, or execution outcomes.\n\n## Input Validation\n\nThis skill accepts requests that match the documented purpose of `western-blot-quantifier` and include enough context to complete the workflow safely.\n\nDo not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:\n\n> `western-blot-quantifier` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.\n\n## Response Template\n\nUse the following fixed structure for non-trivial requests:\n\n1. Objective\n2. Inputs Received\n3. Assumptions\n4. Workflow\n5. Deliverable\n6. Risks and Limits\n7. Next Checks\n\nIf the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.\n","use_cases":["Quantify protein expression levels in Western Blot images","Normalize band intensities relative to loading controls","Generate reproducible densitometric analysis reports"],"limitations":[],"compatibility":[],"setup_tip":"```text\npip install -r requirements.txt\n```","sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/aipoch\/medical-research-skills\/blob\/686e09dfdb45d9fa1a08664f06bb93769b3c9d91\/scientific-skills\/Data%20Analysis\/western-blot-quantifier\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-24","created_at":"2026-11-23T13:11:20.000000Z","updated_at":"2026-11-24T12:17:28.000000Z","seo_title":"Western Blot Quantifier for Densitometric Analysis","seo_description":"Automate Western Blot band detection, densitometric analysis, and normalization with loading controls. Generate CSV output for quantitative results.","seo_keywords":["Western Blot analysis","Densitometric quantification","Protein band normalization","Western Blot CSV output","Loading control normalization"]}}