← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-variant-calling-vcf-basics / references / usage-guide.md

VCF/BCF Basics - Usage Guide

Overview

View, query, and understand VCF/BCF variant files using bcftools and cyvcf2. Essential for working with variant calling results.

Prerequisites

conda install -c bioconda bcftools htslib
pip install cyvcf2

Quick Start

Tell your AI agent what you want to do:

Example Prompts

Viewing Files

"Show me the header of my VCF file"

"View variants in chromosome 1 between positions 1M and 2M"

"How many SNPs and indels are in this VCF?"

Extracting Data

"Extract variant positions and allele frequencies to a table"

"Get genotypes for all samples as a TSV file"

"List all variant IDs (rsIDs) in the file"

Format Conversion

"Compress my VCF with bgzip and index it"

"Convert this VCF to BCF format for faster processing"

Python Analysis

"Iterate through variants and count heterozygous calls per sample"

"Filter variants with QUAL > 30 and write to a new file"

Interpreting Fields

"Explain the difference between QUAL and GQ for this site"

"Compute allele balance from AD for the heterozygous calls"

"Why does this record have a allele -- is this a gVCF?"

"Check whether my missing genotypes are being treated as reference"

What the Agent Will Do

  1. Identify the VCF/BCF file location and check if it's indexed
  2. Select appropriate tool (bcftools for CLI, cyvcf2 for Python)
  3. Construct the query or view command with proper flags
  4. Execute the operation and format output as requested
  5. For region queries, ensure the file is indexed first

Tips