bio-alignment-statistics
Calculate alignment statistics including sequence identity, conservation scores, substitution matrices, and similarity metrics. Use for comparing alignment quality, measuring sequence divergence, and analyzing evolutionary patterns.
npx skills add majiayu000/claude-skill-registry --skill alignment-statistics --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Alignment Statistics Calculate sequence identity, conservation scores, substitution counts, and other alignment metrics. ## Required Import ```python from Bio import AlignIO from Bio.Align import substitution_matrices from collections import Counter import numpy as np import math ``` ## Pairwise Identity ### Calculate Identity Between Two Sequences ```python def pairwise_identity(seq1, seq2): matches = sum(a == b and a != '-' for a, b in zip(seq1, seq2)) aligned_positions = sum(a != '-' or b != '-' for a, b in zip(seq1, seq2)) return matches / aligned_positions if aligned_positions > 0 else 0 alignment = AlignIO.read('alignment.fasta', 'fasta') seq1, seq2 = str(alignment[0].seq), str(alignment[1].seq) identity = pairwise_identity(seq1, seq2) print(f'Identity: {identity * 100:.1f}%') ``` ### Identity Matrix for All Sequences ```python def identity_matrix(alignment): n = len(alignment) matrix = np.zeros((n, n)) for i in range(n): for j in range(i, n): seq_i = str(alignment[i].seq) seq_j = str(alignment[j].seq) ident = pairwise_identity(seq_i, seq_j) matrix[i, j] = matrix[j, i] = ident return matrix alignment = AlignIO.read('alignment.fasta', 'fasta') mat = identity_matrix(alignment
- Required Import
- Pairwise Identity
- Calculate Identity Between Two Sequences
- Identity Matrix for All Sequences
- Conservation Score
- Per-Column Conservation
- Average Conservation Across Alignment
- Conservation Profile
- Substitution Counts
- Count Substitutions from Alignment
- Build Substitution Matrix from MSA
- Using Alignment.substitutions (Pairwise Alignments)
- Information Content
- Shannon Entropy Per Column
What does the bio-alignment-statistics skill do?
Calculate alignment statistics including sequence identity, conservation scores, substitution matrices, and similarity metrics. Use for comparing alignment quality, measuring sequence divergence, and analyzing evolutionary patterns.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill alignment-statistics --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
