Structural Variant Analysis Workflow

SkillDev tools

Comprehensive structural variant (SV) analysis skill for clinical genomics. Classifies SVs (deletions, duplications, inversions, translocations), assesses pathogenicity using ACMG-adapted criteria, evaluates gene disruption and dosage sensitivity, and provides clinical interpretation with evidence grading. Use when analyzing CNVs, large deletions/duplications, chromosomal rearrangements, or any structural variants requiring clinical interpretation.

Use Structural Variant Analysis Workflow in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add Structural Variant Analysis Workflow and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the Structural Variant Analysis Workflow skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Structural Variant Analysis WorkflowStart free

What this skill tells your AI

The instructions your AI receives, as published by freedomintelligence/openclaw-medical-skills in skills/tooluniverse-structural-variant-analysis/SKILL.md and read by Ahel’s review.

Systematic analysis of structural variants (deletions, duplications, inversions, translocations, complex rearrangements) for clinical genomics interpretation using ACMG-adapted criteria.

KEY PRINCIPLES:

  1. Report-first approach - Create SV_analysis_report.md FIRST, then populate progressively
  2. ACMG-style classification - Pathogenic/Likely Pathogenic/VUS/Likely Benign/Benign with explicit evidence
  3. Evidence grading - Grade all findings by confidence level (★★★/★★☆/★☆☆)
  4. Dosage sensitivity critical - Gene dosage effects drive SV pathogenicity
  5. Breakpoint precision matters - Exact gene disruption vs dosage-only effects
  6. Population context essential - gnomAD SVs for frequency assessment
  7. English-first queries - Always use English terms in tool calls (gene names, disease names), even if the user writes in another language. Only try original-language terms as a fallback. Respond in the user's language

Problem This Skill Solves

Structural variants (SVs) present unique interpretation challenges:

  1. Complex molecular consequences - SVs can cause gene dosage changes, gene disruption, gene fusions, position effects
  2. Size matters - Pathogenicity depends on size, gene content, and breakpoint precision
  3. Limited databases - Fewer curated SVs in ClinVar compared to SNVs
  4. Dosage sensitivity - Haploinsufficiency and triplosensitivity are critical but gene-specific
  5. Population frequency - Large benign CNVs are common; distinguishing pathogenic from benign is challenging

This skill provides: A systematic workflow integrating SV classification, gene content analysis, dosage sensitivity assessment, population frequencies, and ACMG-adapted criteria into clinically actionable interpretations.


Triggers

Use this skill when users:

  • Ask about structural variant interpretation
  • Have CNV data from array or sequencing
  • Ask "is this deletion/duplication pathogenic?"
  • Need ACMG classification for SVs
  • Want to assess gene dosage effects
  • Ask about chromosomal rearrangements
  • Have large-scale genomic alterations requiring interpretation

Workflow Overview

