1---2name: biobankjapan-phewas-skill3description: Fetch compact BioBank Japan PheWAS summaries for single variants by accepting rsID, GRCh38, or GRCh37 input and resolving to the required GRCh37 query. Use when a user wants concise BBJ association results for one variant4metadata:5 source: https://skillmd.com/skills/stanfish06/biobankjapan-phewas-skill6---78## Operating rules9- Use `scripts/biobankjapan_phewas.py` for all BioBank Japan PheWAS lookups.10- Accept exactly one of `rsid`, `grch37`, `grch38`, or `variant`; resolve to the canonical GRCh37 `chr:pos-ref-alt` query before calling BioBank Japan.11- The script accepts `max_results`; start with `max_results=10` and only increase it if the first slice is insufficient.12- Re-run the lookup in long conversations instead of relying on older tool output.13- Treat displayed `...` in tool previews as UI truncation, not literal request content.14- If the user needs the full association payload, set `save_raw=true` and report `raw_output_path` instead of pasting large arrays into chat.1516## Execution behavior17- Return concise markdown summaries from the script JSON by default.18- Return the JSON verbatim only if the user explicitly asks for machine-readable output.19- Surface the canonical queried variant, total association count, whether the results were truncated, and every entry in `warnings`.20- A multi-allelic rsID is probed against each alternate allele in turn; report which canonical variant the counts came from, since it may not be the first alternate Ensembl lists.21- Increase `max_results` gradually instead of asking for large association dumps in one call.2223## Input24- Read one JSON object from stdin, or a single JSON string containing the variant.25- Required input: exactly one of `rsid`, `grch37`, `grch38`, or `variant`26- Optional fields: `max_results`, `save_raw`, `raw_output_path`, `timeout_sec`27- Common patterns:28 - `{"grch37":"10:114758349-C-T","max_results":10}`29 - `{"grch38":"10:112998590-C-T","max_results":10}`30 - `{"rsid":"rs7903146","max_results":10}`31 - `{"variant":"10:114758349:C:T","max_results":25,"save_raw":true}`3233## Output34- Success returns `ok`, `source`, `input`, `query_variant`, `max_results_applied`, `association_count`, `association_count_total`, `truncated`, `associations`, `variant`, `variant_url`, `raw_output_path`, and `warnings`.35- Use `raw_output_path` when `save_raw=true`.36- Failure returns `ok=false` with `error.code` and `error.message`.3738## Execution39```bash40echo '{"grch37":"10:114758349-C-T","max_results":10}' | python scripts/biobankjapan_phewas.py41```4243## References44- No additional runtime references are required; keep the import package limited to this file and `scripts/biobankjapan_phewas.py`.