bio-variant-annotation
Comprehensive variant annotation using bcftools annotate/csq, VEP, SnpEff, and ANNOVAR. Add database annotations, predict functional consequences, and assess clinical significance with MANE transcript selection and pathogenicity scoring. Use when annotating variants with functional and clinical information.
What this skill does
## Version Compatibility
Reference examples tested with: bcftools 1.19+, VEP 110+, SnpEff 5.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
- Note: SnpEff and SnpSift use single-dash `-version`, not `--version`
If code throws ImportError, AttributeError, or TypeError, introspect the installed
package and adapt the example to match the actual API rather than retrying.
# Variant Annotation
## Tool Comparison
| Tool | Best For | Speed | Output |
|------|----------|-------|--------|
| bcftools csq | Simple consequence prediction | Fast | VCF |
| VEP | Comprehensive with plugins | Moderate | VCF/TXT |
| SnpEff | Fast batch annotation | Fast | VCF |
| ANNOVAR | Flexible databases | Moderate | TXT |
## Normalization Before Annotation
Variant normalization is mandatory before annotation. The same variant represented differently (e.g., left-aligned vs right-aligned indels, multiallelic vs biallelic) produces different annotations. Always normalize first:
```bash
bcftools norm -f reference.fa -m-any input.vcf.gz -Oz -o normalized.vcf.gz
```
The `-m-any` flag splits multiallelic records into biallelic, ensuring each allele gets its own annotation. Without this step, downstream tools may annotate only the first alternate allele or produce ambiguous consequence calls.
## Transcript Selection Strategy
Transcript choice determines which consequence is reported. This single decision changes whether a variant is classified as missense, synonymous, or intronic.
| Strategy | When to Use | Recommended? |
|----------|-------------|--------------|
| MANE Select | Clinical reporting; one transcript per gene | Yes -- current standard |
| MANE Plus Clinical | Genes with clinically relevant non-MANE transcripts | Yes -- supplements MANE Select |
| Canonical (Ensembl) | Legacy pipelines | Being phased out in favor of MANE |
| Longest transcript | Legacy convention | No -- may miss clinically relevant variants in shorter isoforms |
| All transcripts | Research; comprehensive annotation | Good for discovery; report worst consequence per ACMG guidelines |
VEP flags: `--mane_select` adds MANE Select transcript info to output. `--pick` selects one consequence per variant using VEP's internal priority ranking (canonical > biotype > length). For clinical applications, using both together reports the MANE Select consequence when available.
## Tool Concordance
Concordance between VEP, SnpEff, and ANNOVAR is lower than commonly assumed: only 58.52% agreement on HGVSc notation, 84.04% on HGVSp, and 85.58% on coding impact classification. Loss-of-function discrepancies affect ACMG PVS1 interpretation in 33-44% of cases.
Practical implication: for clinical applications, annotate with multiple tools and compare results. For research, pick one tool and apply it consistently across all samples. VEP with MANE Select is the current community standard for clinical genomics.
## Clinical vs Research Annotation
| Aspect | Clinical | Research |
|--------|----------|----------|
| Transcript | MANE Select mandatory | Any consistent approach |
| Tools | VEP + SnpEff cross-validation recommended | Single tool acceptable |
| Pathogenicity | ACMG criteria (PP3/BP4 for computational) | Score-based ranking |
| Reporting | Only clinically significant variants | All variants of interest |
| Databases | ClinVar (reviewed), HGMD (licensed) | ClinVar, gnomAD, research DBs |
| Re-analysis | Required periodically (new evidence) | Optional |
## bcftools annotate
**Goal:** Add or remove INFO/ID annotations from external databases using bcftools.
**Approach:** Match variants by position and allele against annotation VCF/BED/TAB files, copying specified columns.
**"Add rsIDs to my VCF from dbSNP"** -> Match variant positions against a database and copy identifiers or annotation fields into the VCF.
### Add Annotations from Database
```bash
bcftools annotate -a dbsnp.vcf.gz -c ID input.vcf.gz -Oz -o annotated.vcf.gz
```
### Annotation Columns (`-c`)
| Option | Description |
|--------|-------------|
| `ID` | Copy ID column |
| `INFO` | Copy all INFO fields |
| `INFO/TAG` | Copy specific INFO field |
| `+INFO/TAG` | Add to existing values |
### Add Multiple Annotations
```bash
bcftools annotate -a database.vcf.gz -c ID,INFO/AF,INFO/CAF input.vcf.gz -Oz -o annotated.vcf.gz
```
### Add from BED/TAB Files
```bash
# BED with 4th column as annotation
bcftools annotate -a regions.bed.gz -c CHROM,FROM,TO,INFO/REGION \
-h <(echo '##INFO=<ID=REGION,Number=1,Type=String,Description="Region name">') \
input.vcf.gz -Oz -o annotated.vcf.gz
# Tab file: CHROM POS VALUE
bcftools annotate -a annotations.tab.gz -c CHROM,POS,INFO/SCORE \
-h <(echo '##INFO=<ID=SCORE,Number=1,Type=Float,Description="Custom score">') \
input.vcf.gz -Oz -o annotated.vcf.gz
```
### Remove Annotations
```bash
bcftools annotate -x INFO/DP,INFO/MQ input.vcf.gz -Oz -o clean.vcf.gz
bcftools annotate -x INFO input.vcf.gz -Oz -o minimal.vcf.gz # Remove all INFO
```
### Set ID from Fields
```bash
bcftools annotate --set-id '%CHROM\_%POS\_%REF\_%ALT' input.vcf.gz -Oz -o with_ids.vcf.gz
```
## bcftools csq
**Goal:** Predict functional consequences of variants using gene annotations.
**Approach:** Map variants to GFF3 gene models and classify as synonymous, missense, frameshift, etc.
Simple consequence prediction using GFF annotation.
```bash
bcftools csq -f reference.fa -g genes.gff3.gz input.vcf.gz -Oz -o consequences.vcf.gz
```
### Consequence Types
| Consequence | Description |
|-------------|-------------|
| `synonymous` | No amino acid change |
| `missense` | Amino acid change |
| `stop_gained` | Introduces stop codon |
| `frameshift` | Changes reading frame |
| `splice_donor/acceptor` | Affects splicing |
## Ensembl VEP
**Goal:** Annotate variants comprehensively with consequence, impact, pathogenicity scores, and population frequencies.
**Approach:** Run VEP with offline cache, enabling SIFT, PolyPhen, HGVS, frequency, and plugin-based predictions.
**"Annotate my variants with functional consequences"** -> Predict coding effects, impact severity, and pathogenicity using Ensembl's Variant Effect Predictor.
### Installation
```bash
conda install -c bioconda ensembl-vep
vep_install -a cf -s homo_sapiens -y GRCh38 --CONVERT
```
### Basic Annotation
```bash
vep -i input.vcf -o output.vcf --vcf --cache --offline
```
### Comprehensive Annotation
```bash
vep -i input.vcf -o output.vcf \
--vcf \
--cache --offline \
--species homo_sapiens \
--assembly GRCh38 \
--everything \
--fork 4
```
### --everything Enables
- `--sift b` - SIFT predictions
- `--polyphen b` - PolyPhen predictions
- `--hgvs` - HGVS nomenclature
- `--symbol` - Gene symbols
- `--canonical` - Canonical transcript
- `--af` - 1000 Genomes frequencies
- `--af_gnomade/g` - gnomAD frequencies
- `--pubmed` - PubMed IDs
### Filter by Impact
```bash
vep -i input.vcf -o output.vcf --vcf \
--cache --offline \
--pick \
--filter "IMPACT in HIGH,MODERATE"
```
### Plugins
```bash
# CADD scores
vep -i input.vcf -o output.vcf --vcf \
--cache --offline \
--plugin CADD,whole_genome_SNVs.tsv.gz
# dbNSFP (multiple predictors)
vep -i input.vcf -o output.vcf --vcf \
--cache --offline \
--plugin dbNSFP,dbNSFP4.3a.gz,ALL
# Multiple plugins
vep -i input.vcf -o output.vcf --vcf \
--cache --offline \
--plugin CADD,cadd.tsv.gz \
--plugin dbNSFP,dbnsfp.gz,SIFT_score,Polyphen2_HDIV_score \
--plugin SpliceAI,spliceai.vcf.gz
```
### VEP Output Fields
| Field | Description |
|-------|-------------|
| Consequence | SO term (e.g., missense_variant) |
| IMPACT | HIGH, MODERATE, LOW, MODIFIER |
| SYMBOL | Gene symbol |
| HGVSc/HGVSp | HGVS coding/protein change |
| SIFT/PolyPhen | Pathogenicity predictions |
## SnpEff
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.