┌─────────────────────────────────────────────────────────────────┐
│              STRUCTURAL VARIANT INTERPRETATION                   │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  Phase 1: SV IDENTITY & CLASSIFICATION                          │
│  ├── Normalize SV coordinates (hg19/hg38)                       │
│  ├── Determine SV type (DEL/DUP/INV/TRA/CPX)                   │
│  ├── Calculate SV size                                          │
│  └── Assess breakpoint precision                                │
│                                                                  │
│  Phase 2: GENE CONTENT ANALYSIS                                  │
│  ├── Identify genes fully contained in SV                       │
│  ├── Identify genes with breakpoints (disrupted)                │
│  ├── Annotate gene function and disease associations            │
│  ├── Identify regulatory elements affected                      │
│  └── Assess gene orientation (for inversions/translocations)    │
│                                                                  │
│  Phase 3: DOSAGE SENSITIVITY ASSESSMENT                          │
│  ├── ClinGen dosage sensitivity scores                          │
│  │   └─ Haploinsufficiency / Triplosensitivity ratings          │
│  ├── DECIPHER haploinsufficiency predictions                    │
│  ├── pLI scores (gnomAD) for loss-of-function intolerance       │
│  ├── OMIM gene-disease associations (dominant/recessive)        │
│  └── Known dosage-sensitive genes from literature               │
│                                                                  │
│  Phase 4: POPULATION FREQUENCY CONTEXT                           │
│  ├── gnomAD SV database (overlapping SVs)                       │
│  ├── DGV (Database of Genomic Variants)                         │
│  ├── ClinVar (known pathogenic/benign SVs)                      │
│  └── Calculate reciprocal overlap with population SVs           │
│                                                                  │
│  Phase 5: PATHOGENICITY SCORING                                  │
│  ├── Pathogenicity score (0-10 scale)                           │
│  │   ├─ Gene content weight (40%)                               │
│  │   ├─ Dosage sensitivity weight (30%)                         │
│  │   ├─ Population frequency weight (20%)                       │
│  │   └─ Inheritance/phenotype match weight (10%)                │
│  ├── Apply ACMG SV criteria                                     │
│  └── Generate classification recommendation                      │
│                                                                  │
│  Phase 6: LITERATURE & CLINICAL EVIDENCE                         │
│  ├── PubMed: Similar SVs, gene disruption studies               │
│  ├── DECIPHER: Developmental disorder cases                     │
│  ├── Clinical case reports                                      │
│  └── Functional evidence for gene dosage effects                │
│                                                                  │
│  Phase 7: ACMG-ADAPTED CLASSIFICATION                            │
│  ├── Apply SV-specific evidence codes                           │
│  ├── Calculate final classification                             │
│  ├── Identify limiting factors                                  │
│  └── Generate clinical recommendations                          │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Phase Details

Phase 1: SV Identity & Classification

Goal: Standardize SV notation and classify type

SV Types:

TypeAbbreviationDescriptionMolecular Effect
DeletionDELLoss of genomic segmentHaploinsufficiency, gene disruption
DuplicationDUPGain of genomic segmentTriplosensitivity, gene dosage imbalance
InversionINVSegment flipped in orientationGene disruption at breakpoints, position effects
TranslocationTRASegment moved to different chromosomeGene fusions, disruption, position effects
ComplexCPXMultiple rearrangement typesVariable effects

Key Information to Capture:

  • Chromosome(s) involved
  • Coordinates (start, end) in hg19/hg38
  • SV size (bp or Mb)
  • SV type (DEL/DUP/INV/TRA/CPX)
  • Breakpoint precision (±50bp, ±1kb, etc.)
  • Inheritance pattern (de novo, inherited, unknown)

Example:

SV: arr[GRCh38] 17q21.31(44039927-44352659)x1
- Type: Deletion (heterozygous)
- Size: 313 kb
- Genes: MAPT, KANSL1 (fully contained)
- Breakpoints: Well-defined (array resolution ±5kb)

Phase 2: Gene Content Analysis

Goal: Comprehensive annotation of genes affected by SV

Tools:

ToolPurposeKey Data
Ensembl_lookup_geneGene structure, coordinatesGene boundaries, exons, transcripts
NCBI_gene_searchGene informationOfficial symbol, aliases, description
Gene_Ontology_get_term_infoGene functionBiological process, molecular function
OMIM_search, OMIM_get_entryDisease associationsInheritance, clinical features
DisGeNET_search_geneGene-disease associationsEvidence scores

Gene Categories:

  1. Fully contained genes - Entire gene within SV boundaries

    • Deletion: Complete loss of one copy (haploinsufficiency)
    • Duplication: Extra copy (triplosensitivity)
  2. Partially disrupted genes - Breakpoint within gene

    • Likely loss-of-function for affected allele
    • Check if critical domains disrupted
  3. Flanking genes - Within 1 Mb of breakpoints

    • May be affected by position effects
    • Regulatory disruption possible

Example Gene Content Analysis:

