vrfs-variances
Perl parser for bcftools/vrfs SITE lines. It sorts candidate loci by their trailing distribution vector, keeps either a fraction or an absolute number of sites, and then emits one of three things: a default mixed summary, a site list, or a pure variance vector suitable for feeding back into bcftools +vrfs -r.
Quick Start
- Command:
bcftools +vrfs ... | vrfs-variances -n 0.2 - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/vrfs-variances - Input contract: reads
SITE\t...lines from stdin
When To Use This Tool
- Selecting a subset of
bcftools +vrfssites by fraction or absolute count - Computing the
VAR2vector expected by downstreambcftools +vrfs -rworkflows - Listing which
SITElines survived the ranking step - Adding reproducible random perturbation to the site distributions before variance calculation
Common Patterns
# Default summary from 20% of sites
bcftools +vrfs ... | vrfs-variances -n 0.2
# Emit only the variance vector for bcftools +vrfs -r
bcftools +vrfs ... | vrfs-variances -n 100 -v > var2.txt
# List the selected sites instead of summary numbers
bcftools +vrfs ... | vrfs-variances -n 100 -s > selected_sites.txt
Recommended Workflow
- Feed genuine
SITErecords frombcftools +vrfsinto stdin. - Decide whether
-nshould be a fraction (<=1) or an absolute count (>1). - Use the default mode for quick diagnostics,
-sfor site inspection, or-vfor downstream machine-readable variance values. - Add
-r <seed>only when you deliberately want stochastic perturbation and reproducibility.
Guardrails
- This tool is stdin-driven. If stdin is a TTY and you give no arguments, it prints the help message and exits.
- Only lines beginning with
SITEare parsed; everything else is ignored. -n <= 1is treated as a fraction of the sorted sites, while-n > 1is treated as an absolute count.- Default mode writes
MEANandVAR2summaries to stderr but also prints the final selectedSITEline to stdout, so capture streams intentionally. - Local testing showed
-scan duplicate the final selected site because the current code prints it once from the list-sites path and once again when the selection limit is reached. -vprints only the numeric variance vector, one value per line.