[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73JHT4003HAZ3J706YKPH7A":3,"skill-same:01M73JHT4003HAZ3J706YKPH7A":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M73JHT4003HAZ3J706YKPH7A","snpeff-variant-annotation",null,"Annotate and filter VCF variants with SnpEff and SnpSift. SnpEff predicts functional effects (HIGH\u002FMODERATE\u002FLOW\u002FMODIFIER), genes, transcripts, AA changes, HGVS; SnpSift filters and adds ClinVar\u002FdbSNP. Java CLI with Python subprocess integration. Use ANNOVAR for multi-database annotation; Ensembl VEP for REST API; SnpEff for fast CLI with pre-built genomes.","bg-szy\u002FTOP-SKILLS","bg-szy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F106576190?v=4","01M73A4E8KPV67SFXRY8XZGNBX","ShuZhiyong","01M73A4E96MQ294MHM74TZBVQD",6,"MIT","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fawesome-skills\u002Fsnpeff-variant-annotation\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: \"snpeff-variant-annotation\"\ndescription: \"Annotate and filter VCF variants with SnpEff and SnpSift. SnpEff predicts functional effects (HIGH\u002FMODERATE\u002FLOW\u002FMODIFIER), genes, transcripts, AA changes, HGVS; SnpSift filters and adds ClinVar\u002FdbSNP. Java CLI with Python subprocess integration. Use ANNOVAR for multi-database annotation; Ensembl VEP for REST API; SnpEff for fast CLI with pre-built genomes.\"\nlicense: \"MIT\"\n---\n\n# SnpEff + SnpSift — Variant Annotation and Filtering\n\n## Overview\n\nSnpEff annotates variants in VCF files by predicting their functional consequences: impact level (HIGH, MODERATE, LOW, MODIFIER), affected gene and transcript, amino acid change, and HGVS notation. SnpSift is the companion tool for filtering, sorting, and enriching annotated VCFs with external databases such as ClinVar and dbSNP. Together they form a fast, self-contained pipeline for going from raw variant calls to biologically interpretable, filtered variant sets. Both tools are Java-based and are invoked from the command line or Python subprocess; pre-built genome databases (hg38, GRCh37, mm10, and 100+ others) are downloaded with a single command.\n\n## When to Use\n\n- Annotating VCF files from GATK, DeepVariant, bcftools, or other callers with predicted gene-level functional consequences before manual review or downstream filtering\n- Prioritizing clinically relevant variants by filtering to HIGH-impact stop-gain, frameshift, and splice-site variants for rare disease or cancer gene panel analysis\n- Adding ClinVar pathogenicity classifications and dbSNP rsIDs to a variant set for cross-study comparison or clinical reporting\n- Extracting structured, tab-delimited fields (gene, protein change, AF, ClinSig) from annotated VCFs into pandas DataFrames for statistical analysis\n- Identifying candidate de novo variants in trio analysis by combining allele frequency thresholds, impact filters, and parent VCF exclusion\n- Use **omics-plotting** SKILL to render consequence\u002Fimpact bar charts from the annotated variant tables\n- Use **ANNOVAR** instead when comprehensive annotation from multiple databases (gnomAD, CADD, SpliceAI) in a single run is required\n- Use **Ensembl VEP** instead when REST API access or VEP-specific plugins (CADD, LOFTEE, SpliceRegion) are needed\n\n## Prerequisites\n\n- **Java**: Java 11+ (required for SnpEff 5.x)\n- **SnpEff JAR**: downloaded from the SnpEff releases page or via conda\u002Fbioconda\n- **Python packages** (optional): `cyvcf2`, `pandas`, `matplotlib`, `seaborn` for Python-side parsing and visualization\n- **Reference genome database**: downloaded once per assembly (e.g., `hg38`, `GRCh37`, `mm10`)\n\n> **Check before installing**: The tool may already be available in the current environment (e.g., inside a `pixi` \u002F `conda` env). Run `command -v snpEff` first and skip the install commands below if it returns a path. When running inside a pixi project, invoke the tool via `pixi run snpEff` rather than bare `snpEff`.\n\n```bash\n# Download SnpEff JAR\nwget https:\u002F\u002Fsnpeff.blob.core.windows.net\u002Fversions\u002FsnpEff_latest_core.zip\nunzip snpEff_latest_core.zip\n# JAR is at snpEff\u002FsnpEff.jar and snpEff\u002FSnpSift.jar\n\n# Or via conda (recommended for reproducibility)\nconda install -c bioconda snpeff\n\n# Verify\njava -jar snpEff\u002FsnpEff.jar -version\n# SnpEff 5.2a (build 2024-02-06)\n\n# Install Python packages for downstream parsing\npip install cyvcf2 pandas matplotlib seaborn\n```\n\n## Pre-flight Interview\n\nSettle these with the user before writing any analysis code.\n\n```yaml\ndecisions:\n  - id: D1\n    param: annotationDatabase\n    kind: required\n    source: upstream\n    ask: \"Which genome database should annotate these variants, and does its assembly match the VCF coordinates?\"\n    default: \"the assembly the variants were called on\"\n\n  - id: D2\n    param: transcriptScope\n    kind: required\n    source: user\n    ask: \"Report the consequence on every transcript of a gene, or only on the canonical one?\"\n    default: \"all transcripts - the worst consequence across them is what most filters use\"\n\n  - id: D3\n    param: filterExpression\n    kind: required\n    source: user\n    ask: \"Which annotated variants should survive into the final table - by predicted impact, population frequency, or clinical significance?\"\n    default: null\n\n  - id: D4\n    param: frequencySkip\n    kind: optional_conditional\n    source: user\n    ask: \"Skip annotating variants already common in the population?\"\n    default: \"annotate everything\"\n\n  - id: D5\n    param: summaryReport\n    kind: optional\n    source: user\n    ask: \"Generate the HTML summary alongside the annotated VCF?\"\n    default: \"generated\"\n\n  - id: D6\n    param: javaHeap\n    kind: never_ask\n    source: data\n    reason: \"Prevents out-of-memory on large VCFs; does not change annotations\"\n    default: \"4-8 GB\"\n```\n\nD3 has no safe default because the filter is the deliverable - a rare-disease\nquestion keeps high-impact rare variants, a pharmacogenomic one keeps known\nclinical annotations regardless of impact. Applying somebody else's filter\nsilently answers their question instead.\n\n## Quick Start\n\n```bash\n# 1. Download the hg38 genome database (one-time setup, ~1 GB)\njava -jar snpEff\u002FsnpEff.jar download hg38\n\n# 2. Annotate variants\njava -jar snpEff\u002FsnpEff.jar \\\n    -v hg38 \\\n    input.vcf.gz \\\n    > annotated.vcf\n\n# 3. Filter to HIGH-impact variants\njava -jar snpEff\u002FSnpSift.jar filter \\\n    \"ANN[*].IMPACT = 'HIGH'\" \\\n    annotated.vcf \\\n    > high_impact.vcf\n\necho \"Done. Check snpEff_summary.html and snpEff_genes.txt for QC stats.\"\n```\n\n## Workflow\n\n### Step 1: Install SnpEff and Download Genome Database\n\nDownload and verify the pre-built genome database for your target assembly. Databases include transcript models from Ensembl or UCSC and are built into SnpEff's local cache directory (`~\u002F.snpEff\u002Fdata\u002F` or `snpEff\u002Fdata\u002F`).\n\n```bash\n# List all available databases (grep for your assembly)\njava -jar snpEff\u002FsnpEff.jar databases | grep -i \"GRCh38\\|hg38\"\n\n# Download hg38 (Homo sapiens, GRCh38)\njava -jar snpEff\u002FsnpEff.jar download hg38\n\n# Download GRCh37 (older assemblies still widely used in clinical pipelines)\njava -jar snpEff\u002FsnpEff.jar download GRCh37.75\n\n# Download mouse mm10\njava -jar snpEff\u002FsnpEff.jar download mm10\n\n# List installed databases\nls ~\u002F.snpEff\u002Fdata\u002F\n```\n\n### Step 2: Annotate VCF with Functional Effects\n\nRun SnpEff annotation to add `ANN` INFO fields to each variant. The `ANN` field encodes pipe-separated annotations per transcript: `Allele|Effect|Impact|Gene|GeneID|Feature|FeatureID|BioType|Rank|HGVS.c|HGVS.p|cDNA_pos|CDS_pos|Protein_pos|Distance|Errors`.\n\n```bash\n# Annotate a gzipped VCF (outputs to stdout, pipe or redirect)\njava -Xmx8g -jar snpEff\u002FsnpEff.jar \\\n    -v \\\n    -stats snpeff_summary.html \\\n    hg38 \\\n    input.vcf.gz \\\n    > annotated.vcf\n\n# Compress and index the output for downstream tools\nbgzip annotated.vcf\ntabix -p vcf annotated.vcf.gz\n\necho \"Annotated variants in annotated.vcf.gz\"\necho \"QC report: snpeff_summary.html\"\necho \"Gene table: snpEff_genes.txt\"\n```\n\n### Step 3: Filter HIGH-Impact Variants with SnpSift\n\nSnpSift `filter` evaluates boolean expressions over INFO and FORMAT fields. The `ANN[*]` syntax iterates over all transcript annotations for each variant — any matching transcript qualifies the variant.\n\n```bash\n# Filter for HIGH-impact variants only (stop-gain, frameshift, splice-site)\njava -jar snpEff\u002FSnpSift.jar filter \\\n    \"ANN[*].IMPACT = 'HIGH'\" \\\n    annotated.vcf.gz \\\n    > high_impact.vcf\n\n# Filter HIGH or MODERATE impact and allele frequency \u003C 1%\n# (requires AF in INFO field, e.g., from GATK or gnomAD annotation)\njava -jar snpEff\u002FSnpSift.jar filter \\\n    \"(ANN[*].IMPACT = 'HIGH' | ANN[*].IMPACT = 'MODERATE') & (AF \u003C 0.01)\" \\\n    annotated.vcf.gz \\\n    > rare_functional.vcf\n\n# Count filtered variants\ngrep -v \"^#\" high_impact.vcf | wc -l\n```\n\n### Step 4: Add ClinVar and dbSNP Annotations\n\nSnpSift `annotate` transfers INFO fields from a reference VCF (ClinVar, dbSNP) to the target VCF by matching on chromosome and position. Download ClinVar and dbSNP VCFs from NCBI FTP before running.\n\n```bash\n# Download reference databases (one-time setup)\n# ClinVar (GRCh38)\nwget https:\u002F\u002Fftp.ncbi.nlm.nih.gov\u002Fpub\u002Fclinvar\u002Fvcf_GRCh38\u002Fclinvar.vcf.gz\nwget https:\u002F\u002Fftp.ncbi.nlm.nih.gov\u002Fpub\u002Fclinvar\u002Fvcf_GRCh38\u002Fclinvar.vcf.gz.tbi\n\n# dbSNP (GRCh38, b156 or later)\nwget https:\u002F\u002Fftp.ncbi.nlm.nih.gov\u002Fsnp\u002Flatest_release\u002FVCF\u002FGCF_000001405.40.gz\nwget https:\u002F\u002Fftp.ncbi.nlm.nih.gov\u002Fsnp\u002Flatest_release\u002FVCF\u002FGCF_000001405.40.gz.tbi\n\n# Annotate with ClinVar CLNSIG and CLNDN fields\njava -jar snpEff\u002FSnpSift.jar annotate \\\n    -info CLNSIG,CLNDN,CLNREVSTAT \\\n    clinvar.vcf.gz \\\n    annotated.vcf.gz \\\n    > annotated_clinvar.vcf\n\n# Annotate with dbSNP rsIDs (adds RS field to INFO)\njava -jar snpEff\u002FSnpSift.jar annotate \\\n    GCF_000001405.40.gz \\\n    annotated_clinvar.vcf \\\n    > annotated_full.vcf\n\necho \"ClinVar + dbSNP annotations added to annotated_full.vcf\"\n```\n\n### Step 5: Extract Fields to Tab-Delimited Output\n\nSnpSift `extractFields` converts VCF annotations into a flat table. Use `ANN[0]` to take the first (most severe) transcript annotation, or `ANN[*]` to expand all transcripts.\n\n```bash\n# Extract key fields: CHROM, POS, REF, ALT, impact, gene, protein change, AF, ClinVar sig\njava -jar snpEff\u002FSnpSift.jar extractFields \\\n    -s \",\" \\\n    -e \".\" \\\n    annotated_full.vcf \\\n    CHROM POS REF ALT \\\n    \"ANN[0].GENE\" \\\n    \"ANN[0].EFFECT\" \\\n    \"ANN[0].IMPACT\" \\\n    \"ANN[0].HGVS_P\" \\\n    \"ANN[0].HGVS_C\" \\\n    \"ANN[0].FEATUREID\" \\\n    AF \\\n    CLNSIG \\\n    CLNDN \\\n    > variants_table.tsv\n\n# Preview\nhead -3 variants_table.tsv\n# CHROM  POS   REF  ALT  ANN[0].GENE  ANN[0].EFFECT            ANN[0].IMPACT  ...\n# chr1   69511 A    G    OR4F5        synonymous_variant        LOW            ...\n# chr1   925952 G   A    SAMD11       missense_variant          MODERATE       ...\n```\n\n### Step 6: Parse Annotated VCF in Python with cyvcf2\n\nUse `cyvcf2` (or `PyVCF2`) for programmatic VCF parsing in Python. `cyvcf2` wraps htslib and is significantly faster than pure-Python parsers.\n\n```python\nimport re\nimport pandas as pd\nfrom cyvcf2 import VCF\n\nrecords = []\n\nfor variant in VCF(\"annotated_full.vcf.gz\"):\n    ann_field = variant.INFO.get(\"ANN\")\n    if ann_field is None:\n        continue\n\n    # Take the first (most severe) annotation transcript\n    first_ann = ann_field.split(\",\")[0].split(\"|\")\n    # ANN field columns (0-indexed): allele, effect, impact, gene, gene_id,\n    # feature_type, feature_id, biotype, rank, hgvs_c, hgvs_p, ...\n    effect   = first_ann[1] if len(first_ann) > 1 else \".\"\n    impact   = first_ann[2] if len(first_ann) > 2 else \".\"\n    gene     = first_ann[3] if len(first_ann) > 3 else \".\"\n    hgvs_p   = first_ann[10] if len(first_ann) > 10 else \".\"\n\n    records.append({\n        \"chrom\":   variant.CHROM,\n        \"pos\":     variant.POS,\n        \"ref\":     variant.REF,\n        \"alt\":     \",\".join(variant.ALT),\n        \"gene\":    gene,\n        \"effect\":  effect,\n        \"impact\":  impact,\n        \"hgvs_p\":  hgvs_p,\n        \"af\":      variant.INFO.get(\"AF\", None),\n        \"clnsig\":  variant.INFO.get(\"CLNSIG\", \".\"),\n    })\n\ndf = pd.DataFrame(records)\nprint(f\"Total variants: {len(df)}\")\nprint(df[\"impact\"].value_counts())\n# HIGH        342\n# MODERATE   4218\n# LOW        8903\n# MODIFIER  51204\n```\n\n### Step 7: Summary Statistics and Consequence Visualization\n\nSummarize variant consequences by impact tier, then **read `skills\u002Fdata-visualization\u002Fomics-plotting\u002FSKILL.md` and follow its \"Box \u002F Violin \u002F Bar\" recipe** on the exported tables (→ `figures\u002Fvariant_consequence_summary.png`).\n\n```python\n# Consequence counts by impact (df from Step 6)\nimpact_order = [\"HIGH\", \"MODERATE\", \"LOW\", \"MODIFIER\"]\nimpact_counts = df[\"impact\"].value_counts().reindex(impact_order, fill_value=0)\n\n# Top 15 effects within HIGH and MODERATE\ntop_effects = (\n    df[df[\"impact\"].isin([\"HIGH\", \"MODERATE\"])]\n    [\"effect\"]\n    .str.replace(\"_\", \" \")\n    .value_counts()\n    .head(15)\n)\n\n# Save summary tables; render bar charts with the omics-plotting SKILL (`skills\u002Fdata-visualization\u002Fomics-plotting\u002FSKILL.md`) \"Box \u002F Violin \u002F Bar\" recipe.\nimpact_counts.rename(\"count\").to_csv(\"variant_impact_counts.csv\")\ntop_effects.rename(\"count\").to_csv(\"variant_top_effects.csv\")\nprint(impact_counts.to_string())\n\n# HIGH-impact gene table\nhigh_genes = (\n    df[df[\"impact\"] == \"HIGH\"][\"gene\"]\n    .value_counts()\n    .head(20)\n    .rename(\"n_high_variants\")\n)\nprint(\"\\nTop genes with HIGH-impact variants:\")\nprint(high_genes.to_string())\n```\n\n## Key Parameters\n\n| Parameter | Default | Range \u002F Options | Effect |\n|-----------|---------|-----------------|--------|\n| `-Xmx` (JVM heap) | JVM default (~256 MB) | `4g`–`32g` | Prevents `OutOfMemoryError` for large WGS VCFs; set to ~4–8 GB per run |\n| `-v` (verbose) | off | flag | Prints per-chromosome progress and summary counts to stderr |\n| `-stats` | `snpEff_summary.html` | any `.html` path | Writes interactive QC summary with consequence pie charts and gene tables |\n| `-noStats` | off | flag | Disables HTML report generation (faster for batch runs) |\n| `-canon` | off | flag | Annotates only the canonical transcript per gene (reduces ANN field size) |\n| `-maxAF` | disabled | `0.0`–`1.0` | Skip annotation for variants with population AF above threshold (requires gnomAD in database) |\n| `filter` expression (SnpSift) | — | boolean expression | `ANN[*].IMPACT = 'HIGH'`, `AF \u003C 0.001 & DP > 10`, `CLNSIG has 'Pathogenic'` |\n| `-s` separator (extractFields) | tab | any string | Field separator in output table; use `\",\"` for CSV |\n| `-e` empty value (extractFields) | empty | any string | Placeholder for missing fields; use `\".\"` for consistency with VCF convention |\n\n## Key Concepts\n\n### ANN Field Structure\n\nEach variant's `ANN` INFO field contains one annotation per predicted transcript consequence, separated by commas. Each annotation is a pipe-delimited string with 16 fields:\n\n```\nANN=T|missense_variant|MODERATE|BRCA1|ENSG00000012048|transcript|ENST00000357654|protein_coding|12\u002F23|c.1234A>T|p.Lys412Met|1234|1234|412|.|\n```\n\nThe first annotation (index 0) is the most severe consequence. Multiple annotations arise when a variant affects multiple transcripts or genes.\n\n### Impact Levels\n\n| Impact | Variant Types | Typical Priority |\n|--------|--------------|-----------------|\n| `HIGH` | Stop-gained, frameshift, splice-donor\u002Facceptor, start-lost | Disease candidate; always review |\n| `MODERATE` | Missense, in-frame indel, splice-region | Pathogenicity depends on conservation and domain context |\n| `LOW` | Synonymous, stop-retained, start-retained | Rarely causal; useful as controls |\n| `MODIFIER` | Intronic, intergenic, UTR, downstream | Background; filter out for most analyses |\n\n### HGVS Notation in ANN\n\nSnpEff provides both cDNA (`HGVS.c`, e.g., `c.1234A>T`) and protein (`HGVS.p`, e.g., `p.Lys412Met`) notation. HGVS fields are empty (`.`) for non-coding variants. The `FEATUREID` field contains the Ensembl or RefSeq transcript ID enabling cross-database lookup.\n\n### SnpSift Filter Syntax\n\nSnpSift filter expressions support comparison operators (`=`, `!=`, `\u003C`, `>`), logical operators (`&`, `|`, `!`), and the `has` operator for substring matching. Use `ANN[*]` to match any annotation transcript, `ANN[0]` for first only:\n\n```\n# Compound filter: rare + damaging + not in ClinVar benign\n(AF \u003C 0.001) & (ANN[*].IMPACT = 'HIGH' | ANN[*].IMPACT = 'MODERATE') & !(CLNSIG has 'Benign')\n```\n\n## Common Recipes\n\n### Recipe: Filter De Novo Candidates (Trio Analysis)\n\nIdentify rare, functionally damaging variants in a proband that are absent from both parents. Combine allele frequency filtering, impact filtering, and VCF subtraction using SnpSift.\n\n```bash\n# Step 1: Annotate proband VCF\njava -jar snpEff\u002FsnpEff.jar -v hg38 proband.vcf.gz > proband_ann.vcf\n\n# Step 2: Filter rare HIGH\u002FMODERATE variants not in either parent\n# Requires proband, mother, and father VCFs to be jointly genotyped or\n# use SnpSift filter on a multi-sample VCF\njava -jar snpEff\u002FSnpSift.jar filter \\\n    \"(ANN[*].IMPACT = 'HIGH' | ANN[*].IMPACT = 'MODERATE') \\\n     & (AF \u003C 0.001 | AF = '.') \\\n     & (GEN[proband].GT != '.\u002F.') \\\n     & (GEN[mother].GT = '0\u002F0' | GEN[mother].GT = '0|0') \\\n     & (GEN[father].GT = '0\u002F0' | GEN[father].GT = '0|0')\" \\\n    proband_ann.vcf \\\n    > denovo_candidates.vcf\n\n# Step 3: Extract to table for review\njava -jar snpEff\u002FSnpSift.jar extractFields \\\n    denovo_candidates.vcf \\\n    CHROM POS REF ALT \"ANN[0].GENE\" \"ANN[0].EFFECT\" \"ANN[0].IMPACT\" \\\n    \"ANN[0].HGVS_P\" AF CLNSIG \\\n    > denovo_candidates.tsv\n\necho \"De novo candidates: $(grep -v '^CHROM' denovo_candidates.tsv | wc -l)\"\n```\n\n### Recipe: Extract Protein-Changing Variants to pandas DataFrame\n\nLoad an annotated VCF directly into pandas using SnpSift `extractFields` output for downstream statistical or ML analysis.\n\n```python\nimport subprocess\nimport io\nimport pandas as pd\n\nVCF_IN   = \"annotated_full.vcf.gz\"\nSNPSIFT  = \"snpEff\u002FSnpSift.jar\"\n\n# Run SnpSift extractFields via subprocess and capture stdout\ncmd = [\n    \"java\", \"-jar\", SNPSIFT, \"extractFields\",\n    \"-s\", \",\", \"-e\", \".\",\n    VCF_IN,\n    \"CHROM\", \"POS\", \"REF\", \"ALT\",\n    \"ANN[0].GENE\", \"ANN[0].EFFECT\", \"ANN[0].IMPACT\",\n    \"ANN[0].HGVS_P\", \"ANN[0].HGVS_C\", \"ANN[0].FEATUREID\",\n    \"AF\", \"DP\", \"CLNSIG\", \"CLNDN\",\n]\nresult = subprocess.run(cmd, capture_output=True, text=True, check=True)\ndf = pd.read_csv(io.StringIO(result.stdout), sep=\"\\t\")\ndf.columns = [c.replace(\"ANN[0].\", \"\") for c in df.columns]  # clean column names\n\n# Keep protein-changing variants only\nprotein_changing = df[df[\"IMPACT\"].isin([\"HIGH\", \"MODERATE\"])].copy()\nprotein_changing[\"AF\"] = pd.to_numeric(protein_changing[\"AF\"], errors=\"coerce\")\nprotein_changing[\"DP\"] = pd.to_numeric(protein_changing[\"DP\"], errors=\"coerce\")\n\nprint(f\"Protein-changing variants: {len(protein_changing)}\")\nprint(protein_changing[[\"GENE\", \"EFFECT\", \"IMPACT\", \"HGVS_P\", \"AF\"]].head(10).to_string(index=False))\n```\n\n### Recipe: Build a Custom Genome Database\n\nWhen working with a non-standard organism or custom assembly, build a SnpEff database from a FASTA + GTF file.\n\n```bash\n# 1. Set up directory structure under SnpEff's data directory\nGENOME_NAME=\"my_organism\"\nmkdir -p snpEff\u002Fdata\u002F${GENOME_NAME}\ncp my_genome.fa snpEff\u002Fdata\u002F${GENOME_NAME}\u002Fsequences.fa\ncp my_annotation.gtf snpEff\u002Fdata\u002F${GENOME_NAME}\u002Fgenes.gtf\n\n# 2. Add genome entry to snpEff.config\necho \"${GENOME_NAME}.genome : My Organism\" >> snpEff\u002FsnpEff.config\n\n# 3. Build the database\njava -jar snpEff\u002FsnpEff.jar build \\\n    -gtf22 \\\n    -v \\\n    ${GENOME_NAME}\n\n# 4. Verify\njava -jar snpEff\u002FsnpEff.jar dump ${GENOME_NAME} | head -20\necho \"Custom database built for ${GENOME_NAME}\"\n```\n\n## Expected Outputs\n\n| File | Format | Contents |\n|------|--------|----------|\n| `annotated.vcf.gz` | bgzipped VCF | Original variants with `ANN` INFO field; one record per variant |\n| `snpEff_summary.html` | HTML | Interactive QC report: consequence pie charts, top genes, transition\u002Ftransversion ratio |\n| `snpEff_genes.txt` | TSV | Per-gene counts of variants by consequence type |\n| `high_impact.vcf` | VCF | Subset of variants with `ANN[*].IMPACT = 'HIGH'` |\n| `annotated_clinvar.vcf` | VCF | Annotated VCF enriched with `CLNSIG`, `CLNDN`, `CLNREVSTAT` from ClinVar |\n| `variants_table.tsv` | TSV | Flat table of extracted fields; one row per variant (first transcript) |\n| `variant_consequence_summary.png` | PNG | Bar charts of impact tiers and top consequence types |\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| `OutOfMemoryError` during annotation | Default JVM heap too small for WGS VCFs | Add `-Xmx8g` (or `-Xmx16g`) before `-jar`: `java -Xmx8g -jar snpEff.jar ...` |\n| `ERROR_CHROMOSOME_NOT_FOUND` for every variant | Chromosome naming mismatch (e.g., `chr1` vs `1`) | Pass `-noCheckChr` flag; or rename contigs in VCF with `bcftools annotate --rename-chrs` |\n| `Database not found` error | Genome database not downloaded | Run `java -jar snpEff.jar download hg38`; check `snpEff\u002Fdata\u002F` directory exists |\n| Empty `ANN` field on all variants | Wrong genome database version relative to VCF reference | Confirm VCF uses the same assembly as the database (e.g., hg38 vs GRCh38 — use `GRCh38.86` for Ensembl builds) |\n| SnpSift filter returns zero variants | Filter expression syntax error or wrong field name | Test expression on small VCF; check `ANN[*].IMPACT` vs `ANN[0].IMPACT`; wrap expression in quotes |\n| `CLNSIG` field missing after `snpSift annotate` | ClinVar VCF not indexed, or contig mismatch | Run `tabix -p vcf clinvar.vcf.gz` before annotating; ensure chromosome names match |\n| `extractFields` output missing HGVS_P column | Variant is non-coding or affects UTR\u002Fintron | Use `-e \".\"` flag to fill empty fields; filter to coding variants first |\n| Very large `ANN` field (thousands of transcripts) | Variant in a region with many overlapping transcripts | Add `-canon` flag to annotate only canonical transcripts, or use `ANN[0]` in downstream filters |\n\n## References\n\n- [SnpEff Documentation](https:\u002F\u002Fpcingola.github.io\u002FSnpEff\u002F) — comprehensive usage guide, ANN field specification, filter syntax\n- [SnpEff GitHub Repository](https:\u002F\u002Fgithub.com\u002Fpcingola\u002FSnpEff) — source code, issue tracker, release notes\n- Cingolani P, et al. (2012) \"A program for annotating and predicting the effects of single nucleotide polymorphisms, SnpEff: SNPs in the genome of Drosophila melanogaster strain w1118.\" *Fly* 6(2):80–92. doi:[10.4161\u002Ffly.19695](https:\u002F\u002Fdoi.org\u002F10.4161\u002Ffly.19695)\n- [ClinVar VCF FTP](https:\u002F\u002Fftp.ncbi.nlm.nih.gov\u002Fpub\u002Fclinvar\u002F) — ClinVar VCF files by assembly\n- [cyvcf2 Documentation](https:\u002F\u002Fbrentp.github.io\u002Fcyvcf2\u002F) — Python VCF parsing library used in Step 6\n","# SnpEff + SnpSift — Variant Annotation and Filtering\n\n## Overview\n\nSnpEff annotates variants in VCF files by predicting their functional consequences: impact level (HIGH, MODERATE, LOW, MODIFIER), affected gene and transcript, amino acid change, and HGVS notation. SnpSift is the companion tool for filtering, sorting, and enriching annotated VCFs with external databases such as ClinVar and dbSNP. Together they form a fast, self-contained pipeline for going from raw variant calls to biologically interpretable, filtered variant sets. Both tools are Java-based and are invoked from the command line or Python subprocess; pre-built genome databases (hg38, GRCh37, mm10, and 100+ others) are downloaded with a single command.\n\n## When to Use\n\n- Annotating VCF files from GATK, DeepVariant, bcftools, or other callers with predicted gene-level functional consequences before manual review or downstream filtering\n- Prioritizing clinically relevant variants by filtering to HIGH-impact stop-gain, frameshift, and splice-site variants for rare disease or cancer gene panel analysis\n- Adding ClinVar pathogenicity classifications and dbSNP rsIDs to a variant set for cross-study comparison or clinical reporting\n- Extracting structured, tab-delimited fields (gene, protein change, AF, ClinSig) from annotated VCFs into pandas DataFrames for statistical analysis\n- Identifying candidate de novo variants in trio analysis by combining allele frequency thresholds, impact filters, and parent VCF exclusion\n- Use **omics-plotting** SKILL to render consequence\u002Fimpact bar charts from the annotated variant tables\n- Use **ANNOVAR** instead when comprehensive annotation from multiple databases (gnomAD, CADD, SpliceAI) in a single run is required\n- Use **Ensembl VEP** instead when REST API access or VEP-specific plugins (CADD, LOFTEE, SpliceRegion) are needed\n\n## Prerequisites\n\n- **Java**: Java 11+ (required for SnpEff 5.x)\n- **SnpEff JAR**: downloaded from the SnpEff releases page or via conda\u002Fbioconda\n- **Python packages** (optional): `cyvcf2`, `pandas`, `matplotlib`, `seaborn` for Python-side parsing and visualization\n- **Reference genome database**: downloaded once per assembly (e.g., `hg38`, `GRCh37`, `mm10`)\n\n> **Check before installing**: The tool may already be available in the current environment (e.g., inside a `pixi` \u002F `conda` env). Run `command -v snpEff` first and skip the install commands below if it returns a path. When running inside a pixi project, invoke the tool via `pixi run snpEff` rather than bare `snpEff`.\n\n```bash\n# Download SnpEff JAR\nwget https:\u002F\u002Fsnpeff.blob.core.windows.net\u002Fversions\u002FsnpEff_latest_core.zip\nunzip snpEff_latest_core.zip\n# JAR is at snpEff\u002FsnpEff.jar and snpEff\u002FSnpSift.jar\n\n# Or via conda (recommended for reproducibility)\nconda install -c bioconda snpeff\n\n# Verify\njava -jar snpEff\u002FsnpEff.jar -version\n# SnpEff 5.2a (build 2024-02-06)\n\n# Install Python packages for downstream parsing\npip install cyvcf2 pandas matplotlib seaborn\n```\n\n## Pre-flight Interview\n\nSettle these with the user before writing any analysis code.\n\n```yaml\ndecisions:\n  - id: D1\n    param: annotationDatabase\n    kind: required\n    source: upstream\n    ask: \"Which genome database should annotate these variants, and does its assembly match the VCF coordinates?\"\n    default: \"the assembly the variants were called on\"\n\n  - id: D2\n    param: transcriptScope\n    kind: required\n    source: user\n    ask: \"Report the consequence on every transcript of a gene, or only on the canonical one?\"\n    default: \"all transcripts - the worst consequence across them is what most filters use\"\n\n  - id: D3\n    param: filterExpression\n    kind: required\n    source: user\n    ask: \"Which annotated variants should survive into the final table - by predicted impact, population frequency, or clinical significance?\"\n    default: null\n\n  - id: D4\n    param: frequencySkip\n    kind: optional_conditional\n    source: user\n    ask: \"Skip annotating variants already common in the population?\"\n    default: \"annotate everything\"\n\n  - id: D5\n    param: summaryReport\n    kind: optional\n    source: user\n    ask: \"Generate the HTML summary alongside the annotated VCF?\"\n    default: \"generated\"\n\n  - id: D6\n    param: javaHeap\n    kind: never_ask\n    source: data\n    reason: \"Prevents out-of-memory on large VCFs; does not change annotations\"\n    default: \"4-8 GB\"\n```\n\nD3 has no safe default because the filter is the deliverable - a rare-disease\nquestion keeps high-impact rare variants, a pharmacogenomic one keeps known\nclinical annotations regardless of impact. Applying somebody else's filter\nsilently answers their question instead.\n\n## Quick Start\n\n```bash\n# 1. Download the hg38 genome database (one-time setup, ~1 GB)\njava -jar snpEff\u002FsnpEff.jar download hg38\n\n# 2. Annotate variants\njava -jar snpEff\u002FsnpEff.jar \\\n    -v hg38 \\\n    input.vcf.gz \\\n    > annotated.vcf\n\n# 3. Filter to HIGH-impact variants\njava -jar snpEff\u002FSnpSift.jar filter \\\n    \"ANN[*].IMPACT = 'HIGH'\" \\\n    annotated.vcf \\\n    > high_impact.vcf\n\necho \"Done. Check snpEff_summary.html and snpEff_genes.txt for QC stats.\"\n```\n\n## Workflow\n\n### Step 1: Install SnpEff and Download Genome Database\n\nDownload and verify the pre-built genome database for your target assembly. Databases include transcript models from Ensembl or UCSC and are built into SnpEff's local cache directory (`~\u002F.snpEff\u002Fdata\u002F` or `snpEff\u002Fdata\u002F`).\n\n```bash\n# List all available databases (grep for your assembly)\njava -jar snpEff\u002FsnpEff.jar databases | grep -i \"GRCh38\\|hg38\"\n\n# Download hg38 (Homo sapiens, GRCh38)\njava -jar snpEff\u002FsnpEff.jar download hg38\n\n# Download GRCh37 (older assemblies still widely used in clinical pipelines)\njava -jar snpEff\u002FsnpEff.jar download GRCh37.75\n\n# Download mouse mm10\njava -jar snpEff\u002FsnpEff.jar download mm10\n\n# List installed databases\nls ~\u002F.snpEff\u002Fdata\u002F\n```\n\n### Step 2: Annotate VCF with Functional Effects\n\nRun SnpEff annotation to add `ANN` INFO fields to each variant. The `ANN` field encodes pipe-separated annotations per transcript: `Allele|Effect|Impact|Gene|GeneID|Feature|FeatureID|BioType|Rank|HGVS.c|HGVS.p|cDNA_pos|CDS_pos|Protein_pos|Distance|Errors`.\n\n```bash\n# Annotate a gzipped VCF (outputs to stdout, pipe or redirect)\njava -Xmx8g -jar snpEff\u002FsnpEff.jar \\\n    -v \\\n    -stats snpeff_summary.html \\\n    hg38 \\\n    input.vcf.gz \\\n    > annotated.vcf\n\n# Compress and index the output for downstream tools\nbgzip annotated.vcf\ntabix -p vcf annotated.vcf.gz\n\necho \"Annotated variants in annotated.vcf.gz\"\necho \"QC report: snpeff_summary.html\"\necho \"Gene table: snpEff_genes.txt\"\n```\n\n### Step 3: Filter HIGH-Impact Variants with SnpSift\n\nSnpSift `filter` evaluates boolean expressions over INFO and FORMAT fields. The `ANN[*]` syntax iterates over all transcript annotations for each variant — any matching transcript qualifies the variant.\n\n```bash\n# Filter for HIGH-impact variants only (stop-gain, frameshift, splice-site)\njava -jar snpEff\u002FSnpSift.jar filter \\\n    \"ANN[*].IMPACT = 'HIGH'\" \\\n    annotated.vcf.gz \\\n    > high_impact.vcf\n\n# Filter HIGH or MODERATE impact and allele frequency \u003C 1%\n# (requires AF in INFO field, e.g., from GATK or gnomAD annotation)\njava -jar snpEff\u002FSnpSift.jar filter \\\n    \"(ANN[*].IMPACT = 'HIGH' | ANN[*].IMPACT = 'MODERATE') & (AF \u003C 0.01)\" \\\n    annotated.vcf.gz \\\n    > rare_functional.vcf\n\n# Count filtered variants\ngrep -v \"^#\" high_impact.vcf | wc -l\n```\n\n### Step 4: Add ClinVar and dbSNP Annotations\n\nSnpSift `annotate` transfers INFO fields from a reference VCF (ClinVar, dbSNP) to the target VCF by matching on chromosome and position. Download ClinVar and dbSNP VCFs from NCBI FTP before running.\n\n```bash\n# Download reference databases (one-time setup)\n# ClinVar (GRCh38)\nwget https:\u002F\u002Fftp.ncbi.nlm.nih.gov\u002Fpub\u002Fclinvar\u002Fvcf_GRCh38\u002Fclinvar.vcf.gz\nwget https:\u002F\u002Fftp.ncbi.nlm.nih.gov\u002Fpub\u002Fclinvar\u002Fvcf_GRCh38\u002Fclinvar.vcf.gz.tbi\n\n# dbSNP (GRCh38, b156 or later)\nwget https:\u002F\u002Fftp.ncbi.nlm.nih.gov\u002Fsnp\u002Flatest_release\u002FVCF\u002FGCF_000001405.40.gz\nwget https:\u002F\u002Fftp.ncbi.nlm.nih.gov\u002Fsnp\u002Flatest_release\u002FVCF\u002FGCF_000001405.40.gz.tbi\n\n# Annotate with ClinVar CLNSIG and CLNDN fields\njava -jar snpEff\u002FSnpSift.jar annotate \\\n    -info CLNSIG,CLNDN,CLNREVSTAT \\\n    clinvar.vcf.gz \\\n    annotated.vcf.gz \\\n    > annotated_clinvar.vcf\n\n# Annotate with dbSNP rsIDs (adds RS field to INFO)\njava -jar snpEff\u002FSnpSift.jar annotate \\\n    GCF_000001405.40.gz \\\n    annotated_clinvar.vcf \\\n    > annotated_full.vcf\n\necho \"ClinVar + dbSNP annotations added to annotated_full.vcf\"\n```\n\n### Step 5: Extract Fields to Tab-Delimited Output\n\nSnpSift `extractFields` converts VCF annotations into a flat table. Use `ANN[0]` to take the first (most severe) transcript annotation, or `ANN[*]` to expand all transcripts.\n\n```bash\n# Extract key fields: CHROM, POS, REF, ALT, impact, gene, protein change, AF, ClinVar sig\njava -jar snpEff\u002FSnpSift.jar extractFields \\\n    -s \",\" \\\n    -e \".\" \\\n    annotated_full.vcf \\\n    CHROM POS REF ALT \\\n    \"ANN[0].GENE\" \\\n    \"ANN[0].EFFECT\" \\\n    \"ANN[0].IMPACT\" \\\n    \"ANN[0].HGVS_P\" \\\n    \"ANN[0].HGVS_C\" \\\n    \"ANN[0].FEATUREID\" \\\n    AF \\\n    CLNSIG \\\n    CLNDN \\\n    > variants_table.tsv\n\n# Preview\nhead -3 variants_table.tsv\n# CHROM  POS   REF  ALT  ANN[0].GENE  ANN[0].EFFECT            ANN[0].IMPACT  ...\n# chr1   69511 A    G    OR4F5        synonymous_variant        LOW            ...\n# chr1   925952 G   A    SAMD11       missense_variant          MODERATE       ...\n```\n\n### Step 6: Parse Annotated VCF in Python with cyvcf2\n\nUse `cyvcf2` (or `PyVCF2`) for programmatic VCF parsing in Python. `cyvcf2` wraps htslib and is significantly faster than pure-Python parsers.\n\n```python\nimport re\nimport pandas as pd\nfrom cyvcf2 import VCF\n\nrecords = []\n\nfor variant in VCF(\"annotated_full.vcf.gz\"):\n    ann_field = variant.INFO.get(\"ANN\")\n    if ann_field is None:\n        continue\n\n    # Take the first (most severe) annotation transcript\n    first_ann = ann_field.split(\",\")[0].split(\"|\")\n    # ANN field columns (0-indexed): allele, effect, impact, gene, gene_id,\n    # feature_type, feature_id, biotype, rank, hgvs_c, hgvs_p, ...\n    effect   = first_ann[1] if len(first_ann) > 1 else \".\"\n    impact   = first_ann[2] if len(first_ann) > 2 else \".\"\n    gene     = first_ann[3] if len(first_ann) > 3 else \".\"\n    hgvs_p   = first_ann[10] if len(first_ann) > 10 else \".\"\n\n    records.append({\n        \"chrom\":   variant.CHROM,\n        \"pos\":     variant.POS,\n        \"ref\":     variant.REF,\n        \"alt\":     \",\".join(variant.ALT),\n        \"gene\":    gene,\n        \"effect\":  effect,\n        \"impact\":  impact,\n        \"hgvs_p\":  hgvs_p,\n        \"af\":      variant.INFO.get(\"AF\", None),\n        \"clnsig\":  variant.INFO.get(\"CLNSIG\", \".\"),\n    })\n\ndf = pd.DataFrame(records)\nprint(f\"Total variants: {len(df)}\")\nprint(df[\"impact\"].value_counts())\n# HIGH        342\n# MODERATE   4218\n# LOW        8903\n# MODIFIER  51204\n```\n\n### Step 7: Summary Statistics and Consequence Visualization\n\nSummarize variant consequences by impact tier, then **read `skills\u002Fdata-visualization\u002Fomics-plotting\u002FSKILL.md` and follow its \"Box \u002F Violin \u002F Bar\" recipe** on the exported tables (→ `figures\u002Fvariant_consequence_summary.png`).\n\n```python\n# Consequence counts by impact (df from Step 6)\nimpact_order = [\"HIGH\", \"MODERATE\", \"LOW\", \"MODIFIER\"]\nimpact_counts = df[\"impact\"].value_counts().reindex(impact_order, fill_value=0)\n\n# Top 15 effects within HIGH and MODERATE\ntop_effects = (\n    df[df[\"impact\"].isin([\"HIGH\", \"MODERATE\"])]\n    [\"effect\"]\n    .str.replace(\"_\", \" \")\n    .value_counts()\n    .head(15)\n)\n\n# Save summary tables; render bar charts with the omics-plotting SKILL (`skills\u002Fdata-visualization\u002Fomics-plotting\u002FSKILL.md`) \"Box \u002F Violin \u002F Bar\" recipe.\nimpact_counts.rename(\"count\").to_csv(\"variant_impact_counts.csv\")\ntop_effects.rename(\"count\").to_csv(\"variant_top_effects.csv\")\nprint(impact_counts.to_string())\n\n# HIGH-impact gene table\nhigh_genes = (\n    df[df[\"impact\"] == \"HIGH\"][\"gene\"]\n    .value_counts()\n    .head(20)\n    .rename(\"n_high_variants\")\n)\nprint(\"\\nTop genes with HIGH-impact variants:\")\nprint(high_genes.to_string())\n```\n\n## Key Parameters\n\n| Parameter | Default | Range \u002F Options | Effect |\n|-----------|---------|-----------------|--------|\n| `-Xmx` (JVM heap) | JVM default (~256 MB) | `4g`–`32g` | Prevents `OutOfMemoryError` for large WGS VCFs; set to ~4–8 GB per run |\n| `-v` (verbose) | off | flag | Prints per-chromosome progress and summary counts to stderr |\n| `-stats` | `snpEff_summary.html` | any `.html` path | Writes interactive QC summary with consequence pie charts and gene tables |\n| `-noStats` | off | flag | Disables HTML report generation (faster for batch runs) |\n| `-canon` | off | flag | Annotates only the canonical transcript per gene (reduces ANN field size) |\n| `-maxAF` | disabled | `0.0`–`1.0` | Skip annotation for variants with population AF above threshold (requires gnomAD in database) |\n| `filter` expression (SnpSift) | — | boolean expression | `ANN[*].IMPACT = 'HIGH'`, `AF \u003C 0.001 & DP > 10`, `CLNSIG has 'Pathogenic'` |\n| `-s` separator (extractFields) | tab | any string | Field separator in output table; use `\",\"` for CSV |\n| `-e` empty value (extractFields) | empty | any string | Placeholder for missing fields; use `\".\"` for consistency with VCF convention |\n\n## Key Concepts\n\n### ANN Field Structure\n\nEach variant's `ANN` INFO field contains one annotation per predicted transcript consequence, separated by commas. Each annotation is a pipe-delimited string with 16 fields:\n\n```\nANN=T|missense_variant|MODERATE|BRCA1|ENSG00000012048|transcript|ENST00000357654|protein_coding|12\u002F23|c.1234A>T|p.Lys412Met|1234|1234|412|.|\n```\n\nThe first annotation (index 0) is the most severe consequence. Multiple annotations arise when a variant affects multiple transcripts or genes.\n\n### Impact Levels\n\n| Impact | Variant Types | Typical Priority |\n|--------|--------------|-----------------|\n| `HIGH` | Stop-gained, frameshift, splice-donor\u002Facceptor, start-lost | Disease candidate; always review |\n| `MODERATE` | Missense, in-frame indel, splice-region | Pathogenicity depends on conservation and domain context |\n| `LOW` | Synonymous, stop-retained, start-retained | Rarely causal; useful as controls |\n| `MODIFIER` | Intronic, intergenic, UTR, downstream | Background; filter out for most analyses |\n\n### HGVS Notation in ANN\n\nSnpEff provides both cDNA (`HGVS.c`, e.g., `c.1234A>T`) and protein (`HGVS.p`, e.g., `p.Lys412Met`) notation. HGVS fields are empty (`.`) for non-coding variants. The `FEATUREID` field contains the Ensembl or RefSeq transcript ID enabling cross-database lookup.\n\n### SnpSift Filter Syntax\n\nSnpSift filter expressions support comparison operators (`=`, `!=`, `\u003C`, `>`), logical operators (`&`, `|`, `!`), and the `has` operator for substring matching. Use `ANN[*]` to match any annotation transcript, `ANN[0]` for first only:\n\n```\n# Compound filter: rare + damaging + not in ClinVar benign\n(AF \u003C 0.001) & (ANN[*].IMPACT = 'HIGH' | ANN[*].IMPACT = 'MODERATE') & !(CLNSIG has 'Benign')\n```\n\n## Common Recipes\n\n### Recipe: Filter De Novo Candidates (Trio Analysis)\n\nIdentify rare, functionally damaging variants in a proband that are absent from both parents. Combine allele frequency filtering, impact filtering, and VCF subtraction using SnpSift.\n\n```bash\n# Step 1: Annotate proband VCF\njava -jar snpEff\u002FsnpEff.jar -v hg38 proband.vcf.gz > proband_ann.vcf\n\n# Step 2: Filter rare HIGH\u002FMODERATE variants not in either parent\n# Requires proband, mother, and father VCFs to be jointly genotyped or\n# use SnpSift filter on a multi-sample VCF\njava -jar snpEff\u002FSnpSift.jar filter \\\n    \"(ANN[*].IMPACT = 'HIGH' | ANN[*].IMPACT = 'MODERATE') \\\n     & (AF \u003C 0.001 | AF = '.') \\\n     & (GEN[proband].GT != '.\u002F.') \\\n     & (GEN[mother].GT = '0\u002F0' | GEN[mother].GT = '0|0') \\\n     & (GEN[father].GT = '0\u002F0' | GEN[father].GT = '0|0')\" \\\n    proband_ann.vcf \\\n    > denovo_candidates.vcf\n\n# Step 3: Extract to table for review\njava -jar snpEff\u002FSnpSift.jar extractFields \\\n    denovo_candidates.vcf \\\n    CHROM POS REF ALT \"ANN[0].GENE\" \"ANN[0].EFFECT\" \"ANN[0].IMPACT\" \\\n    \"ANN[0].HGVS_P\" AF CLNSIG \\\n    > denovo_candidates.tsv\n\necho \"De novo candidates: $(grep -v '^CHROM' denovo_candidates.tsv | wc -l)\"\n```\n\n### Recipe: Extract Protein-Changing Variants to pandas DataFrame\n\nLoad an annotated VCF directly into pandas using SnpSift `extractFields` output for downstream statistical or ML analysis.\n\n```python\nimport subprocess\nimport io\nimport pandas as pd\n\nVCF_IN   = \"annotated_full.vcf.gz\"\nSNPSIFT  = \"snpEff\u002FSnpSift.jar\"\n\n# Run SnpSift extractFields via subprocess and capture stdout\ncmd = [\n    \"java\", \"-jar\", SNPSIFT, \"extractFields\",\n    \"-s\", \",\", \"-e\", \".\",\n    VCF_IN,\n    \"CHROM\", \"POS\", \"REF\", \"ALT\",\n    \"ANN[0].GENE\", \"ANN[0].EFFECT\", \"ANN[0].IMPACT\",\n    \"ANN[0].HGVS_P\", \"ANN[0].HGVS_C\", \"ANN[0].FEATUREID\",\n    \"AF\", \"DP\", \"CLNSIG\", \"CLNDN\",\n]\nresult = subprocess.run(cmd, capture_output=True, text=True, check=True)\ndf = pd.read_csv(io.StringIO(result.stdout), sep=\"\\t\")\ndf.columns = [c.replace(\"ANN[0].\", \"\") for c in df.columns]  # clean column names\n\n# Keep protein-changing variants only\nprotein_changing = df[df[\"IMPACT\"].isin([\"HIGH\", \"MODERATE\"])].copy()\nprotein_changing[\"AF\"] = pd.to_numeric(protein_changing[\"AF\"], errors=\"coerce\")\nprotein_changing[\"DP\"] = pd.to_numeric(protein_changing[\"DP\"], errors=\"coerce\")\n\nprint(f\"Protein-changing variants: {len(protein_changing)}\")\nprint(protein_changing[[\"GENE\", \"EFFECT\", \"IMPACT\", \"HGVS_P\", \"AF\"]].head(10).to_string(index=False))\n```\n\n### Recipe: Build a Custom Genome Database\n\nWhen working with a non-standard organism or custom assembly, build a SnpEff database from a FASTA + GTF file.\n\n```bash\n# 1. Set up directory structure under SnpEff's data directory\nGENOME_NAME=\"my_organism\"\nmkdir -p snpEff\u002Fdata\u002F${GENOME_NAME}\ncp my_genome.fa snpEff\u002Fdata\u002F${GENOME_NAME}\u002Fsequences.fa\ncp my_annotation.gtf snpEff\u002Fdata\u002F${GENOME_NAME}\u002Fgenes.gtf\n\n# 2. Add genome entry to snpEff.config\necho \"${GENOME_NAME}.genome : My Organism\" >> snpEff\u002FsnpEff.config\n\n# 3. Build the database\njava -jar snpEff\u002FsnpEff.jar build \\\n    -gtf22 \\\n    -v \\\n    ${GENOME_NAME}\n\n# 4. Verify\njava -jar snpEff\u002FsnpEff.jar dump ${GENOME_NAME} | head -20\necho \"Custom database built for ${GENOME_NAME}\"\n```\n\n## Expected Outputs\n\n| File | Format | Contents |\n|------|--------|----------|\n| `annotated.vcf.gz` | bgzipped VCF | Original variants with `ANN` INFO field; one record per variant |\n| `snpEff_summary.html` | HTML | Interactive QC report: consequence pie charts, top genes, transition\u002Ftransversion ratio |\n| `snpEff_genes.txt` | TSV | Per-gene counts of variants by consequence type |\n| `high_impact.vcf` | VCF | Subset of variants with `ANN[*].IMPACT = 'HIGH'` |\n| `annotated_clinvar.vcf` | VCF | Annotated VCF enriched with `CLNSIG`, `CLNDN`, `CLNREVSTAT` from ClinVar |\n| `variants_table.tsv` | TSV | Flat table of extracted fields; one row per variant (first transcript) |\n| `variant_consequence_summary.png` | PNG | Bar charts of impact tiers and top consequence types |\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| `OutOfMemoryError` during annotation | Default JVM heap too small for WGS VCFs | Add `-Xmx8g` (or `-Xmx16g`) before `-jar`: `java -Xmx8g -jar snpEff.jar ...` |\n| `ERROR_CHROMOSOME_NOT_FOUND` for every variant | Chromosome naming mismatch (e.g., `chr1` vs `1`) | Pass `-noCheckChr` flag; or rename contigs in VCF with `bcftools annotate --rename-chrs` |\n| `Database not found` error | Genome database not downloaded | Run `java -jar snpEff.jar download hg38`; check `snpEff\u002Fdata\u002F` directory exists |\n| Empty `ANN` field on all variants | Wrong genome database version relative to VCF reference | Confirm VCF uses the same assembly as the database (e.g., hg38 vs GRCh38 — use `GRCh38.86` for Ensembl builds) |\n| SnpSift filter returns zero variants | Filter expression syntax error or wrong field name | Test expression on small VCF; check `ANN[*].IMPACT` vs `ANN[0].IMPACT`; wrap expression in quotes |\n| `CLNSIG` field missing after `snpSift annotate` | ClinVar VCF not indexed, or contig mismatch | Run `tabix -p vcf clinvar.vcf.gz` before annotating; ensure chromosome names match |\n| `extractFields` output missing HGVS_P column | Variant is non-coding or affects UTR\u002Fintron | Use `-e \".\"` flag to fill empty fields; filter to coding variants first |\n| Very large `ANN` field (thousands of transcripts) | Variant in a region with many overlapping transcripts | Add `-canon` flag to annotate only canonical transcripts, or use `ANN[0]` in downstream filters |\n\n## References\n\n- [SnpEff Documentation](https:\u002F\u002Fpcingola.github.io\u002FSnpEff\u002F) — comprehensive usage guide, ANN field specification, filter syntax\n- [SnpEff GitHub Repository](https:\u002F\u002Fgithub.com\u002Fpcingola\u002FSnpEff) — source code, issue tracker, release notes\n- Cingolani P, et al. (2012) \"A program for annotating and predicting the effects of single nucleotide polymorphisms, SnpEff: SNPs in the genome of Drosophila melanogaster strain w1118.\" *Fly* 6(2):80–92. doi:[10.4161\u002Ffly.19695](https:\u002F\u002Fdoi.org\u002F10.4161\u002Ffly.19695)\n- [ClinVar VCF FTP](https:\u002F\u002Fftp.ncbi.nlm.nih.gov\u002Fpub\u002Fclinvar\u002F) — ClinVar VCF files by assembly\n- [cyvcf2 Documentation](https:\u002F\u002Fbrentp.github.io\u002Fcyvcf2\u002F) — Python VCF parsing library used in Step 6\n",{"name":5,"license":15,"description":7},"master","fd76f882a04e445e899d5cfb2732f2105ea054ee","skills\u002Fawesome-skills\u002Fsnpeff-variant-annotation",0,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS","https:\u002F\u002Fbg-szy.github.io\u002FTOP-SKILLS\u002F","https:\u002F\u002Fgithub.com\u002Fbg-szy","https:\u002F\u002Fwww.ecust.edu.cn\u002F","a student of East China University of Science and Technology","2026-11-15 03:38:02",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add bg-szy\u002FTOP-SKILLS --skill snpeff-variant-annotation",{"tool":40,"command":41},"bunx","bunx skills add bg-szy\u002FTOP-SKILLS --skill snpeff-variant-annotation",{"tool":43,"command":44},"pnpm","pnpm dlx skills add bg-szy\u002FTOP-SKILLS --skill snpeff-variant-annotation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fawesome-skills\u002Fsnpeff-variant-annotation\u002FSKILL.md",true,[],[49,57,64,71,78,85],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":56},"01M7DXW9N826PKXK174PVW3038","serpmaven","Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fserpmaven\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":56},"01M7DXVHSTWDV65475QEQ915M7","revnu-landing-page-audit","Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: \"audit my landing page\", \"why isn't this page converting\", \"review my homepage\", \"my ads get clicks but no signups\", \"people bounce from the pricing page\", \"CRO review\", \"improve conversion rate\", \"is my hero section clear\", \"roast my landing page\", \"rewrite my headline\", \"what's wrong with this page\", \"landing page feedback\", \"make the signup page convert better\". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-landing-page-audit\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":56},"01M7DXV8X2D7B3VTD4HHYYHTGR","revnu-growth-context","Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents\u002Frevnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says \"set up our marketing context\", \"who is our ideal customer\", \"write our ICP\", \"describe the product for marketing\", \"positioning doc\", \"what's our brand voice\", \"remember this about our customers\", \"log what we tried\", \"what have we learned from marketing\", \"we changed pricing, update the context\", \"update our growth notes\", \"summarize the business for the agent\", \"import my product-marketing.md\", \"start a growth doc\", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-growth-context\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":56},"01M7DXV0DGJ1G0A60PAHC6J3C5","revnu-get-listed","Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: \"best X\" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says \"get us listed\", \"which directories should we submit to\", \"how do we get into best-of lists\", \"why does ChatGPT recommend competitors and not us\", \"get mentioned in AI answers\", \"submit to awesome lists\", \"get on G2\", \"where are our competitors listed\", \"pitch listicle authors\", \"find backlink opportunities\", \"launch directories\", \"get into roundups\", \"Product Hunt alternatives\", \"where should we be listed\", \"get cited by Perplexity\". Never submits, pays or posts without a yes. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-get-listed\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":56},"01M7DXTSPMGT9D6DSS0HP9BSTA","revnu-ai-readiness-audit","Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks \"is my site ready for AI search\", \"audit my site for AI answers\", \"AEO audit\", \"GEO audit\", \"why doesn't ChatGPT quote our pricing\", \"make our pages citable by AI\", \"do I need llms.txt\", \"does schema help with ChatGPT\", \"check our structured data\", \"is our content visible without JavaScript\", \"AI SEO audit\", \"optimize our homepage for AI answers\", \"LLM SEO check\", \"why does AI get our product wrong\", \"fix our site for AI Overviews\". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-ai-readiness-audit\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":56},"01M7DXSZHCVTRS620GC3S97JZV","proxy-troubleshooting","Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fproxy-troubleshooting\u002FSKILL.md",[],[]]