/bio-epidemiological-genomics-variant-surveillance
Assign pathogen lineages and track variants using Nextclade and pangolin for viral surveillance. Monitor variant prevalence and identify emerging variants of concern. Use when classifying viral sequences, tracking lineage dynamics, or monitoring for variants of concern.
$ npx -y skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-epidemiological-genomics-variant-surveillance --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/bio-epidemiological-genomics-variant-surveillance
Context preview
The summary Claude sees to decide when to auto-load this skill.
Assign pathogen lineages and track variants using Nextclade and pangolin for viral surveillance. Monitor variant prevalence and identify emerging variants of concern. Use when classifying viral sequences, tracking lineage dynamics, or monitoring for variants of concern.
SKILL.md
bio-epidemiological-genomics-variant-surveillance.SKILL.mdname: bio-epidemiological-genomics-variant-surveillance
description: Assign pathogen lineages and track variants using Nextclade and pangolin for viral surveillance. Monitor variant prevalence and identify emerging variants of concern. Use when classifying viral sequences, tracking lineage dynamics, or monitoring for variants of concern.
tool_type: cli
primary_tool: nextclade
Version Compatibility
Reference examples tested with: Nextclade 3.3+, ggplot2 3.5+, pandas 2.2+
Before using code patterns, verify installed versions match. If versions differ:
- Python: `pip show <package>` then `help(module.function)` to check signatures
- CLI: `<tool> --version` then `<tool> --help` to confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Variant Surveillance
**"Classify my viral sequences into lineages"** → Assign pathogen lineages and track variants of concern using Nextclade or pangolin for real-time genomic surveillance.
- CLI: `nextclade run -d sars-cov-2 -i sequences.fasta`
- CLI: `pangolin sequences.fasta` for SARS-CoV-2 Pango lineage assignment
Nextclade CLI
# Install Nextclade
npm install -g @nextstrain/nextclade
# Or download binary
curl -fsSL "https://github.com/nextstrain/nextclade/releases/latest/download/nextclade-x86_64-unknown-linux-gnu" -o nextclade
chmod +x nextclade
# List available datasets
nextclade dataset list
# Download dataset (e.g., SARS-CoV-2)
nextclade dataset get --name sars-cov-2 --output-dir data/sars-cov-2
# Run analysis
nextclade run \
--input-dataset data/sars-cov-2 \
--output-tsv results.tsv \
--output-json results.json \
sequences.fastaPangolin for SARS-CoV-2
# Install pangolin
pip install pangolin
# Update lineage definitions
pangolin --update
# Run lineage assignment
pangolin sequences.fasta -o pangolin_results.csv
# With specific version
pangolin sequences.fasta --analysis-mode accurate -o results.csv
Parse Nextclade Results
import pandas as pd
def parse_nextclade(results_file):
'''Parse Nextclade TSV output
Key columns:
- seqName: Sequence identifier
- clade: Nextstrain clade (e.g., 21L for Omicron BA.2)
- Nextclade_pango: Pangolin lineage
- qc.overallStatus: Quality control status
- substitutions: List of mutations
- aaSubstitutions: Amino acid changes
'''
df = pd.read_csv(results_file, sep='\t')
# Filter by QC status
df['pass_qc'] = df['qc.overallStatus'].isin(['good', 'mediocre'])
return df
def summarize_lineages(results_df, lineage_col='Nextclade_pango'):
'''Summarize lineage distribution'''
# Filter passed QC
passed = results_df[results_df['pass_qc']]
summary = {
'total_sequences': len(results_df),
'passed_qc': len(passed),
'unique_lineages': passed[lineage_col].nunique(),
'lineage_counts': passed[lineage_col].value_counts().to_dict()
}
return summaryTrack Variants of Concern
**Goal:** Classify viral sequences into WHO-defined variants of concern and track their prevalence over time.
**Approach:** Map Pango lineages to VOC labels using pattern matching, then group by time period and compute proportional representation of each VOC.
# WHO Variants of Concern/Interest definitions
VOC_DEFINITIONS = {
'Alpha': {'lineages': ['B.1.1.7', 'Q.*'], 'key_mutations': ['N501Y', 'P681H']},
'Beta': {'lineages': ['B.1.351'], 'key_mutations': ['K417N', 'E484K', 'N501Y']},
'Gamma': {'lineages': ['P.1'], 'key_mutations': ['K417T', 'E484K', 'N501Y']},
'Delta': {'lineages': ['B.1.617.2', 'AY.*'], 'key_mutations': ['L452R', 'P681R']},
'Omicron': {'lineages': ['B.1.1.529', 'BA.*', 'XBB.*'], 'key_mutations': ['G339D', 'N501Y']}
}
def classify_voc(lineage):
'''Classify lineage as VOC'''
for voc, definition in VOC_DEFINITIONS.items():
for pattern in definition['lineages']:
if pattern.endswith('*'):
if lineage.startswith(pattern[:-1]):
return voc
elif lineage == pattern:
return voc
return 'Other'
def track_voc_prevalence(results_df, date_col='collection_date'):
'''Track variant of concern prevalence over time'''
results_df = results_df.copy()
results_df['VOC'] = results_df['Nextclade_pango'].apply(classify_voc)
# Group by week
results_df['week'] = pd.to_datetime(results_df[date_col]).dt.to_period('W')
prevalence = results_df.groupby(['week', 'VOC']).size().unstack(fill_value=0)
prevalence_pct = prevalence.div(prevalence.sum(axis=1), axis=0) * 100
return prevalence_pctMutation Analysis
def parse_mutations(mutation_string):
'''Parse Nextclade mutation string
Format: 'A123T,C456G' (nucleotide) or 'S:N501Y,S:D614G' (amino acid)
'''
if pd.isna(mutation_string) or mutation_string == '':
return []
return mutation_string.split(',')
def find_mutation_prevalence(results_df, mutation_col='aaSubstitutions'):
'''Calculate prevalence of each mutation'''
all_mutations = []
for muts in results_df[mutation_col].dropna():
all_mutations.extend(parse_mutations(muts))
mutation_counts = pd.Series(all_mutations).value_counts()
mutation_prevalence = mutation_counts / len(results_df) * 100
return mutation_prevalence
def detect_emerging_mutations(results_df, date_col='collection_date', threshold=5):
'''Detect mutations increasing in frequency'''
# Goal: Flag mutations showing rapid prevalence increase between
# early and recent time periods (>2-fold increase above threshold).
# Approach: Split data at median date, compute per-mutation prevalence
# in each half, and report mutations with significant frequency gains.
results_df = results_df.copy()
results_df['date'] = pd.to_datetime(results_df[date_coRead more
name: bio-epidemiological-genomics-variant-surveillance description: Assign pathogen lineages and track variants using Nextclade and pangolin for viral surveillance. Monitor variant prevalence and identify emerging variants of concern. Use when classifying viral sequences, tracking lineage dynamics, or monitoring for variants of concern. tool_type: cli primary_tool: nextclade
Version Compatibility
Reference examples tested with: Nextclade 3.3+, ggplot2 3.5+, pandas 2.2+
Before using code patterns, verify installed versions match. If versions differ:
- Python: `pip show <package>` then `help(module.function)` to check signatures
- CLI: `<tool> --version` then `<tool> --help` to confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Variant Surveillance
**"Classify my viral sequences into lineages"** → Assign pathogen lineages and track variants of concern using Nextclade or pangolin for real-time genomic surveillance.
- CLI: `nextclade run -d sars-cov-2 -i sequences.fasta`
- CLI: `pangolin sequences.fasta` for SARS-CoV-2 Pango lineage assignment
Nextclade CLI
# Install Nextclade
npm install -g @nextstrain/nextclade
# Or download binary
curl -fsSL "https://github.com/nextstrain/nextclade/releases/latest/download/nextclade-x86_64-unknown-linux-gnu" -o nextclade
chmod +x nextclade
# List available datasets
nextclade dataset list
# Download dataset (e.g., SARS-CoV-2)
nextclade dataset get --name sars-cov-2 --output-dir data/sars-cov-2
# Run analysis
nextclade run \
--input-dataset data/sars-cov-2 \
--output-tsv results.tsv \
--output-json results.json \
sequences.fastaPangolin for SARS-CoV-2
# Install pangolin pip install pangolin # Update lineage definitions pangolin --update # Run lineage assignment pangolin sequences.fasta -o pangolin_results.csv # With specific version pangolin sequences.fasta --analysis-mode accurate -o results.csv
Parse Nextclade Results
import pandas as pd
def parse_nextclade(results_file):
'''Parse Nextclade TSV output
Key columns:
- seqName: Sequence identifier
- clade: Nextstrain clade (e.g., 21L for Omicron BA.2)
- Nextclade_pango: Pangolin lineage
- qc.overallStatus: Quality control status
- substitutions: List of mutations
- aaSubstitutions: Amino acid changes
'''
df = pd.read_csv(results_file, sep='\t')
# Filter by QC status
df['pass_qc'] = df['qc.overallStatus'].isin(['good', 'mediocre'])
return df
def summarize_lineages(results_df, lineage_col='Nextclade_pango'):
'''Summarize lineage distribution'''
# Filter passed QC
passed = results_df[results_df['pass_qc']]
summary = {
'total_sequences': len(results_df),
'passed_qc': len(passed),
'unique_lineages': passed[lineage_col].nunique(),
'lineage_counts': passed[lineage_col].value_counts().to_dict()
}
return summaryTrack Variants of Concern
**Goal:** Classify viral sequences into WHO-defined variants of concern and track their prevalence over time.
**Approach:** Map Pango lineages to VOC labels using pattern matching, then group by time period and compute proportional representation of each VOC.
# WHO Variants of Concern/Interest definitions
VOC_DEFINITIONS = {
'Alpha': {'lineages': ['B.1.1.7', 'Q.*'], 'key_mutations': ['N501Y', 'P681H']},
'Beta': {'lineages': ['B.1.351'], 'key_mutations': ['K417N', 'E484K', 'N501Y']},
'Gamma': {'lineages': ['P.1'], 'key_mutations': ['K417T', 'E484K', 'N501Y']},
'Delta': {'lineages': ['B.1.617.2', 'AY.*'], 'key_mutations': ['L452R', 'P681R']},
'Omicron': {'lineages': ['B.1.1.529', 'BA.*', 'XBB.*'], 'key_mutations': ['G339D', 'N501Y']}
}
def classify_voc(lineage):
'''Classify lineage as VOC'''
for voc, definition in VOC_DEFINITIONS.items():
for pattern in definition['lineages']:
if pattern.endswith('*'):
if lineage.startswith(pattern[:-1]):
return voc
elif lineage == pattern:
return voc
return 'Other'
def track_voc_prevalence(results_df, date_col='collection_date'):
'''Track variant of concern prevalence over time'''
results_df = results_df.copy()
results_df['VOC'] = results_df['Nextclade_pango'].apply(classify_voc)
# Group by week
results_df['week'] = pd.to_datetime(results_df[date_col]).dt.to_period('W')
prevalence = results_df.groupby(['week', 'VOC']).size().unstack(fill_value=0)
prevalence_pct = prevalence.div(prevalence.sum(axis=1), axis=0) * 100
return prevalence_pctMutation Analysis
def parse_mutations(mutation_string):
'''Parse Nextclade mutation string
Format: 'A123T,C456G' (nucleotide) or 'S:N501Y,S:D614G' (amino acid)
'''
if pd.isna(mutation_string) or mutation_string == '':
return []
return mutation_string.split(',')
def find_mutation_prevalence(results_df, mutation_col='aaSubstitutions'):
'''Calculate prevalence of each mutation'''
all_mutations = []
for muts in results_df[mutation_col].dropna():
all_mutations.extend(parse_mutations(muts))
mutation_counts = pd.Series(all_mutations).value_counts()
mutation_prevalence = mutation_counts / len(results_df) * 100
return mutation_prevalence
def detect_emerging_mutations(results_df, date_col='collection_date', threshold=5):
'''Detect mutations increasing in frequency'''
# Goal: Flag mutations showing rapid prevalence increase between
# early and recent time periods (>2-fold increase above threshold).
# Approach: Split data at median date, compute per-mutation prevalence
# in each half, and report mutations with significant frequency gains.
results_df = results_df.copy()
results_df['date'] = pd.to_datetime(results_df[date_coThe largest open-source medical AI skill library for OpenClaw.
Other skills on openclaw-medical-skills.
- /aav-vector-design-agent
<!--
Open skill - /adaptyv
Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use
Open skill - /adhd-daily-planner
Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that
Open skill - /aeon
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations
Open skill - /agent-browser
Browse the web for any task — research topics, read articles, interact with web apps, fill forms, take screenshots, extract data, and test web pages. Use whenever a browser would be useful, not just when the user explicitly asks.
Open skill - /agentd-drug-discovery
<!--
Open skill

