vcflib(1)
๐ฆ vcflib(1) ๐ฆ
okay bestie, welcome to the vcflib index page. This is the manual for vcflib โ like, the whole vibe. We're folding the manual name in right here so you know it's vcflib(1) and the title is vcflib (index). Let's go. ๐
๐ธ NAME ๐ธ
vcflib index
โจ DESCRIPTION โจ
vcflib contains tools and libraries for dealing with the Variant Call Format (VCF), which is a flat-file, tab-delimited textual format intended to describe reference-indexed variations between individuals.
VCF provides a common interchange format for the description of variation in individuals and populations of samples, and has become the de-facto standard reporting format for a wide array of genomic variant detectors. periodt. ๐งฌโจ
vcflib provides methods to manipulate and interpret sequence variation as it can be described by VCF. It is both:
- an API for parsing and operating on records of genomic variation as it can be described by the VCF format,
- and a collection of command-line utilities for executing complex manipulations on VCF files.
The API itself provides a quick and extremely permissive method to read and write VCF files. Extensions and applications of the library provided in the included utilities (*.cpp) comprise the vast bulk of the libraryโs utility for most users. iykyk ๐
๐ง filter ๐ง
Here's the filter crew, bestie:
vcffilterโ VCF filter the specifiedvcffile using the set of filters. slay.vcfuniqโ List unique genotypes. Similar to GNUuniq, but aimed at VCF records.vcfuniqremoves records which have the sameposition,ref, andaltas the previous record on a sorted VCF file. Note that it does not adjust/combine genotypes in the output, but simply takes the first record. See alsovcfcreatemultifor combining records. important caveat alert! ๐จvcfuniqallelesโ List unique alleles. For each record, remove any duplicate alternate alleles that may have resulted from merging separate VCF files.
๐ metrics ๐
The metrics girlies:
vcfcheckโ Validate integrity and identity of the VCF by verifying that the VCF recordโsREFmatches a given reference file.vcfdistanceโ Adds a tag to each variant record which indicates the distance to the nearest variant. (defaults toBasesToClosestVariantif no custom tag name is given.vcfentropyโ Annotate VCF records with the Shannon entropy of flanking sequence. Annotates the output VCF file with, for each record,EntropyLeft,EntropyRight,EntropyCenter, which are the entropies of the sequence of the given window size to the left, right, and center of the record. Also addsEntropyRefandEntropyAltfor each alt. so many entropy tags, we love to see it.vcfhetcountโ Calculate the heterozygosity rate: count the number of alternate alleles in heterozygous genotypes in all records in thevcffile.vcfhethomratioโ Generates the het/hom ratio for each individual in the file.
๐งฌ phenotype ๐งฌ
permuteGPAT++โpermuteGPAT++is a method for adding empirical p-values to aGPAT++score.
๐งฌ genotype ๐งฌ
abba-babaโabba-babacalculates the tree pattern for four individuals. This tool assumes reference is ancestral and ignores non abba-baba sites. The output is a boolean value:1 = true,0 = falsefor abba and baba. The tree argument should be specified from the most basal taxa to the most derived. basal to derived, no cap.hapLrtโHapLRTis a likelihood ratio test for haplotype lengths. The lengths are modeled with an exponential distribution. The sign denotes if the target has longer haplotypes (1) or the background (-1). math but make it fashion.normalize-iHSโ normalizesiHSorXP-EHHscores. normalize it, bestie.
โจ transformation โจ
okay so these are the lil glow-up artists ๐ every one of them takes your data and transforms it into something else, and honestly? iconic behavior.
dumpContigsFromHeaderโ dumps the contigs straight outta the header. that's the whole job, and it does it flawlessly ๐smootherโ a method for window smoothing, and it handles many of the GPAT++ formats ๐ฆvcf2dagโ modifies your VCF so you can actually build a directed acyclic graph (DAG) out of it โจvcf2fastaโ generatessample_seq:N.fafor each sample, reference sequence, and chromosomal copy N in[0,1... ploidy]. every single sequence inside the fasta file is named with the same pattern used for the file name, which means you can combine them later. teamwork fr ๐ซถvcf2tsvโ converts VCF to per-allele or per-genotype tab-delimited format, using a null string to replace the empty values in the table. specify-gand you get one line per sample with genotype information. when there's more than one alt allele you'll get multiple rows, one for each allele, and the INFO will match theAindex ๐vcfaddinfoโ adds INFO fields from the second file that aren't already present in the first VCF file. filling in the gaps, we love to see it ๐ธvcfafpathโ displays genotype pathsvcfallelicprimitivesโ > WARNING: this tool is considered legacy and is only retained for older workflows. it will emit a warning! ๐ญ and even though it can use the WFA, bestieโฆ you should usevcfwaveinstead. periodt.vcfannotateโ intersects the records in the VCF file with targets provided in a BED file. the intersections are done on the reference sequences in the VCF file. if no VCF filename is specified on the command line (that's the last argument), the VCF gets read from stdin ๐vcfannotategenotypesโ examines genotype correspondence. it annotates the genotypes in the first file with the genotypes in the second, adding the genotype as another flag to each sample field in the first file.annotation-tagis the name of the sample flag that gets added to store the annotation. it also adds ahas_variantflag for sites where the second file has a variant โจvcfbreakmultiโ if multiple alleles are specified in a single record, it breaks that record into multiple lines, preserving all the allele-specific INFO fields. no info left behind ๐vcfcatโ concatenates VCF files ๐ฑvcfclassifyโ creates a new VCF where each variant is tagged by allele class:snp,ts/tv,indel,mnpvcfcleancomplexโ removes reference-matching sequence from complex alleles and adjusts the records to reflect the positional change ๐งvcfcombineโ combines VCF files positionally, combining samples when sites and alleles are identical. any number of VCF files may be combined. when records in multiple files match, the INFO field and other columns are taken from one of the files which are combined. alleles must have identical ordering to be combined into one record โ if they don't, multiple records will be emitted. rules are rules ๐vcfcommonsamplesโ generates each record in the first file, removing the samples that aren't present in the second ๐vcfcreatemultiโ goes through a sorted VCF and, when overlapping alleles are represented across multiple records, merges them into a single multi-ALT record. see the documentation for more information ๐vcfechoโ echoes VCF to stdout (simple demo)vcfevenregionsโ generates a list of regions, e.g.chr20:10..30, using the variant density information provided in the VCF file, to make sure the regions have even numbers of variants. this can be used to reduce the variance in runtime when dividing variant detection or genotyping by genomic coordinates. highkey a time-saver ๐ฅvcffixupโ generates a VCF stream whereACandNShave been generated for each record using sample genotypesvcfflattenโ removes multi-allelic sites by picking the most common alternate. requires allele frequency specificationAFand use ofGandAto specify the fields which vary according to the Allele or Genotype. the VCF file may be specified on the command line or piped as stdin ๐vcfgeno2allelesโ modifies the genotypes field to provide the literal alleles rather than indexesvcfgeno2haploโ converts genotype-based phased alleles withinโwindow-sizeinto haplotype alleles. it will break haplotype construction when it encounters non-phased genotypes on input ๐ญvcfgenosamplenamesโ gets you the sample names ๐vcfglboundโ adjusts GLs so that the maximum GL is 0, by dividing all the GLs for each sample by the maxvcfglxgtโ sets genotypes using the maximum genotype likelihood for each samplevcfindexโ adds an index number to the INFO field (id=position)vcfinfo2qualโ sets QUAL from the info field tag keyed by[key]. the VCF file may be omitted and read from stdin. if the field contains multiple values, the average of the field is used ๐งฎvcfinfosummarizeโ takes annotations given in the per-sample fields and adds the mean, median, min, or max to the site-level INFOvcfintersectโ VCF set analysis ๐vcfkeepgenoโ okay so bestie, this one slims down your file by removingFORMATfields not listed on the command line from sample specifications in the output. It's giving minimalism ๐vcfkeepinfoโ To decrease file size, removeINFOfields not listed on the command line. Less is more, queen โจvcfkeepsamplesโ outputs each record in thevcffile, removing samples not listed on the command line. Bye felicia ๐vcfldโ ComputeLD. That's it. Short and iconic ๐vcfleftalignโ Left-align indels and complex variants in the input using a pairwise ref/alt alignment followed by a heuristic, iterative left realignment process that shifts indel representations to their absolute leftmost (5โ) extent. It's literally shifting them to the far left, no cap ๐งvcflengthโ Add length info field. Simple, but effective ๐vcfnullgenofieldsโ Makes theFORMATfor each variant line the same (uses all theFORMATfields described in the header). Fills out per-sample fields to matchFORMAT. ExpandsGTvalues of `.' with number of alleles based on ploidy (eg: `./.' for dipolid). It's giving uniformity โจvcfnumaltโ outputs aVCFstream whereNUMALThas been generated for each record using sample genotypes. Slay ๐vcfoverlayโ Overlay records in the inputvcffiles with order as precedence. First one wins, bestie ๐vcfprimersโ For eachVCFrecord, extract the flanking sequences, and write them tostdoutasFASTArecords suitable for alignment. Get those primers, queen ๐งฌvcfqual2infoโ PutsQUALinto an info field tag keyed by[key]. So you can keep that quality somewhere useful ๐vcfremapโ For each alternate allele, attempt to realign against the reference with lowered gap open penalty. If realignment is possible, adjust thecigarand reference/alternate alleles. Observe how different alignment parameters, including context and entropy-dependent ones, influence variant classification and interpretation. It's a whole vibe check for your variants ๐ฅvcfremoveaberrantgenotypesโ strips samples which are homozygous but have observations implying heterozygosity. Remove samples for which the reported genotype (GT) and observation counts disagree (AO,RO). Not today, aberrant genotypes ๐vcfremovesamplesโ outputs each record in thevcffile, removing samples listed on the command line. Bye bestie, you're not invited to the party ๐vcfsample2infoโ Take annotations given in the per-sample fields and add the mean, median, min, or max to the site-levelINFO. Summary stats, but make it fashion โจvcfsamplediffโ Establish putative somatic variants using reported differences between germline and somatic samples. Tags each record where the listed sample genotypes differ with . The first sample is assumed to be germline, the second somatic. Each record is tagged with={germline,somatic,loh}to specify the type of variant given the genotype difference between the two samples. It's giving detective work ๐vcfsamplenamesโ List sample names. That's it. Simple, but necessary ๐vcfstreamsortโ Sorts the input (eitherstdinor file) using a streaming sort algorithm. Guarantees that the positional order is correct provided out-of-order variants are no more than100positions in theVCFfile apart. So if they're within 100 spots, you're good ๐vcfwaveโ Realign reference and alternate alleles withWFA, parsing out the `primitive' alleles into multipleVCFrecords. New records have IDs that reference the source record ID. Genotypes/samples are handled correctly. Deletions generate haploid/missing genotypes at overlapping sites. It's giving wave ๐
โจ statistics โจ
bFstโ okay so bFst is a Bayesian approach to Fst. Importantly bFst accounts for genotype uncertainty in the model using genotype likelihoods. For a more detailed description see: A Bayesian approach to inferring population structure from dominant markersโ by Holsinger et al. Molecular Ecology Vol 11, issue 7 2002. The likelihood function has been modified to use genotype likelihoods provided by variant callers. There are five free parameters estimated in the model: each subpopulationโs allele frequency and Fis (fixation index, within each subpopulation), a free parameter for the total populationโs allele frequency, and Fst. ๐genotypeSummaryโ Generates a table of genotype counts. Summarizes genotype counts for bi-allelic SNVs and indel. โจiHSโ iHS calculates the integrated haplotype score which measures the relative decay of extended haplotype homozygosity (EHH) for the reference and alternative alleles at a site (see: voight et al. 2006, Spiech & Hernandez 2014). ๐งฌmeltEHHโ no description given, bestie. Itโs just out here living its mystery life. ๐pFstโ pFst is a probabilistic approach for detecting differences in allele frequencies between two populations. ๐ฅpVstโ pVst calculates vst, a measure of CNV stratification. ๐permuteSmoothโ permuteSmooth is a method for adding empirical p-values smoothed wcFst scores. ๐plotHapsโ plotHaps provides the formatted output that can be used with `bin/plotHaplotypes.R'. ๐popStatsโ General population genetic statistics for each SNP. ๐ธsegmentFstโ segmentFst creates genomic segments (bed file) for regions with high wcFst. ๐งฌsegmentIhsโ Creates genomic segments (bed file) for regions with high wcFst. (yes, same as above, not a typo, bestie) โจsequenceDiversityโ The sequenceDiversity program calculates two popular metrics of haplotype diversity: pi and extended haplotype homozygosity (eHH). Pi is calculated using the Nei and Li 1979 formulation. eHH a convenient way to think about haplotype diversity. When eHH = 0 all haplotypes in the window are unique and when eHH = 1 all haplotypes in the window are identical. ๐ฆvcfaltcountโ count the number of alternate alleles in all records in the vcf file. ๐ขvcfcountallelesโ Count alleles. ๐ฏvcfgenosummarizeโ Adds summary statistics to each record summarizing qualities reported in called genotypes. Uses: RO (reference observation count), QR (quality sum reference observations) AO (alternate observation count), QA (quality sum alternate observations). ๐vcfgenotypecompareโ adds statistics to the INFO field of the vcf file describing the amount of discrepancy between the genotypes (GT) in the vcf file and the genotypes reported in the . use this after vcfannotategenotypes to get correspondence statistics for two vcfs. ๐vcfgenotypesโ Report the genotypes for each sample, for each variant in the VCF. Convert the numerical represenation of genotypes provided by the GT field to a human-readable genotype format. (note: โrepresenationโ is misspelled in the original, keep it! bestie, we donโt fix typos here, we preserve the vibe) ๐งฌvcfparsealtsโ Alternate allele parsing method. This method uses pairwise alignment of REF and ALTs to determine component allelic primitives for each alternate allele. ๐ฌvcfrandomโ Generate a random VCF file. ๐ฒvcfrandomsampleโ Randomly sample sites from an input VCF file, which may be provided as stdin. Scale the sampling probability by the field specified in KEY. This may be used to provide uniform sampling across allele frequencies, for instance. ๐ฏvcfrocโ Generates a pseudo-ROC curve using sensitivity and specificity estimated against a putative truth set. Thresholding is provided by successive QUAL cutoffs. ๐vcfsitesummarizeโ Summarize by site. ๐vcfstatsโ Prints statistics about variants in the input VCF file. ๐wcFstโ wcFst is Weir & Cockerhamโs Fst for two populations. Negative values are VALID, they are sites which can be treated as zero Fst. For more information see Evolution, Vol. 38 N. 6 Nov 1984. Specifically wcFst uses equations 1,2,3,4. ๐ฅ
๐ SOURCE CODE ๐
okay so if you wanna peek at the source, bestie, itโs right here:
https://github.com/vcflib/vcflib
๐ซถ CREDIT ๐ซถ
Citations are the bread and butter of Science. If you are using this software in your research and want to support our future work, please cite the following publication:
Please cite:
A spectrum of free software tools for processing the VCF variant call format: vcflib, bio-vcf, cyvcf2, hts-nim and slivar (https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1009123). Garrison E, Kronenberg ZN, Dawson ET, Pedersen BS, Prins P (2022), PLoS Comput Biol 18(5): e1009123. https://doi.org/10.1371/journal.pcbi.1009123
๐ LICENSE ๐
Copyright 2011-2024 (C) Erik Garrison and vcflib contributors. Copyright 2020-2024 (C) Pjotr Prins MIT licensed.
๐ AUTHORS ๐
Erik Garrison and vcflib contributors.
And thatโs the whole page, bestie โ vcflib, vcflib(1), no cap. Go slay some variants. ๐
โจ
๐ฆ where this page comes from
- debian trixie: libvcflib-tools 1.0.12+dfsg-1 ยท MIT
- ubuntu questing: libvcflib-tools 1.0.12+dfsg-1
- ubuntu resolute: libvcflib-tools 1.0.12+dfsg-2 ยท MIT
- ubuntu stonking: libvcflib-tools 1.0.12+dfsg-2 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms