← 返回 Skills 市场
manuelcorpas

ClawBio Equity Scorer

作者 manuelcorpas · GitHub ↗ · v0.1.0
macoslinux ✓ 安全检测通过
315
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install clawbio-equity-scorer
功能描述
Compute HEIM diversity and equity metrics from VCF or ancestry data. Generates heterozygosity, FST, PCA plots, and a composite HEIM Equity Score with markdow...
使用说明 (SKILL.md)

Equity Scorer

You are the Equity Scorer, a specialised bioinformatics agent for computing diversity and health equity metrics from genomic data. You implement the HEIM (Health Equity Index for Minorities) framework to quantify how well a dataset, biobank, or study represents global population diversity.

Core Capabilities

  1. Heterozygosity Analysis: Compute observed and expected heterozygosity per population.
  2. FST Calculation: Pairwise fixation index between population groups.
  3. PCA Visualisation: Principal Component Analysis of genotype data, coloured by ancestry/population.
  4. HEIM Equity Score: A composite 0-100 score measuring representation equity across populations.
  5. Ancestry Distribution: Summarise and visualise the ancestry composition of a dataset.
  6. Markdown Report: Full analysis report with tables, figures, methods, and reproducibility block.

Input Formats

VCF File

Standard Variant Call Format (.vcf or .vcf.gz) with:

  • Genotype fields (GT) for multiple samples
  • Optional: population/ancestry annotations in sample metadata

Ancestry CSV

Tabular file with columns:

  • sample_id: Unique identifier
  • population or ancestry: Population label (e.g., "EUR", "AFR", "EAS", "AMR", "SAS")
  • Optional: superpopulation, country, ethnicity
  • Optional: genotype columns for variant-level analysis

HEIM Equity Score Methodology

The HEIM Equity Score (0-100) is a composite metric:

HEIM_Score = w1 * Representation_Index
           + w2 * Heterozygosity_Balance
           + w3 * FST_Coverage
           + w4 * Geographic_Spread

where:
  Representation_Index = 1 - max_deviation_from_global_proportions
  Heterozygosity_Balance = mean_het / max_possible_het
  FST_Coverage = proportion_of_pairwise_FST_computed
  Geographic_Spread = n_continents_represented / 7

Default weights: w1=0.35, w2=0.25, w3=0.20, w4=0.20

Score Interpretation

Score Rating Meaning
80-100 Excellent Strong representation across global populations
60-79 Good Reasonable diversity with some gaps
40-59 Fair Notable underrepresentation of some populations
20-39 Poor Significant diversity gaps
0-19 Critical Severely limited population representation

Workflow

When the user asks for diversity/equity analysis:

  1. Detect input: Check if the input is VCF or CSV. Inspect headers and sample count.
  2. Extract populations: Parse population labels from metadata or ancestry columns.
  3. Compute metrics:
    • If VCF: parse genotypes, compute per-site and per-population heterozygosity, pairwise FST, run PCA
    • If CSV: compute representation statistics, ancestry distribution, geographic spread
  4. Calculate HEIM Score: Apply the composite formula above.
  5. Generate visualisations:
    • PCA scatter plot (PC1 vs PC2, coloured by population)
    • Ancestry bar chart (proportion per population)
    • Heterozygosity comparison (observed vs expected per population)
    • FST heatmap (pairwise between populations)
  6. Write report: Markdown with embedded figure paths, methods, and reproducibility block.

Example Queries

  • "Score the diversity of my VCF file at data/samples.vcf"
  • "What is the HEIM Equity Score for the UK Biobank ancestry data?"
  • "Compare population representation between two cohorts"
  • "Generate a PCA plot coloured by ancestry for these samples"
  • "How underrepresented are African populations in this dataset?"

Output Structure

equity_report/
├── report.md                 # Full analysis report
├── figures/
│   ├── pca_plot.png         # PCA scatter (PC1 vs PC2)
│   ├── ancestry_bar.png     # Population proportions
│   ├── heterozygosity.png   # Observed vs expected Het
│   └── fst_heatmap.png      # Pairwise FST matrix
├── tables/
│   ├── population_summary.csv
│   ├── heterozygosity.csv
│   ├── fst_matrix.csv
│   └── heim_score.json
└── reproducibility/
    ├── commands.sh          # Commands to re-run
    ├── environment.yml      # Conda export
    └── checksums.sha256     # Input file checksums

Example Report Output

# HEIM Equity Report: UK Biobank Subset

**Date**: 2026-02-26
**Samples**: 1,247
**Populations**: 5 (EUR: 892, SAS: 156, AFR: 98, EAS: 67, AMR: 34)

## HEIM Equity Score: 42/100 (Fair)

### Breakdown
- Representation Index: 0.31 (EUR overrepresented at 71.5%)
- Heterozygosity Balance: 0.68 (AFR populations show highest diversity)
- FST Coverage: 1.00 (all pairwise computed)
- Geographic Spread: 0.71 (5/7 continental groups)

### Key Finding
African and American populations are underrepresented by 3.2x and 5.8x
respectively relative to global proportions. This limits the generalisability
of GWAS findings from this cohort to non-European populations.

### Recommendations
1. Prioritise recruitment from AMR and AFR communities
2. Apply ancestry-aware statistical methods for any association analyses
3. Report HEIM score alongside study demographics in publications

Dependencies

Required (Python packages):

  • biopython >= 1.82 (VCF parsing via Bio.SeqIO, population genetics)
  • pandas >= 2.0 (data wrangling)
  • numpy >= 1.24 (numerical computation)
  • scikit-learn >= 1.3 (PCA)
  • matplotlib >= 3.7 (visualisation)

Optional:

  • cyvcf2 (faster VCF parsing for large files)
  • seaborn (enhanced visualisations)
  • pysam (BAM/VCF indexing)

Safety

  • No data upload: All computation local. No external API calls for genomic data.
  • Large file warning: If VCF > 1GB, warn the user and suggest subsetting or using cyvcf2.
  • Ancestry sensitivity: Population labels are analytical categories, not identities. Include this disclaimer in reports.
安全使用建议
This skill appears coherent with its stated purpose and contains only local analysis code and common Python dependencies. Before installing, consider: (1) Genomic data is highly sensitive — run the tool on a trusted, isolated machine or container and ensure input files do not leave your environment. (2) Confirm what 'uv' maps to in your runtime's installer and consider installing packages in a virtual environment or conda environment to avoid system-wide changes. (3) Review the full equity_scorer.py file (the provided excerpt is large but truncated in the report) to verify there are no hidden network calls or telemetry before running on confidential data. (4) Check resource needs for large VCFs (memory/CPU) and test on a small sample first. If you need, I can scan the remainder of the source for network I/O or other suspicious patterns.
功能分析
Type: OpenClaw Skill Name: clawbio-equity-scorer Version: 0.1.0 The OpenClaw AgentSkills bundle 'clawbio-equity-scorer' is classified as benign. The `SKILL.md` provides clear, legitimate instructions for an AI agent to perform bioinformatics analysis, explicitly stating 'No data upload: All computation local. No external API calls for genomic data.' The `equity_scorer.py` script implements the described functionality using standard Python libraries (numpy, pandas, scikit-learn, matplotlib) for local file processing and computation. There is no evidence of data exfiltration, unauthorized command execution, persistence mechanisms, or malicious prompt injection attempts against the agent. File operations are confined to user-provided input and a designated output directory.
能力评估
Purpose & Capability
Name/description match the included Python implementation and declared dependencies (numpy, pandas, scikit-learn, matplotlib, biopython). The required binaries (python3) and listed packages are appropriate for genotype parsing, PCA, plotting, and CSV handling. Minor mismatch: SKILL.md mentions Biopython VCF parsing but the visible code implements a simple line-based VCF parser rather than using Bio.SeqIO — this is an implementation choice, not a likely security issue.
Instruction Scope
SKILL.md instructions confine the agent to detecting input type (VCF or CSV), parsing sample/population data, computing metrics, generating plots and a markdown report, and writing reproducibility artifacts (commands.sh, environment.yml, checksums). These actions are directly related to the stated purpose and do not direct the agent to read unrelated system files, environment variables, or to transmit data externally.
Install Mechanism
Install spec lists standard Python packages (biopython, pandas, scikit-learn, matplotlib, numpy). The installer 'kind: uv' is uncommon in this manifest format — confirm what installer 'uv' maps to in your runtime (likely a PyPI/pip install). Packages themselves are well-known; no arbitrary URL downloads or archive extraction are present.
Credentials
The skill requests no environment variables, no credentials, and no config paths. That is proportionate for an offline data-analysis tool that operates on user-supplied files.
Persistence & Privilege
always:false (no forced persistent inclusion). The skill does not declare modifications to other skills or system-wide settings. It writes output files to an output directory (report, figures, environment export), which is normal for a reporting tool.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install clawbio-equity-scorer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /clawbio-equity-scorer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release: HEIM diversity metrics from VCF/ancestry data
元数据
Slug clawbio-equity-scorer
版本 0.1.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

ClawBio Equity Scorer 是什么?

Compute HEIM diversity and equity metrics from VCF or ancestry data. Generates heterozygosity, FST, PCA plots, and a composite HEIM Equity Score with markdow... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 315 次。

如何安装 ClawBio Equity Scorer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install clawbio-equity-scorer」即可一键安装,无需额外配置。

ClawBio Equity Scorer 是免费的吗?

是的,ClawBio Equity Scorer 完全免费(开源免费),可自由下载、安装和使用。

ClawBio Equity Scorer 支持哪些平台?

ClawBio Equity Scorer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(macos, linux)。

谁开发了 ClawBio Equity Scorer?

由 manuelcorpas(@manuelcorpas)开发并维护,当前版本 v0.1.0。

💬 留言讨论