This skill is designed for AI agents (e.g. Biomni/Phylo) to run automatically. The user only needs to provide a BAM file path — the agent handles everything else.
Predicts RHD and RHCE Rh blood group genotypes from short-read whole-genome or whole-exome sequencing (WGS/WES) BAM files, using RHtyper v1.1.
The agent will automatically:
- Create an isolated conda environment (Python 3.7 + RHtyper 1.1 + XGBoost <1.0)
- Apply upstream bug patches to RHtyper (bare-name chromosome support for hg19)
- Validate the BAM file and estimate RH locus coverage
- Run RHtyper and collect all output files
- Return a natural-language genotype report with clinical interpretation
Supported genome builds: hg38, hg19 (both chr1 and bare 1 naming styles)
Supported data types: WGS, WES
Research use only — not validated for clinical diagnostic decisions.
Copy any of the following prompts to test the skill with a public BAM file:
Please run Rh blood group genotyping on this BAM file (hg19, WGS):
https://ftp-trace.ncbi.nlm.nih.gov/ReferenceSamples/giab/data/NA12878/NIST_NA12878_HG001_HiSeq_300x/RMNISTHS_30xdownsample.bam
Please run RHD/RHCE blood group genotyping on /data/patient001.bam (hg38, WGS).
Any Biomni user can register this skill into their own account in three steps:
- Get the skill package — clone or download this repository.
- Open a new Biomni conversation and send the contents of
SKILL.mdto the agent with the message:Please register the following skill to my account: <paste SKILL.md content here> - Confirm — the agent will call
WriteSkilland save it. From that point on, Biomni will automatically recognize Rh genotyping requests and invoke this skill without any further action from the user.
Note: The skill package (
scripts/,assets/,references/) must be accessible to the agent's execution environment at runtime. Place it in a directory the agent can reach, or upload it via the platform's file interface.
Once registered, the skill is listed in the agent's skill index. Biomni reads the
description field at the start of each conversation. When a user request
semantically matches keywords such as "Rh blood group", "RHD/RHCE", "BAM
genotyping", or "sickle cell blood group compatibility", the agent automatically
loads the full SKILL.md guidance and executes the pipeline.
You do not need to say "use the RHtyper skill" — just describe what you want.
The agent recognizes requests like:
- "Run Rh blood group genotyping on this BAM"
- "RHD/RHCE genotyping from WGS data"
- "Rh blood group compatibility for sickle cell disease patient"
- "Predict RH antigens from a BAM file"
- "Alloimmunization risk assessment from WGS"
This skill is not automatically registered on other platforms. To use it:
- Copy the
SKILL.mdcontent into your agent's system prompt or tool description. - Make the three scripts (
setup_env.py,validate_bam.py,run_rhtyper.py) accessible to your agent's code execution environment. - Ensure the
assets/directory (bundled reference FASTAs,environment.yml) is present alongside the scripts.
The scripts are self-contained and can be called from any Python-capable agent that has conda/mamba available.
| Field | Required | Example |
|---|---|---|
| BAM file path or URL | Yes | /data/sample.bam |
| Genome build | Recommended | hg38 or hg19 (default: hg38) |
| Data type | Optional | WGS or WES (default: WGS) |
- Predicted RHD and RHCE genotypes (allele names, ISBT nomenclature)
- Clinical interpretation (D-positive/negative, variant antigen status)
- Per-exon copy number profile (deletion detection)
- Output files:
.bloodtyping.txt,.bloodtyping.pdf,.exonCNV.txt
| Sample | Build | Coverage | Expected Result | Status |
|---|---|---|---|---|
| NA12878 (GIAB) | hg38 | 255x | RHD: Deletion / RHD*01 | ✓ PASS |
| NA12878 (GIAB) | hg19 | 30x | RHD: RHD*01 / RHD*01 | ✓ PASS |
| HG00096 (1000G) | hg19 | 4.4x | Coverage QC FAIL | ✓ PASS |
RHtyper v1.1 contains two bugs that are automatically patched by this skill:
-
chr/tarchrcrash on hg19 bare-name BAMs —ValueError: invalid contig chr1when the BAM usesSN:1instead ofSN:chr1. Fixed by patching 4 call sites inBGClf/accessory.pyduring environment setup. -
SameFileErrorwhen--work-dirand--output-dirpoint to the same path. Fixed inrun_rhtyper.py.
MIT — see LICENSE