Population genetics hwe

From XuShuwenn/RedAct · View interactive version

Population genetics hwe is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Calculate Hardy-Weinberg equilibrium expected genotype counts and heterozygosity from allele counts.

How to use this skill

Skill file

Hardy-Weinberg Equilibrium Calculation

When to Use

Input Format

File /root/input.txt:

Before calculating, read /root/input.txt and extract the provided AA, Aa, and aa genotype counts exactly as written. Parse them into numeric variables before doing any calculations; do not assume values or ordering without checking the file contents.

Output Format

To /root/output.txt:

Expected AA: X
Expected Aa: X
Expected aa: X
Expected heterozygosity: X.XXXX
Observed heterozygosity: X.XXXX

Round to 4 decimal places.

Write the completed result block to /root/output.txt using the exact five labels shown above, in that order, with all numeric values rounded to 4 decimal places.

Calculation Workflow

Calculation Workflow

  1. Compute total individuals: N = AA + Aa + aa.
  2. Verify N > 0 before dividing.
  3. Compute allele frequencies from genotype counts:
  1. Compute expected genotype counts under HWE:
  1. Compute heterozygosity values:
  1. Write results to /root/output.txt using the exact labels and order shown above.

Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.