vcf-contrast
Quick Start
- Command:
vcf-contrast +<variant_samples> -<background_samples> [OPTIONS] file.vcf.gz - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/vcf-contrast - Full reference: See references/help.md
When To Use This Tool
- Contrast one sample group against another within a multi-sample VCF.
- Identify sites where case or focal samples carry genotypes or alleles absent from background samples.
- Add
NOVELGT,NOVELAL, andNOVELTYINFO annotations for downstream filtering or reporting. - Perform quick cohort-difference scans without writing a custom comparison script.
Common Patterns
# 1) Find variants present in A,B but absent from C,D,E
vcf-contrast \
+A,B \
-C,D,E \
cohort.vcf.gz
# 2) Report only sites with novel genotypes
vcf-contrast \
-n \
+cases1,cases2 \
-controls1,controls2,controls3 \
cohort.vcf.gz
# 3) Require minimum depth and respect FILTER status
vcf-contrast \
+tumor \
-normal \
-d 10 \
-f \
cohort.vcf.gz
Recommended Workflow
- Prepare a bgzip-compressed VCF file containing all samples to be compared
- Identify the samples expected to have unique variants (+) and the background control samples (-)
- Run
vcf-contrast +A,B -C,D,E [OPTIONS] file.vcf.gzwith flags such as-nto output only novel sites or-fto apply filters - Pipe output to
vcf-queryor other tools to extract and format the annotated fields of interest
Guardrails
- Both variant sample list (+) and background sample list (-) are required arguments
- Input VCF must be bgzip-compressed with
.vcf.gzextension - Haploid genotypes are internally treated as homozygous diploid; "0/1" and "1" are considered different genotypes
-nlimits output to novel sites only; without it, the tool still emits all records, just with additional INFO annotations-fdiscards rows whose FILTER is neitherPASSnor., which changes the comparison universe before novelty is computed