Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Perform multi-locus sequence typing (MLST), core genome MLST, and SNP-based strain typing for bacterial isolate characterization using mlst and chewBBACA. Use when identifying strain types, tracking outbreak clones, or characterizing bacterial isolates.
.claude/skills/bio-epidemiological-genomics-pathogen-typing/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-13 | ✗→✓ | ▲ Improved | — | — |
| case-01 | ✗→✓ | ▲ Improved | — | — |
| case-15 | ✗→✓ | ▲ Improved | — | — |
| case-10 | ✗→✓ | ▲ Improved | — | — |
| case-17 | ✓→✓ | = Same ✓ | — | — |
Reference examples tested with: mlst 2.23+, numpy 1.26+, pandas 2.2+, scanpy 1.10+, scipy 1.12+
Before using code patterns, verify installed versions match. If versions differ:
pip show <package> then help(module.function) to check signatures<tool> --version then <tool> --help to confirm flagsIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
"Type my bacterial isolates by MLST" → Assign multi-locus sequence types to bacterial genomes for isolate characterization, outbreak clone identification, and strain tracking.
mlst assembly.fasta for 7-gene MLST typingchewBBACA.py AlleleCall for core genome MLST (cgMLST)bash# Install mlst conda install -c bioconda mlst # Basic MLST typing mlst genome.fasta # Output: genome.fasta ecoli ST131 adk(53) fumC(40) gyrB(47) ... # Batch typing mlst *.fasta > typing_results.tsv # Specify scheme mlst --scheme senterica genome.fasta # List available schemes mlst --list # Include allele sequences in output mlst --csv genome.fasta > results.csv
pythonimport pandas as pd import subprocess def run_mlst(fasta_files, scheme=None): '''Run MLST on multiple genomes Returns DataFrame with: - Sample name - Scheme (auto-detected or specified) - Sequence type (ST) - Allele profiles ST interpretation: - Known ST: Matches existing type in database - Novel allele: New allele combination, may be unreported ST - Failed: Unable to determine (poor assembly or wrong scheme) ''' cmd = ['mlst'] + fasta_files if scheme: cmd.extend(['--scheme', scheme]) result = subprocess.run(cmd, capture_output=True, text=True) lines = result.stdout.strip().split('\n') data = [line.split('\t') for line in lines] return pd.DataFrame(data, columns=['file', 'scheme', 'ST'] + [f'locus{i}' for i in range(1, len(data[0])-2)])
bash# chewBBACA for cgMLST pip install chewbbaca # Download or create schema chewBBACA.py DownloadSchema -sp "Salmonella enterica" -o schema_dir # Run cgMLST chewBBACA.py AlleleCall -i genomes/ -g schema_dir -o results/ # Analyze results chewBBACA.py ExtractCgMLST -i results/results_alleles.tsv \ -o cgmlst_results.tsv --threshold 0.95
Goal: Compute pairwise allelic distances between isolates and cluster them to identify potential outbreak groups.
Approach: Count allelic differences between each pair of isolate profiles (ignoring missing data), then apply single-linkage hierarchical clustering with a pathogen-specific distance threshold.
pythonimport pandas as pd import numpy as np def calculate_cgmlst_distance(profiles): '''Calculate allelic distances between isolates Distance interpretation (typical thresholds): - 0-5 allele differences: Same cluster (likely recent transmission) - 6-15 differences: Related (possible epidemiological link) - >15 differences: Different clones Note: Thresholds are pathogen-specific. Consult literature. ''' n = len(profiles) distances = np.zeros((n, n)) for i in range(n): for j in range(i+1, n): # Count allelic differences (excluding missing data) diff = sum(1 for a, b in zip(profiles.iloc[i], profiles.iloc[j]) if a != b and a != 0 and b != 0) distances[i, j] = distances[j, i] = diff return pd.DataFrame(distances, index=profiles.index, columns=profiles.index) def identify_clusters(distance_matrix, threshold=5): '''Identify cgMLST clusters Threshold values by organism: - E. coli: 10 alleles - Salmonella: 7 alleles - Listeria: 7 alleles - S. aureus: 24 alleles ''' from scipy.cluster.hierarchy import linkage, fcluster # Convert to condensed distance matrix condensed = distance_matrix.values[np.triu_indices(len(distance_matrix), k=1)] # Hierarchical clustering Z = linkage(condensed, method='single') clusters = fcluster(Z, t=threshold, criterion='distance') return dict(zip(distance_matrix.index, clusters))
pythondef snp_typing_from_vcf(vcf_file, reference_positions): '''Extract SNP profile for typing Some organisms use canonical SNP positions for typing (e.g., Mycobacterium tuberculosis lineages) ''' from cyvcf2 import VCF vcf = VCF(vcf_file) profile = {} for pos in reference_positions: chrom, position = pos.split(':') for variant in vcf(f'{chrom}:{position}-{position}'): profile[pos] = variant.ALT[0] if variant.ALT else variant.REF return profile
pythonimport requests def query_enterobase(st, organism='ecoli'): '''Query Enterobase for ST metadata Enterobase provides: - Geographic distribution - Temporal trends - Associated serotypes - Virulence gene profiles ''' # Note: Requires API token url = f'https://enterobase.warwick.ac.uk/api/v2.0/{organism}/sts/{st}' # Would need authentication headers # response = requests.get(url, headers={'Authorization': f'Bearer {token}'}) print(f'Query Enterobase for ST{st}: {url}') return None # Placeholder - requires authentication
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +18 percentage points is the difference between those two pass rates over the 21 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.