def analyze_gene_content(tu, chrom, sv_start, sv_end, sv_type):
    """
    Identify and annotate all genes within SV region.
    """
    genes = {
        'fully_contained': [],
        'partially_disrupted': [],
        'flanking': []
    }

    # Use Ensembl to find overlapping genes
    # This is pseudocode - actual implementation depends on available tools

    for gene in genes_in_region:
        gene_start = gene['start']
        gene_end = gene['end']

        # Classify gene relationship to SV
        if gene_start >= sv_start and gene_end <= sv_end:
            # Fully contained
            gene_info = annotate_gene(tu, gene['symbol'])
            genes['fully_contained'].append(gene_info)

        elif (gene_start < sv_start < gene_end) or (gene_start < sv_end < gene_end):
            # Partially disrupted
            gene_info = annotate_gene(tu, gene['symbol'])
            genes['partially_disrupted'].append(gene_info)

        elif abs(gene_start - sv_end) < 1000000 or abs(gene_end - sv_start) < 1000000:
            # Flanking (within 1 Mb)
            gene_info = annotate_gene(tu, gene['symbol'])
            genes['flanking'].append(gene_info)

    return genes

def annotate_gene(tu, gene_symbol):
    """
    Comprehensive gene annotation.
    """
    # OMIM associations
    omim = tu.tools.OMIM_search(
        operation="search",
        query=gene_symbol,
        limit=5
    )

    # DisGeNET associations
    disgenet = tu.tools.DisGeNET_search_gene(
        operation="search_gene",
        gene=gene_symbol,
        limit=10
    )

    # Gene Ontology
    # Note: Need gene ID first
    ncbi = tu.tools.NCBI_gene_search(
        term=gene_symbol,
        organism="human"
    )

    return {
        'symbol': gene_symbol,
        'omim': omim,
        'disgenet': disgenet,
        'ncbi': ncbi
    }

Report Section:

### 2.1 Fully Contained Genes (Complete Dosage Effect)

| Gene | Function | Disease Association | Inheritance | Evidence |
|------|----------|---------------------|-------------|----------|
| **MAPT** | Microtubule-associated protein tau | Frontotemporal dementia (AD) | Autosomal Dominant | ★★★ |
| **KANSL1** | Histone acetyltransferase complex | Koolen-De Vries syndrome (AD) | Autosomal Dominant | ★★★ |

**Interpretation**: Deletion results in haploinsufficiency of two dosage-sensitive genes. KANSL1 haploinsufficiency is the primary cause of pathogenicity.

*Sources: OMIM, DisGeNET, Ensembl*

### 2.2 Partially Disrupted Genes (Breakpoint Within Gene)

| Gene | Breakpoint Location | Effect | Critical Domains Lost |
|------|-------------------|--------|----------------------|
| **NF1** | Intron 28 of 58 | 5' portion deleted | Yes - GTPase-activating domain |

**Interpretation**: Breakpoint disrupts NF1 coding sequence, likely resulting in loss-of-function. NF1 is haploinsufficient (causes neurofibromatosis type 1).

### 2.3 Flanking Genes (Potential Position Effects)

| Gene | Distance from SV | Regulatory Risk | Evidence |
|------|------------------|-----------------|----------|
| **KCNJ2** | 450 kb upstream | Low | ★☆☆ |

**Note**: Position effects are possible but less common. Consider if phenotype unexplained by contained genes.

Phase 3: Dosage Sensitivity Assessment

Goal: Determine if affected genes are dosage-sensitive

Tools:

ToolPurposeKey Data
ClinGen_search_dosage_sensitivityGold standard curationHI/TS scores (0-3)
ClinGen_search_gene_validityGene-disease validityDefinitive/Strong/Moderate
gnomad_search (pLI)Loss-of-function intolerancepLI score (0-1)
DECIPHER_searchDevelopmental disordersPatient phenotypes with similar SVs
OMIM_get_entryInheritance patternAD/AR indicates dosage sensitivity

ClinGen Dosage Sensitivity Scores:

ScoreHaploinsufficiency (HI)Triplosensitivity (TS)Interpretation
3Sufficient evidenceSufficient evidenceGene IS dosage-sensitive
2Emerging evidenceEmerging evidenceLikely dosage-sensitive
1Little evidenceLittle evidenceInsufficient evidence
0No evidenceNo evidenceNo established dosage sensitivity

pLI Score Interpretation (gnomAD):

pLI RangeInterpretationLoF Intolerance
≥0.9Extremely intolerantHigh - likely haploinsufficient
0.5-0.9Moderately intolerantModerate
<0.5TolerantLow - likely NOT haploinsufficient

Implementation:

def assess_dosage_sensitivity(tu, gene_list):
    """
    Assess dosage sensitivity for all genes in SV.
    Returns dosage scores and interpretation.
    """
    dosage_data = []

    for gene_symbol in gene_list:
        # 1. ClinGen dosage sensitivity (gold standard)
        clingen = tu.tools.ClinGen_search_dosage_sensitivity(
            gene=gene_symbol
        )

        hi_score = None
        ts_score = None
        if clingen.get('data'):
            for entry in clingen['data']:
                hi_score = entry.get('Haploinsufficiency Score')
                ts_score = entry.get('Triplosensitivity Score')
                break

        # 2. ClinGen gene validity (supports dosage sensitivity)
        validity = tu.tools.ClinGen_search_gene_validity(
            gene=gene_symbol
        )

        validity_level = None
        if validity.get('data'):
            for entry in validity['data']:
                validity_level = entry.get('Classification')
                break

        # 3. pLI score from gnomAD (if available via gene search)
        # Note: May need to use myvariant or other tools
        # pli_score = get_pli_score(tu, gene_symbol)

        # 4. OMIM inheritance pattern
        omim = tu.tools.OMIM_search(
            operation="search",
            query=gene_symbol,
            limit=3
        )

        inheritance_pattern = None
        if omim.get('data', {}).get('entries'):
            for entry in omim['data']['entries']:
                mim = entry.get('mimNumber')
                details = tu.tools.OMIM_get_entry(
                    operation="get_entry",
                    mim_number=str(mim)
                )
                # Extract inheritance from details
                # inheritance_pattern = parse_inheritance(details)

        # Integrate evidence
        dosage_assessment = {
            'gene': gene_symbol,
            'hi_score': hi_score,
            'ts_score': ts_score,
            'validity_level': validity_level,
            'inheritance': inheritance_pattern,
            'is_dosage_sensitive': (hi_score == '3' or ts_score == '3'),
            'evidence_grade': calculate_evidence_grade(hi_score, ts_score, validity_level)
        }

        dosage_data.append(dosage_assessment)

    return dosage_data

def calculate_evidence_grade(hi_score, ts_score, validity):
    """
    Calculate evidence grade for dosage sensitivity.
    """
    if (hi_score == '3' or ts_score == '3') and validity == 'Definitive':
        return '★★★'  # High confidence
    elif (hi_score in ['2', '3'] or ts_score in ['2', '3']):
        return '★★☆'  # Moderate confidence
    else:
        return '★☆☆'  # Low confidence

Report Section:

### 3. Dosage Sensitivity Assessment

#### Haploinsufficient Genes (Deletions/Disruptions)

| Gene | ClinGen HI Score | pLI | Validity | Disease | Evidence |
|------|-----------------|-----|----------|---------|----------|
| **KANSL1** | 3 (Sufficient) | 0.99 | Definitive | Koolen-De Vries syndrome | ★★★ |
| **MAPT** | 2 (Emerging) | 0.85 | Strong | FTD (rare) | ★★☆ |

**Interpretation**: KANSL1 has definitive evidence for haploinsufficiency. Deletion of one copy is expected to cause Koolen-De Vries syndrome (intellectual disability, hypotonia, distinctive facial features).

*Sources: ClinGen Dosage Sensitivity Map, gnomAD pLI*

#### Triplosensitive Genes (Duplications)

