vcflib(1)

๐Ÿ“ฆ
version 1.0.12 ยท 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿฆ‹ 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 specified vcf file using the set of filters. slay.
  • vcfuniq โ€” List unique genotypes. Similar to GNU uniq, but aimed at VCF records. vcfuniq removes records which have the same position, ref, and alt as 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 also vcfcreatemulti for 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โ€™s REF matches a given reference file.
  • vcfdistance โ€” Adds a tag to each variant record which indicates the distance to the nearest variant. (defaults to BasesToClosestVariant if 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 adds EntropyRef and EntropyAlt for 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 the vcf file.
  • vcfhethomratio โ€” Generates the het/hom ratio for each individual in the file.

๐Ÿงฌ phenotype ๐Ÿงฌ

  • permuteGPAT++ โ€” permuteGPAT++ is a method for adding empirical p-values to a GPAT++ score.

๐Ÿงฌ genotype ๐Ÿงฌ

  • abba-baba โ€” abba-baba calculates 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 = false for abba and baba. The tree argument should be specified from the most basal taxa to the most derived. basal to derived, no cap.
  • hapLrt โ€” HapLRT is 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 โ€” normalizes iHS or XP-EHH scores. 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 โ€” generates sample_seq:N.fa for 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 -g and 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 the A index ๐Ÿ’œ
  • 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 paths
  • vcfallelicprimitives โ€” > 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 use vcfwave instead. 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-tag is the name of the sample flag that gets added to store the annotation. it also adds a has_variant flag 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, mnp
  • vcfcleancomplex โ€” 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 where AC and NS have been generated for each record using sample genotypes
  • vcfflatten โ€” removes multi-allelic sites by picking the most common alternate. requires allele frequency specification AF and use of G and A to 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 indexes
  • vcfgeno2haplo โ€” converts genotype-based phased alleles within โ€“window-size into 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 max
  • vcfglxgt โ€” sets genotypes using the maximum genotype likelihood for each sample
  • vcfindex โ€” 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 INFO
  • vcfintersect โ€” VCF set analysis ๐Ÿ”
  • vcfkeepgeno โ€” okay so bestie, this one slims down your file by removing FORMAT fields not listed on the command line from sample specifications in the output. It's giving minimalism ๐Ÿ’…
  • vcfkeepinfo โ€” To decrease file size, remove INFO fields not listed on the command line. Less is more, queen โœจ
  • vcfkeepsamples โ€” outputs each record in the vcf file, removing samples not listed on the command line. Bye felicia ๐Ÿ‘‹
  • vcfld โ€” Compute LD. 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 the FORMAT for each variant line the same (uses all the FORMAT fields described in the header). Fills out per-sample fields to match FORMAT. Expands GT values of `.' with number of alleles based on ploidy (eg: `./.' for dipolid). It's giving uniformity โœจ
  • vcfnumalt โ€” outputs a VCF stream where NUMALT has been generated for each record using sample genotypes. Slay ๐Ÿ’…
  • vcfoverlay โ€” Overlay records in the input vcf files with order as precedence. First one wins, bestie ๐Ÿ‘‘
  • vcfprimers โ€” For each VCF record, extract the flanking sequences, and write them to stdout as FASTA records suitable for alignment. Get those primers, queen ๐Ÿงฌ
  • vcfqual2info โ€” Puts QUAL into 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 the cigar and 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 the vcf file, 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-level INFO. 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 (either stdin or file) using a streaming sort algorithm. Guarantees that the positional order is correct provided out-of-order variants are no more than 100 positions in the VCF file apart. So if they're within 100 spots, you're good ๐ŸŒˆ
  • vcfwave โ€” Realign reference and alternate alleles with WFA, parsing out the `primitive' alleles into multiple VCF records. 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