bio-comparative-genomics-synteny-analysis

bio-comparative-genomics-synteny-analysis is a skill for Claude Code, Codex from thesecondfox/skill. It costs 67 tokens per session (2,771 once invoked), scanned A, original, MIT.

A comparative-genomics guide for synteny analysis, which compares the order of genes or genome regions between species. It uses tools such as MCScanX, SyRI, and JCVI to examine conserved blocks and genome changes.

In plain words
What is it for?
Preparing genome inputs, finding conserved gene-order blocks, detecting rearrangements and duplications, and making synteny diagrams.
Why use it?
It helps reveal which parts of two genomes remain organized alike and where rearrangements or whole-genome duplications occurred.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Preparing genome inputs, finding conserved gene-order blocks, detecting rearrangements and duplications, and making synteny diagrams.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/thesecondfox/skill/bio-comparative-genomics-synteny-analysis
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add thesecondfox/skill --skill bio-comparative-genomics-synteny-analysis
Clone the repo
git clone --depth 1 https://github.com/thesecondfox/skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bio-comparative-genomics-synteny-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/thesecondfox/skill/bio-comparative-genomics-synteny-analysis/github.svg)](https://agentmods.dev/skills/thesecondfox/skill/bio-comparative-genomics-synteny-analysis)
Your own site
<a href="https://agentmods.dev/skills/thesecondfox/skill/bio-comparative-genomics-synteny-analysis"><img src="https://agentmods.dev/badge/skills/thesecondfox/skill/bio-comparative-genomics-synteny-analysis/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for bio-comparative-genomics-synteny-analysis

Your own site · 80×15
<a href="https://agentmods.dev/skills/thesecondfox/skill/bio-comparative-genomics-synteny-analysis"><img src="https://agentmods.dev/badge/skills/thesecondfox/skill/bio-comparative-genomics-synteny-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,771 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00067 $0.02771
Opus 5.5 $0.00027 $0.01108
Sonnet 5.5 $0.00013 $0.00554
Haiku 4.5 $0.00007 $0.00277

Measured 3mo ago against content hash 011e2e3b8302, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

bio-comparative-genomics-synteny-analysis scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

subprocess.run(f'cat {gff1} {gff2} > {output_prefix}.gff', shell=True)
Common_Skills/bio-comparative-genomics-synteny-analysis/SKILL.md · 322 lines

How it starts

The opening of the file, as written. The whole thing — 322 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Version Compatibility

Reference examples tested with: BioPython 1.83+, PAML 4.10+, matplotlib 3.8+, minimap2 2.26+, numpy 1.26+, pandas 2.2+, scipy 1.12+

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show <package> then help(module.function) to check signatures

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Synteny Analysis

"Compare genome structure between my species" → Detect conserved gene order (syntenic blocks), chromosomal rearrangements, and whole-genome duplications by aligning genomic collinearity.

  • CLI: MCScanX for collinear block detection from BLAST results
  • Python: jcvi.compara.synteny for synteny visualization (dot plots, macro/micro)

MCScanX Workflow

Goal: Detect conserved gene order (syntenic blocks) between two genomes.

Approach: Prepare GFF and all-vs-all BLASTP input files, run MCScanX to identify collinear gene blocks, parse the collinearity output, and classify syntenic relationships by coverage ratios.

'''Synteny analysis with MCScanX and visualization'''

import subprocess
import pandas as pd
from collections import defaultdict

def prepare_mcscanx_input(gff_file, fasta_file, species_prefix):
    '''Prepare input files for MCScanX

    MCScanX requires:
    1. .gff file: gene positions (sp  gene  chr  start  end)
    2. .blast file: all-vs-all BLASTP results
    '''
    genes = []
    with open(gff_file) as f:
        for line in f:
            if line.startswith('#'):
                continue
            parts = line.strip().split('\t')
            if parts[2] == 'gene':
                chrom = parts[0]
                start, end = int(parts[3]), int(parts[4])
                gene_id = parts[8].split('ID=')[1].split(';')[0]
                genes.append(f'{species_prefix}\t{gene_id}\t{chrom}\t{start}\t{end}')

    with open(f'{species_prefix}.gff', 'w') as f:
        f.write('\n'.join(genes))

    return f'{species_prefix}.gff'


