|
| 1 | +--- |
| 2 | +name: wes-clinical-report-en |
| 3 | +description: >- |
| 4 | + Generates professional clinical PDF reports in English from WES (Whole Exome |
| 5 | + Sequencing) data with clinical interpretation summary, pharmacogenomic |
| 6 | + alerts, and follow-up recommendations. |
| 7 | +version: 1.0.0 |
| 8 | +author: Manuel Corpas |
| 9 | +license: PROPRIETARY |
| 10 | +tags: [WES, exome, clinical-report, english, pharmacogenomics, PDF, ANNOVAR] |
| 11 | +inputs: |
| 12 | + - name: WES markdown report |
| 13 | + format: markdown (.md) |
| 14 | + required: true |
| 15 | + description: Structured WES report with sections 1-7 (Exome Summary through Methods) |
| 16 | + - name: Logo left |
| 17 | + format: image (JPG/PNG) |
| 18 | + required: false |
| 19 | + description: Left institutional logo for cover and header |
| 20 | + - name: Logo right |
| 21 | + format: image (JPG/PNG) |
| 22 | + required: false |
| 23 | + description: Right institutional logo for cover and header |
| 24 | +outputs: |
| 25 | + - name: Clinical PDF report |
| 26 | + format: PDF (A4) |
| 27 | + description: Professional clinical report with interpretation, tables, and disclaimer |
| 28 | +metadata: |
| 29 | + openclaw: |
| 30 | + requires: |
| 31 | + bins: |
| 32 | + - python3 |
| 33 | + env: [] |
| 34 | + config: [] |
| 35 | + always: false |
| 36 | + emoji: "🧬" |
| 37 | + homepage: https://github.com/ClawBio/ClawBio |
| 38 | + os: [darwin, linux] |
| 39 | + min_python: "3.9" |
| 40 | + dependencies: |
| 41 | + - reportlab |
| 42 | + - pandas |
| 43 | + private: true |
| 44 | + install: [] |
| 45 | + trigger_keywords: |
| 46 | + - WES clinical report |
| 47 | + - exome PDF report english |
| 48 | + - clinical report english |
| 49 | + - Novogene report english |
| 50 | + - WES report PDF |
| 51 | +--- |
| 52 | + |
| 53 | +# WES Clinical Report (English) |
| 54 | + |
| 55 | +Skill for generating professional clinical PDF reports in English from |
| 56 | +whole exome sequencing (WES) data. Designed for Novogene WES data |
| 57 | +(GATK + ANNOVAR pipeline) but adaptable to any WES pipeline with |
| 58 | +equivalent annotations. |
| 59 | + |
| 60 | +## Trigger |
| 61 | + |
| 62 | +**Fire this skill when the user says any of:** |
| 63 | +- "generate WES clinical report in English" |
| 64 | +- "English exome PDF report" |
| 65 | +- "WES report PDF" |
| 66 | +- "clinical report from exome data" |
| 67 | +- "Novogene report English" |
| 68 | +- "exome clinical PDF" |
| 69 | + |
| 70 | +**Do NOT fire when:** |
| 71 | +- User asks for a Spanish report (use `wes-clinical-report-es`) |
| 72 | +- User asks for variant annotation only (use `variant-annotation`) |
| 73 | +- User asks for ACMG classification only (use `clinical-variant-reporter`) |
| 74 | + |
| 75 | +## Scope |
| 76 | + |
| 77 | +One skill, one task: convert WES markdown reports into professional |
| 78 | +English-language clinical PDFs with interpretation. |
| 79 | + |
| 80 | +## Workflow |
| 81 | + |
| 82 | +1. Parse WES markdown report (structured sections 1-7) |
| 83 | +2. Extract KPI metrics from Exome Summary |
| 84 | +3. Extract pathogenic variants, PGx alerts, rare damaging variants |
| 85 | +4. Build interpretive summary paragraph |
| 86 | +5. Render all sections as styled PDF with clinical tables |
| 87 | +6. Add ancestry estimation (section 8) if data available |
| 88 | +7. Add limitations section (section 9) |
| 89 | +8. Add disclaimer and report metadata |
| 90 | +9. Output PDF to specified directory |
| 91 | + |
| 92 | +## Capabilities |
| 93 | + |
| 94 | +1. **Clinical interpretation summary**: key findings, high-risk PGx alerts, |
| 95 | + prioritised rare variants, clinical follow-up recommendations. |
| 96 | +2. **Clinically significant variants**: ClinVar P/LP, ACMG SF v3.2, |
| 97 | + cancer predisposition panel, conflicting variants. |
| 98 | +3. **Pharmacogenomics**: CPIC star alleles, clinical effects, affected |
| 99 | + medications with contextualised high-risk alerts. |
| 100 | +4. **Fitness and nutrition traits**: genotypes with evidence grades |
| 101 | + (Corpas et al. 2021). |
| 102 | +5. **Rare damaging variant prioritisation**: REVEL, CADD, gnomAD AF. |
| 103 | +6. **Disease and pathway context**: OMIM, GWAS, COSMIC, KEGG. |
| 104 | +7. **Institutional logos**: configurable left/right logos on cover and header. |
| 105 | + |
| 106 | +## Example Output |
| 107 | + |
| 108 | +``` |
| 109 | +Page 1 (cover): |
| 110 | + [Logo Left] [Logo Right] |
| 111 | + +---------------------------------------------+ |
| 112 | + | Whole Exome Sequencing Report [SampleN] | |
| 113 | + | Platform / Reference / Date | |
| 114 | + +---------------------------------------------+ |
| 115 | + [KPIs: Total SNPs | Missense | Stopgain | Rare Damaging | ClinVar] |
| 116 | +
|
| 117 | + Results Interpretation |
| 118 | + (auto-generated clinical summary paragraph) |
| 119 | +
|
| 120 | +Pages 2+: |
| 121 | + 1. Exome Summary |
| 122 | + 2. Clinically Significant Variants |
| 123 | + 3. Pharmacogenomics |
| 124 | + 4. Fitness and Nutrition Traits |
| 125 | + 5. Prioritised Rare Damaging Variants |
| 126 | + 6. Disease and Pathway Context |
| 127 | + 7. Methods |
| 128 | + 8. Ancestry Estimation |
| 129 | + 9. Limitations |
| 130 | + [Disclaimer] |
| 131 | +``` |
| 132 | + |
| 133 | +## Usage |
| 134 | + |
| 135 | +```bash |
| 136 | +# Generate reports for all samples |
| 137 | +python skills/wes-clinical-report-en/wes_clinical_report_en.py \ |
| 138 | + --report-dir /path/to/REPORTS/ \ |
| 139 | + --output-dir /path/to/PDF-EN/ \ |
| 140 | + --logo-left /path/to/logo_left.jpg \ |
| 141 | + --logo-right /path/to/logo_right.jpg |
| 142 | + |
| 143 | +# Generate report for a single sample |
| 144 | +python skills/wes-clinical-report-en/wes_clinical_report_en.py \ |
| 145 | + --report-dir /path/to/REPORTS/ \ |
| 146 | + --output-dir /path/to/PDF-EN/ \ |
| 147 | + --samples Sample3 |
| 148 | + |
| 149 | +# Demo with default Novogene data |
| 150 | +python skills/wes-clinical-report-en/wes_clinical_report_en.py --demo |
| 151 | +``` |
| 152 | + |
| 153 | +## Input format |
| 154 | + |
| 155 | +The skill consumes WES reports in markdown format generated by the |
| 156 | +analysis pipeline (scripts 02-12 in `ANALYSIS/SCRIPTS/`). Each markdown |
| 157 | +report must follow this structure: |
| 158 | + |
| 159 | +```markdown |
| 160 | +# Whole Exome Sequencing Report: SampleN |
| 161 | +> **Project** ... | **Platform** ... | ... |
| 162 | +## 1. Exome Summary |
| 163 | +## 2. Clinically Significant Variants |
| 164 | +## 3. Pharmacogenomics |
| 165 | +## 4. Fitness and Nutrition Traits |
| 166 | +## 5. Prioritised Rare Damaging Variants |
| 167 | +## 6. Disease and Pathway Context |
| 168 | +## 7. Methods |
| 169 | +``` |
| 170 | + |
| 171 | +## Gotchas |
| 172 | + |
| 173 | +1. **Logo paths must exist**: if logo files are missing, the report still |
| 174 | + generates but without institutional branding. The script silently skips |
| 175 | + missing logos. |
| 176 | +2. **Table truncation**: tables with more than 20 rows are truncated in |
| 177 | + the PDF with a note to consult TSV files. Do not assume all data is |
| 178 | + visible in the PDF. |
| 179 | +3. **Ancestry data is optional**: section 8 requires |
| 180 | + `ancestry_results.json` in the ancestry output directory. If absent, |
| 181 | + the section shows "No ancestry data available." |
| 182 | +4. **ClinVar classifications are time-sensitive**: the report reflects |
| 183 | + ClinVar state at annotation time. Do not treat classifications as |
| 184 | + permanent. |
| 185 | +5. **PGx star alleles from SNVs only**: CYP2D6 CNV analysis is not |
| 186 | + included. Do not claim complete metaboliser phenotyping. |
| 187 | + |
| 188 | +## Safety |
| 189 | + |
| 190 | +ClawBio is a research and educational tool. It is not a medical device |
| 191 | +and does not provide clinical diagnoses. Consult a healthcare professional |
| 192 | +before making any medical decisions. |
| 193 | + |
| 194 | +## Agent Boundary |
| 195 | + |
| 196 | +The agent dispatches and explains; the skill executes. The agent should |
| 197 | +not modify PDF generation logic inline. All report customisation goes |
| 198 | +through CLI flags. |
| 199 | + |
| 200 | +## Chaining Partners |
| 201 | + |
| 202 | +- `variant-annotation`: upstream VCF annotation feeding markdown reports |
| 203 | +- `clinical-variant-reporter`: ACMG classification for deeper analysis |
| 204 | +- `wes-clinical-report-es`: Spanish language version of the same report |
| 205 | + |
| 206 | +## Maintenance |
| 207 | + |
| 208 | +- Review cadence: quarterly (aligned with ClinVar release cycle) |
| 209 | +- Staleness signals: ClinVar version drift, CPIC guideline updates |
| 210 | +- Deprecation: if WES is superseded by WGS-only clinical pipelines |
| 211 | + |
| 212 | +## Requirements |
| 213 | + |
| 214 | +- Python 3.9+ |
| 215 | +- reportlab >= 4.0 |
| 216 | +- WES markdown reports (see input format above) |
| 217 | +- Institutional logos in JPG/PNG (optional) |
| 218 | + |
| 219 | +## Privacy |
| 220 | + |
| 221 | +This skill is **private** and not included in the ClawBio public catalog. |
| 222 | +It contains institutional report templates that should not be distributed |
| 223 | +publicly. |
| 224 | + |
| 225 | +## References |
| 226 | + |
| 227 | +- Corpas et al. (2021) "Whole Genome Interpretation for a Family of Five" |
| 228 | + *Frontiers in Genetics* 12:535123 |
| 229 | +- CPIC guidelines for pharmacogenomics |
| 230 | +- ClinVar / gnomAD / OMIM / COSMIC / KEGG for variant annotation |
0 commit comments