| Gene | ClinGen TS Score | Disease Mechanism | Evidence |
|------|-----------------|-------------------|----------|
| **MECP2** | 3 (Sufficient) | MECP2 duplication syndrome | ★★★ |
| **PMP22** | 3 (Sufficient) | Charcot-Marie-Tooth 1A | ★★★ |

**Note**: For this deletion, triplosensitivity is not applicable. Listed for reference.

#### Non-Dosage-Sensitive Genes

| Gene | HI Score | TS Score | Interpretation |
|------|----------|----------|----------------|
| **GENE_X** | 0 | 0 | No established dosage sensitivity |
| **GENE_Y** | 1 | 1 | Insufficient evidence |

**Interpretation**: These genes lack evidence for dosage sensitivity. Deletion/duplication less likely to be pathogenic solely due to these genes.

Phase 4: Population Frequency Context

Goal: Determine if SV is common in general population (likely benign) or rare (supports pathogenicity)

Tools:

ToolPurposeKey Data
gnomad_searchPopulation SV frequenciesOverlapping SVs, frequencies
ClinVar_search_variantsKnown pathogenic/benign SVsClassification, review status
DECIPHER_searchPatient SVs with phenotypesCase reports, phenotype similarity

Frequency Interpretation (adapted from ACMG):

SV FrequencyACMG CodeInterpretation
≥1% in gnomAD SVsBA1 (Stand-alone Benign)Too common for rare disease
0.1-1%BS1 (Strong Benign)Likely benign common variant
<0.01%PM2 (Supporting Pathogenic)Rare, supports pathogenicity
AbsentPM2 (Supporting)Very rare, supports pathogenicity

Reciprocal Overlap Calculation:

For proper comparison, calculate reciprocal overlap between query SV and population SV:

Reciprocal Overlap = min(overlap_with_A, overlap_with_B)
where:
  overlap_with_A = (overlap length) / (SV_A length)
  overlap_with_B = (overlap length) / (SV_B length)

Threshold: ≥70% reciprocal overlap = "same" SV

Implementation:

def assess_population_frequency(tu, chrom, sv_start, sv_end, sv_type):
    """
    Check population databases for overlapping SVs.
    """
    # 1. Check ClinVar for known pathogenic/benign SVs
    clinvar = tu.tools.ClinVar_search_variants(
        chromosome=str(chrom),
        start=sv_start,
        stop=sv_end,
        variant_type=sv_type.upper()
    )

    known_svs = []
    if clinvar.get('data'):
        for variant in clinvar['data']:
            classification = variant.get('clinical_significance')
            known_svs.append({
                'database': 'ClinVar',
                'classification': classification,
                'review_status': variant.get('review_status'),
                'coordinates': f"{variant.get('chromosome')}:{variant.get('start')}-{variant.get('stop')}"
            })

    # 2. gnomAD SVs (if available)
    # Note: gnomAD SV database may not have direct API access via ToolUniverse
    # May need to use genomic coordinate search

    # 3. DECIPHER for similar patient cases
    decipher_search = tu.tools.DECIPHER_search(
        query=f"chr{chrom}:{sv_start}-{sv_end}",
        search_type="region"
    )

    patient_cases = []
    if decipher_search.get('data'):
        patient_cases = decipher_search['data']

    return {
        'clinvar_matches': known_svs,
        'decipher_cases': patient_cases,
        'frequency_interpretation': interpret_frequency(known_svs)
    }

def interpret_frequency(known_svs):
    """
    Interpret frequency based on ClinVar matches.
    """
    if any(sv['classification'] == 'Benign' for sv in known_svs):
        return {
            'acmg_code': 'BA1 or BS1',
            'interpretation': 'Likely benign based on ClinVar benign classification',
            'evidence_grade': '★★★'
        }
    elif any(sv['classification'] == 'Pathogenic' for sv in known_svs):
        return {
            'acmg_code': 'PS1',
            'interpretation': 'Pathogenic based on ClinVar pathogenic classification',
            'evidence_grade': '★★★'
        }
    else:
        return {
            'acmg_code': 'PM2',
            'interpretation': 'Rare variant, not found in ClinVar or population databases',
            'evidence_grade': '★★☆'
        }