def run_mcscanx(gff1, gff2, blast_file, output_prefix):
    '''Run MCScanX for synteny detection

    Key parameters:
    -k: Match score for collinear genes (default 50)
    -g: Gap penalty (default -1)
    -s: Minimum syntenic block size (default 5 genes)
    -e: E-value threshold for BLAST (default 1e-5)
    '''
    # Combine GFF files
    subprocess.run(f'cat {gff1} {gff2} > {output_prefix}.gff', shell=True)

    # Copy BLAST file
    subprocess.run(f'cp {blast_file} {output_prefix}.blast', shell=True)

    # Run MCScanX
    # -s 5: Minimum 5 genes per syntenic block (smaller = more noise)
    # -m 25: Maximum gaps allowed (larger = more relaxed blocks)
    cmd = f'MCScanX -s 5 -m 25 {output_prefix}'
    subprocess.run(cmd, shell=True)

    return f'{output_prefix}.collinearity'


def parse_collinearity(collinearity_file):
    '''Parse MCScanX collinearity output

    Output format:
    ## Alignment X: score=N e_value=X N genes
    X-Y: gene1  gene2
    '''
    blocks = []
    current_block = None

    with open(collinearity_file) as f:
        for line in f:
            if line.startswith('## Alignment'):
                if current_block:
                    blocks.append(current_block)
                parts = line.strip().split()
                score = int(parts[3].split('=')[1])
                e_value = float(parts[4].split('=')[1])
                n_genes = int(parts[5])
                current_block = {
                    'score': score,
                    'e_value': e_value,
                    'n_genes': n_genes,
                    'gene_pairs': []
                }
            elif current_block and '-' in line and ':' in line:
                parts = line.strip().split()
                if len(parts) >= 3:
                    gene1, gene2 = parts[1], parts[2]
                    current_block['gene_pairs'].append((gene1, gene2))

    if current_block:
        blocks.append(current_block)

    return blocks


def classify_synteny_type(blocks, species1_chroms, species2_chroms):
    '''Classify syntenic relationships

    Types:
    - 1:1: Direct orthology (conserved)
    - 1:many: Lineage-specific duplication
    - many:many: Ancient WGD or complex rearrangement
    '''
    sp1_coverage = defaultdict(list)
    sp2_coverage = defaultdict(list)

    for block in blocks:
        for gene1, gene2 in block['gene_pairs']:
            chr1 = species1_chroms.get(gene1)
            chr2 = species2_chroms.get(gene2)
            if chr1 and chr2:
                sp1_coverage[chr1].append(chr2)
                sp2_coverage[chr2].append(chr1)

    classifications = []
    for chr1, partners in sp1_coverage.items():
        unique_partners = len(set(partners))
        if unique_partners == 1:
            classifications.append(('1:1', chr1, partners[0]))
        else:
            classifications.append(('1:many', chr1, set(partners)))

    return classifications

Read the full file on GitHub · 322 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 322 lines · 67 tokens per session scan A 011e2e3b8302

Subscribe to this mod's changes

bio-comparative-genomics-synteny-analysis is a skill published in the GitHub repository thesecondfox/skill (3 stars, last pushed 8mo ago), licensed MIT. It adds 67 tokens to every session and 2,771 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

bio-comparative-genomics-synteny-analysis compared with skills from other repositories

bio-comparative-genomics-synteny-analysis next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
bio-comparative-genomics-synteny-analysisthesecondfox/skillSkill38mo agoMITA67Claude Code, Codex
instrument-data-to-allotropeanthropics/knowledge-work-pluginsSkill38kyesterdayApache-2.0A123Claude Code
exploratory-data-analysisK-Dense-AI/scientific-agent-skillsSkill59k4d agoMITA83Claude Code
matlabK-Dense-AI/scientific-agent-skillsSkill59k4d agoMITA44Claude Code
phylogeneticsK-Dense-AI/scientific-agent-skillsSkill59k4d agoMITA71Claude Code, Codex
research-engineerdavila7/claude-code-templatesSkill35kyesterdayMITA43Claude Code, Codex
mapping-to-snomedmaziyarpanahi/openmedSkill5.9k4d agoApache-2.0A205Claude Code