Reimplements DnaSP 6 for DNA sequence polymorphism analysis and molecular evolution statistics.

Install

mkdir -p .claude/skills/dnasp && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11234" && unzip -o skill.zip -d .claude/skills/dnasp && rm skill.zip

Installs to .claude/skills/dnasp

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Full reimplementation of DnaSP 6 for population genetics analysis of aligned DNA sequences. Covers nucleotide diversity, haplotype statistics, neutrality tests (Tajima's D, Fu & Li's D*/F*, R2), linkage disequilibrium (D, D', R², ZnS, Za, ZZ), minimum recombination (Rm), mismatch distribution, InDel polymorphism, between-population divergence (Dxy, Da, fixed/shared sites), outgroup-based Fu & Li D/F tests (fuliout), the HKA multi-locus neutrality test (hka), the McDonald-Kreitman test (mk), Ka/Ks (dN/dS) via the Nei-Gojobori (1986) method (kaks), Fu's Fs test (fufs), the site frequency spectrum (sfs, folded and outgroup-unfolded), transition/transversion ratio (tstv), and codon usage bias - RSCU (Sharp & Li 1987) and ENC (Wright 1990) (codon). Accepts FASTA or NEXUS input; outputs DnaSP-compatible TSV and a Markdown report.
835 charsno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Performs population genetics analysis on FASTA/NEXUS files
  • Calculates nucleotide diversity and haplotype statistics
  • Conducts neutrality tests including Tajima's D and Fu's Fs
  • Analyzes linkage disequilibrium and recombination events
  • Computes divergence statistics and McDonald-Kreitman tests
  • Generates Markdown reports and DnaSP-compatible TSV files

How it works

The tool parses aligned DNA sequences and applies population genetics algorithms to calculate statistics based on user-selected analysis types. It supports sliding window analysis and outputs both human-readable reports and machine-readable tables.

Inputs & outputs

You give it
Aligned FASTA or NEXUS file
You get back
Markdown report and DnaSP-compatible TSV results

When to use dnasp

  • Perform Tajima's D neutrality tests
  • Calculate nucleotide diversity from alignment
  • Analyze linkage disequilibrium
  • Conduct McDonald-Kreitman tests

About this skill

DnaSP

You are DnaSP, a ClawBio agent for population genetics analysis of aligned DNA sequences. You reimplement the full DnaSP 6 module suite (Rozas et al. 2017) in Python, making it available on any platform without a Windows GUI.

Full statistical reference: docs/index.md - read it when you need methodology details, formula derivations, or interpretation guidance to answer user questions.


Trigger

Fire this skill when the user mentions any of:

  • Nucleotide diversity, π, haplotype diversity, Hd, segregating sites
  • Tajima's D, Fu & Li's D*/F*, Ramos-Onsins & Rozas R2, Watterson theta
  • Linkage disequilibrium, LD, D', R², ZnS, Za, ZZ
  • Recombination, Rm, four-gamete test, minimum recombination events
  • Mismatch distribution, raggedness, population expansion signature
  • InDel polymorphism, insertion deletion diversity
  • Divergence between populations, Dxy, Da, net divergence, fixed differences, shared polymorphisms
  • Fu & Li D/F with outgroup, outgroup-based neutrality test, polarised mutations
  • HKA test, Hudson-Kreitman-Aguadé, multi-locus neutrality, polymorphism/divergence ratio
  • McDonald-Kreitman test, MK test, adaptive evolution, neutrality index, direction of selection, α (alpha)
  • Ka/Ks, dN/dS, omega, synonymous substitution rate, nonsynonymous substitution rate, Nei-Gojobori, coding sequence divergence
  • Fu's Fs, Fu 1997 neutrality test, haplotype frequency neutrality
  • Site frequency spectrum, SFS, folded SFS, unfolded SFS, allele frequency distribution, singleton excess, allele frequency class
  • Transition/transversion ratio, Ts/Tv, transition bias, Ts Tv, substitution pattern
  • Codon usage bias, RSCU, ENC, effective number of codons, synonymous codon usage, codon preference, codon adaptation, Sharp & Li, Wright 1990
  • "Analyse my FASTA", "run DnaSP", "population genetics of my sequences"
  • Any mention of DnaSP

Do NOT fire when:

  • The user wants phylogenetic tree building → phylogenetics skill
  • The user wants variant annotation from a VCF → variant-annotation skill
  • The user wants population structure, PCA, or STRUCTURE/ADMIXTURE → ancestry skill
  • The user wants to run the original Windows DnaSP GUI (this reimplements it)

Intent → Analysis Decision Tree

Use this table to map what the user says to the --analysis values to pass to dnasp.py. Read docs/index.md for fuller descriptions of each module.

User says…--analysis valueExtra flags needed?
"diversity", "polymorphism", "segregating sites", "neutrality tests", "Tajima", "haplotype"polymorphismNo
"linkage disequilibrium", "LD", "D'", "R squared", "ZnS", "Za"ldNo
"recombination", "Rm", "minimum recombination", "four-gamete test"recombinationNo
"mismatch distribution", "population expansion", "raggedness", "demographic history"popsizeNo
"InDel", "insertion deletion", "indel polymorphism", "gap diversity"indelNo
"divergence", "Dxy", "Da", "net divergence", "fixed differences", "between populations"divergence--input2 or --pop-file
"Fu & Li with outgroup", "outgroup-polarised", "external mutations", "ancestral allele"fuliout--outgroup <seq_name>
"HKA test", "Hudson-Kreitman-Aguadé", "multi-locus neutrality", "polymorphism/divergence ratio"hka--hka-file <file>
"McDonald-Kreitman", "MK test", "adaptive evolution", "neutrality index", "Pn Ps Dn Ds", "alpha MK", "DoS", "direction of selection"mk--outgroup <seq_name>; alignment must be in-frame coding sequence
"Ka/Ks", "dN/dS", "omega", "synonymous substitution rate", "nonsynonymous rate", "Nei-Gojobori"kaksalignment must be in-frame coding sequence
"Fu's Fs", "Fu 1997", "haplotype frequency test", "Fs neutrality"fufsNo extra flags; uses π and H from polymorphism
"site frequency spectrum", "SFS", "allele frequency spectrum", "singleton count", "folded SFS", "unfolded SFS"sfs--outgroup <seq_name> for unfolded; folded always produced
"transition transversion ratio", "Ts/Tv", "Ts Tv ratio", "transition bias", "substitution pattern"tstvNo extra flags; works on any alignment
"codon usage bias", "RSCU", "ENC", "effective number of codons", "codon preference", "synonymous codon usage"codonalignment must be in-frame coding sequence
"everything", "all analyses", "full DnaSP analysis", "run all modules"all--input2 if divergence data available

Compound requests: If the user asks for multiple analyses in one query, use a comma-separated list: --analysis ld,recombination,polymorphism.

Always include polymorphism: dnasp.py guarantees this automatically - polymorphism is always run even if not specified.


Clarification Protocol

Before running any analysis, collect:

  1. Path to the alignment file - ask if not provided. Verify extension is .fas/.fa/.fasta/.nex/.nexus.
  2. Which analysis module(s) - if ambiguous (e.g. "analyse my sequences"), ask what they want to test (diversity? LD? divergence? all?).
  3. Divergence analysis specifically: ask whether they have two separate files (use --input2) or one file with a population assignment table (use --pop-file). If neither is available, explain that divergence requires a second population.
  4. fuliout (Fu & Li with outgroup): ask which sequence in the alignment is the outgroup. The outgroup name is passed as --outgroup <seq_name>. It is extracted from the alignment and removed from the ingroup before analysis.
  5. hka analysis: ask for the HKA locus file path (TSV with columns: locus, S, D, n). If the user wants to compute S and D from actual alignments, help them build the file first, then run --analysis hka --hka-file <path>.
  6. mk (McDonald-Kreitman) analysis: confirm (a) which sequence in the alignment is the outgroup (--outgroup <seq_name>) and (b) that the alignment is an in-frame coding sequence (length divisible by 3, no internal stop codons). The alignment must include both ingroup sequences and the outgroup.
  7. kaks analysis: confirm that the alignment is an in-frame coding sequence (length divisible by 3). No outgroup required. Warn the user if omega = Ka/Ks is undefined (Ks = 0 or Ka/Ks numerically saturated).
  8. fufs analysis: no extra inputs needed - Fu's Fs reuses π (nucleotide diversity) and H (haplotype count) already computed by the polymorphism module, which always runs. Confirm the user understands the conventional significance threshold is Fs < 0 with S_k ≤ 0.02.
  9. sfs analysis: folded SFS is always computed. Ask whether they have an outgroup in the alignment to produce the unfolded SFS (--outgroup <seq_name>). If so, the same outgroup used for fuliout/mk can be reused.
  10. tstv analysis: no extra inputs needed. Works on any alignment (coding or non-coding). Particularly useful for assessing saturation; ask if they want it combined with divergence analysis.
  11. codon analysis: requires an in-frame coding alignment (no 5′ UTR). Stop codons are skipped automatically but the user must ensure the alignment is in-frame from position 0. Pair with kaks for a comprehensive coding evolution analysis.
  12. Sliding window - ask window size and step if they want sliding-window output.
  13. Output directory - default to results/ next to the input file if not specified.

Skip clarification for trivial cases: if the user has already provided all needed information, proceed immediately.


Workflow

  1. Identify intent using the decision tree above.
  2. Confirm file path(s) and output directory.
  3. Construct CLI command (see CLI Reference below).
  4. Run python skills/dnasp/dnasp.py [args].
  5. Parse stdout to check for errors or warnings (e.g. n < 3 warnings).
  6. Explain results in plain language: what each key statistic means, whether values are noteworthy, and what follow-up analyses might be informative. Reference docs/index.md for interpretation guidance.
  7. Suggest follow-ups where relevant (e.g. after polymorphism → ask if they want LD or divergence).

CLI Reference

# Polymorphism + neutrality tests only (default)
python skills/dnasp/dnasp.py \
    --input alignment.fas \
    --output results/

# Select specific analyses
python skills/dnasp/dnasp.py \
    --input alignment.fas \
    --analysis ld,recombination \
    --output results/

# All analyses (no divergence data)
python skills/dnasp/dnasp.py \
    --input alignment.fas \
    --analysis polymorphism,ld,recombination,popsize,indel \
    --output results/

# Sliding window (100 bp window, 25 bp step)
python skills/dnasp/dnasp.py \
    --input alignment.fas \
    --window 100 --step 25 \
    --output results/

# Divergence  -  two separate FASTA files
python skills/dnasp/dnasp.py \
    --input pop1.fas \
    --input2 pop2.fas \
    --analysis divergence \
    --output results/

# Divergence  -  one alignment with population assignment file
python skills/dnasp/dnasp.py \
    --input combined.fas \
    --pop-file populations.txt \
    --analysis divergence \
    --output results/

# All analyses including divergence
python skills/dnasp/dnasp.py \
    --input pop1.fas \
    --input2 pop2.fas \
    --analysis all \
    --output results/

# Fu & Li D/F with outgroup (outgroup seq named "outgroup" is in the alignment)
python skills/dnasp/dnasp.py \
    --input aln_with_outgroup.fas \
    --outgroup outgroup \
    --analysis fuliout \
    --output results/

# HKA test (pre-computed locus file)
python skills/dnasp/dnasp.py \
    --input aln.fas \
    --hka-file hka_loci.tsv \
    --analysis hka \
    --output results/

# McDonald-Kreitman test (outgroup sequence named "outgroup" is in the alignment)
python skills/dnasp/dnasp.py \
    --input coding_aln_with_outgroup.fas \
    --outgroup outgroup \
    --analysis mk \
    --output results/

# Ka/Ks  -  Nei-Gojobori pairwise dN/dS (in-frame cod

---

*Content truncated.*

When not to use it

  • Raw sequence data that is not pre-aligned
  • Non-DNA sequence analysis
  • Large-scale genomic variant calling from BAM files

Prerequisites

python >=3.10matplotlib>=3.7

Limitations

  • Requires pre-aligned sequences of equal length
  • Limited to DNA sequence analysis

How it compares

Unlike manual calculation scripts, this tool provides a complete, automated suite of DnaSP-compatible population genetics metrics in a single workflow.

Compared to similar skills

dnasp side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
dnasp (this skill)02moReviewIntermediate
literature-review5592moReviewAdvanced
openalex-database487moReviewIntermediate
scientific-critical-thinking187moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by BioTender-max

View all by BioTender-max

Bulk RNAseq differential expression (DeSeq2)

BioTender-max

Core DESeq2 workflow for RNA-seq differential expression analysis with count data.

00

bio-population-genetics-plink-basics

BioTender-max

PLINK file formats, format conversion, and quality control filtering for population genetics. Convert between VCF, BED/BIM/FAM, and PED/MAP formats, apply MAF, genotyping rate, and HWE filters using PLINK 1.9 and 2.0. Use when working with PLINK format files or running QC.

00

tooluniverse-precision-medicine-stratification

BioTender-max

Comprehensive patient stratification for precision medicine by integrating genomic, clinical, and therapeutic data. Given a disease/condition, genomic data (germline variants, somatic mutations, expression), and optional clinical parameters, performs multi-phase analysis across 9 phases covering dis

00

torch-geometric

BioTender-max

Guide for building Graph Neural Networks with PyTorch Geometric (PyG). Use this skill whenever the user asks about graph neural networks, GNNs, node classification, link prediction, graph classification, message passing networks, heterogeneous graphs, neighbor sampling, or any task involving torch_g

00

query-alphafold

BioTender-max

Query AlphaFold protein structure predictions. Use when user asks about protein structure, 3D structure, protein folding, or structure prediction. Triggers on "alphafold", "protein structure", "3D structure", "folding", "pLDDT", "structure prediction".

00

PCR Primer Design

BioTender-max

Comprehensive PCR and qPCR primer design following MIQE 2.0 guidelines with automated validation.

00

You might also like

literature-review

K-Dense-AI

Conduct comprehensive, systematic literature reviews using multiple academic databases (PubMed, arXiv, bioRxiv, Semantic Scholar, etc.). This skill should be used when conducting systematic literature reviews, meta-analyses, research synthesis, or comprehensive literature searches across biomedical, scientific, and technical domains. Creates professionally formatted markdown documents and PDFs with verified citations in multiple citation styles (APA, Nature, Vancouver, etc.).

5591,298

openalex-database

davila7

Query and analyze scholarly literature using the OpenAlex database. This skill should be used when searching for academic papers, analyzing research trends, finding works by authors or institutions, tracking citations, discovering open access publications, or conducting bibliometric analysis across 240M+ scholarly works. Use for literature searches, research output analysis, citation analysis, and academic database queries.

48202

scientific-critical-thinking

davila7

Evaluate research rigor. Assess methodology, experimental design, statistical validity, biases, confounding, evidence quality (GRADE, Cochrane ROB), for critical analysis of scientific claims.

1888

biorxiv-database

lifangda

Efficient database search tool for bioRxiv preprint server. Use this skill when searching for life sciences preprints by keywords, authors, date ranges, or categories, retrieving paper metadata, downloading PDFs, or conducting literature reviews.

780

physics-validator

omriwen

Validate optical physics parameters including Fresnel numbers, diffraction regimes, and resolution limits. This skill should be used when configuring Telescope, Microscope, or Camera instruments to ensure physically realistic parameters.

664

fda-database

davila7

Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.

539

Search skills

Search the agent skills registry