Report Section:

### 4. Population Frequency Context

#### ClinVar Matches (Overlapping SVs)

| VCV ID | Classification | Size | Overlap | Review Status | Genes |
|--------|----------------|------|---------|---------------|-------|
| VCV000012345 | Pathogenic | 320 kb | 95% reciprocal | ★★★ Reviewed by expert panel | KANSL1, MAPT |

**Match Found**: Query deletion has 95% reciprocal overlap with known pathogenic deletion in ClinVar (VCV000012345). This is the Koolen-De Vries syndrome deletion.

**ACMG Code**: **PS1** (Strong) - Same genomic region as established pathogenic SV

*Source: ClinVar via `ClinVar_search_variants`*

#### gnomAD SV Database

**Search Result**: No overlapping deletions found in gnomAD SV v4.0 (>10,000 genomes)

**Interpretation**: Absence from gnomAD supports rarity and pathogenic potential.

**ACMG Code**: **PM2** (Moderate) - Absent from population databases

*Note: gnomAD SVs queried via browser (no direct API access)*

#### DECIPHER Patient Cases

| Case ID | Phenotype | SV Type | Size | Overlap | Similarity |
|---------|-----------|---------|------|---------|------------|
| 12345 | Intellectual disability, hypotonia | DEL | 315 kb | 98% | High |
| 67890 | Developmental delay, facial dysmorphism | DEL | 305 kb | 92% | High |

**Phenotype Match**: 8/10 DECIPHER patients have intellectual disability and hypotonia, consistent with Koolen-De Vries syndrome.

**ACMG Support**: **PP4** (Supporting) - Patient phenotype consistent with gene's disease association

*Source: DECIPHER via `DECIPHER_search`*

Phase 5: Pathogenicity Scoring

Goal: Quantitative pathogenicity assessment (0-10 scale)

Scoring Components:

  1. Gene Content (40 points max):

    • 10 points per dosage-sensitive gene (HI/TS score 3)
    • 5 points per likely dosage-sensitive gene (score 2)
    • 2 points per gene with disease association
    • Cap at 40 points
  2. Dosage Sensitivity Evidence (30 points max):

    • 30 points: Multiple genes with definitive HI/TS (score 3)
    • 20 points: One gene with definitive HI/TS
    • 10 points: Genes with emerging evidence (score 2)
    • 5 points: Predicted haploinsufficiency (pLI >0.9)
  3. Population Frequency (20 points max):

    • 20 points: Absent from gnomAD, DGV
    • 10 points: Rare (<0.01%)
    • 0 points: Common (>0.1%)
    • -20 points: Very common (>1%) - likely benign
  4. Clinical Evidence (10 points max):

    • 10 points: Matching ClinVar pathogenic SV
    • 8 points: DECIPHER cases with matching phenotype
    • 5 points: Literature support for gene dosage effects
    • 3 points: Phenotype consistent with genes

Pathogenicity Score Interpretation:

ScoreClassificationConfidenceInterpretation
9-10Pathogenic★★★High confidence pathogenic
7-8Likely Pathogenic★★☆Strong evidence for pathogenicity
4-6VUS★☆☆Uncertain significance
2-3Likely Benign★★☆Strong evidence for benign
0-1Benign★★★High confidence benign

Implementation:

def calculate_pathogenicity_score(gene_content, dosage_data, frequency_data, clinical_data):
    """
    Calculate comprehensive pathogenicity score (0-10 scale).
    """
    score = 0
    breakdown = {}

Shortened here. Read the whole file on GitHub.

Signals

GitHub stars
3k
Forks
412
Last commit
Jul 2026
Advanced
Item type
skill
Key
tooluniverse-structural-variant-analysis
Source
github.com/freedomintelligence/openclaw-medical-skills