Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

tooluniverse-variant-analysis

БесплатноЗапускает вложенные скриптыНе проверен

VCF and variant analysis — parsing, annotation, classification (synonymous, missense, frameshift, stop_gained), VAF filtering, coding vs non-coding…

mims-harvardот mims-harvard★ 1 813 звёзд на GitHub

Об этом скилле

Variant Analysis and Annotation

Compute the answer from the data

Do the analysis yourself, from the data files, with the recipe below. Do not take the answer from a notebook that has already been run, a result table, or the output of a script that ships with the data: those are not inputs to the analysis, and copying their numbers is not doing it.


PRIMARY SCRIPTS — use these FIRST

These bundled scripts encode the question-specific gotchas (denominator choices, ploidy defaults, multi-allelic split, multi-row Excel headers, non-coding allowlist). They emit labelled KEY=VALUE lines that are easier to parse than ad-hoc pandas/awk output. Prefer them over writing new code.

Script When to use it
gatk_haplotypecaller_pipeline.py Any "how many SNPs / indels were called by HaplotypeCaller from the BAM" question. Handles BWA index → align → sort → index → HaplotypeCaller, OR can start from an existing BAM (skip alignment), OR only count an existing VCF. Default --ploidy 2 (matches GATK's own default — most "called by HaplotypeCaller" GTs were generated with this). Pass --ploidy 1 for explicit haploid prokaryote calling. Multi-allelic split + bcftools-style SNP/indel detection is built in.
coding_variant_filter.py "Average number of CHIP / coding variants per sample after filtering out intronic, intergenic, and UTR variants." Two-stage canonical filter: (1) drop Zygosity == Reference rows (when present — these inflate counts ~10×), (2) drop intronic/intergenic/UTR/upstream/downstream SO terms. Handles 2-row VarSeq Excel headers and per-sample folders or combined CSVs.
variant_fraction.py "Fraction of variants with VAF < X annotated as Y" — denominator is the CODING subset only (synonymous/missense/splice_region/stop_gained/lost/start_lost/frameshift/inframe indel), NOT all records.

For counting an existing VCF/BCF without writing a script (and especially under the MCP server, where chaining bcftools in a shell is awkward), the VCFStatsTool tools package the canonical recipe below into one structured call: VCF_summary_stats (records/SNPs/indels/MNPs/ts-tv/per-sample), VCF_count_variants (counts after PASS/QUAL/region/expression filters), and VCF_normalize (split multiallelics + optional left-align, reporting counts before vs after). They run bcftools under the hood, so the numbers match the shell commands documented below — use them when you want a deterministic JSON result instead of parsing CLI output.

Workspace isolation (CRITICAL)

gatk_haplotypecaller_pipeline.py and coding_variant_filter.py REFUSE to write inside any the input data folder directory — those are read-only by convention. Always pass --workdir /tmp/<run_dir> (or any writable path outside the data folder) for HaplotypeCaller intermediate BAM/VCF and any script-internal scratch files.

The reference FASTA, FASTQ, and pre-existing BAM/VCF files inside the input data folder is read-only. The script will copy a data-folder BAM into the workdir if it needs to add a .bai index.

Concrete invocations

Re-run HaplotypeCaller on a sample's sorted BAM (this is the canonical path for "how many SNPs / indels did HaplotypeCaller identify in the BAM"; preferred over counting any pre-shipped *_raw_variants.vcf, which may have been generated with non-default flags or post-filtering that does not match the question):

python skills/tooluniverse-variant-analysis/scripts/gatk_haplotypecaller_pipeline.py \
  --reference <data-folder>/REF.fna \
  --bam <data-folder>/SAMPLE_sorted.bam \
  --workdir /tmp/hc_run --sample-name SAMPLE

Full pipeline from FASTQ (BWA + sort + HaplotypeCaller; ~5-10 min):

python skills/tooluniverse-variant-analysis/scripts/gatk_haplotypecaller_pipeline.py \
  --reference <data-folder>/REF.fna \
  --fastq-r1 <data-folder>/SAMPLE_1.fastq.gz --fastq-r2 <data-folder>/SAMPLE_2.fastq.gz \
  --workdir /tmp/hc_run --sample-name SAMPLE

Count-only an existing VCF (only when the question explicitly asks about that file — e.g., "how many records are in variants.vcf"; do NOT use this for "how many SNPs did HaplotypeCaller identify", because the shipped file's ploidy / filtering may not match the question):

python skills/tooluniverse-variant-analysis/scripts/gatk_haplotypecaller_pipeline.py \
  --vcf <data-folder>/SAMPLE_variants.vcf

Average CHIP variants per sample after intronic/intergenic/UTR filter (folder of per-sample 2-row-header VarSeq Excels):

python skills/tooluniverse-variant-analysis/scripts/coding_variant_filter.py \
  --dir <data-folder>/CHIP_DP10_GQ20_PASS --pattern '*.xlsx' --header-rows 2

Same filter on a single combined CSV:

python skills/tooluniverse-variant-analysis/scripts/coding_variant_filter.py \
  --file all_samples.csv --sample-col sample --header-rows 1

Output keys to grep

gatk_haplotypecaller_pipeline.py: SNP_COUNT_ALLELES, `INDEL_COUN

Полный SKILL.md на GitHub

Установить tooluniverse-variant-analysis в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.env.templateQUICK_START.mdpython_implementation.pyreferences/annotation_guide.mdreferences/mutation_classification_guide.mdreferences/sv_cnv_analysis.mdreferences/variant_notation_conversion.mdreferences/vcf_filtering.mdscripts/annotate_variants.pyscripts/coding_variant_filter.pyscripts/filter_variants.pyscripts/gatk_haplotypecaller_pipeline.pyscripts/parse_vcf.pyscripts/variant_fraction.pytest_data/cohort2.vcftest_data/sample.vcf

FAQ

Что делает скилл tooluniverse-variant-analysis?

VCF and variant analysis — parsing, annotation, classification (synonymous, missense, frameshift, stop_gained), VAF filtering, coding vs non-coding categorization, multi-condition variant comparison, variant-notation conversion (SPDI/HGVS/VCF/rsID interconversion, ALFA per-ancestry allele frequencies), European Variation Archive (EVA) lookups (per-study cohort variant data, RS-accession resolution), HGVS validation/normalization (Mutalyzer), gene-specific curated variants (LOVD), canonical cross-database allele IDs (ClinGen Allele Registry), automated ACMG/AMP classification (GeneBe), principal-transcript selection (APPRIS), Ensembl linkage disequilibrium (LD) for GWAS/fine-mapping, GRCh37/GRCh38 coordinate liftover and protein/cDNA-to-genomic mapping, and Ensembl ID utilities (stable-ID version history, cross-references, region/gene feature overlap, assembly/species metadata). Use for VCF parsing, variant fraction calculations (denominator = coding subset only, NOT all variants), per-sample mutation profiling, converting a variant between SPDI/HGVS/VCF-coordinate/dbSNP-rsID representations, cross-checking a variant against EVA's raw submitted study cohorts, validating an HGVS string's syntax, looking up curated variants for a well-studied gene, resolving a variant to its ClinGen CA ID, getting an automated ACMG verdict, or picking a gene's principal transcript.

Как установить скилл tooluniverse-variant-analysis?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл tooluniverse-variant-analysis запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить tooluniverse-variant-analysis с