Skip to content

Releases: ShujiaHuang/BaseVar2

basevar v2.6.8

Choose a tag to compare

@ShujiaHuang ShujiaHuang released this 29 Jul 08:38

BaseVar v2.6.8 Release Notes

This is a maintenance release focused on code hygiene, a correctness fix in
genotype phase encoding, and a hot-path serialization optimization. VCF output
is byte-for-byte identical to v2.6.7 except for the phase-separator fix
described below.

Bug Fixes

  • VCF: encode genotypes as unphased in update_genotypes
  • Allele values were always correct; only the / vs | phase separator was
    affected, and only for odd-index alleles (e.g. 0|10/1, 1|11/1).

Performance Improvements

  • Caller: VCFTextLine::to_string() — eliminate per-line stringstream

Code Hygiene

  1. Remove dead to_string() methods

  2. Include-what-you-use cleanup

  3. Rename caller struct VCFRecordVCFTextLine

basevar v2.6.7

Choose a tag to compare

@ShujiaHuang ShujiaHuang released this 10 Jul 17:04

What's Changed

Build System

  • Fix pthread linking when using system htslib (USE_SYSTEM_HTSLIB=ON)
  • Add find_package(Threads REQUIRED) for proper threading support

This fixes bioconda build failure on Linux.

basevar v2.6.6

Choose a tag to compare

@ShujiaHuang ShujiaHuang released this 10 Jul 16:43

What's Changed

Build System

  • Add USE_SYSTEM_HTSLIB CMake option for conda packaging
  • Add install() target for proper binary installation
  • Add conda/ directory with bioconda recipe files

This release enables bioconda submission.

basevar v2.6.5

Choose a tag to compare

@ShujiaHuang ShujiaHuang released this 02 Jul 10:55

BaseVar v2.6.5 Release Notes

Performance Improvements

Caller: BGZF block-level merge for multi-thread and multi-region output

The basevar caller internal VCF merging has been optimized with BGZF block-level copy, eliminating decompression/recompression overhead:

  • Thread-level merge (previously merge_file_by_line): per-thread temporary .partN.vcf.gz files are now merged via raw BGZF block copying (bgzf_raw_concat). Since these temporary files contain no VCF header (headerless VCF data streams), the header is written once up-front and the remaining blocks are copied directly.

  • Multi-region merge (.vcf.gz output): when the output format is BGZF-compressed, multiple region VCFs are now merged via header-aware block-level copy (bgzf_naive_concat), which writes the header from the first file and skips headers from subsequent files. When the output is plain-text .vcf, the original line-by-line merge is preserved.

Enhancements

concat --naive mode: input/output format validation

  • BCF detection: input files starting with non-# bytes (BCF binary format) are rejected early with a clear error message.
  • BGZF format check: non-BGZF-compressed inputs are detected and rejected.
  • Output suffix validation: output file must have a .gz suffix since --naive mode always produces BGZF-compressed output.

basevar v2.6.4

Choose a tag to compare

@ShujiaHuang ShujiaHuang released this 01 Jul 13:23

BaseVar v2.6.4 Release Notes

Bug Fixes

Fix getopt_long optional_argument parsing issue in caller and concat

All options that accept a value in basevar caller and basevar concat have been changed from optional_argument to required_argument in the getopt_long definition.

Affected options (caller): -L, -m, -q, -Q, -B, -t, -r, -G
Affected options (concat): -L

Root cause: With optional_argument, getopt_long requires the value to be attached via = (e.g., --thread=64). Using space-separated syntax (e.g., --thread 64) caused the value to be interpreted as a positional argument, leading to errors such as:

terminate called after throwing an instance of 'std::runtime_error'
  what():  [bam.cpp::Bam:_open] file not found - 64

After fix: Both syntaxes now work correctly:

basevar caller --thread 64 -f ref.fa ...    # space-separated ✓
basevar caller --thread=64 -f ref.fa ...    # equals-sign ✓

All options remain optionalrequired_argument only means the value must be provided when the option is used, not that the option itself is mandatory.

basevar v2.6.3

Choose a tag to compare

@ShujiaHuang ShujiaHuang released this 01 Jul 03:28

New Features

AC_GT / AN_GT / AF_GT — GT-based allele count INFO fields

Added three new INFO fields that count alleles directly from the VCF GT column (posterior genotype calls with population prior):

Field Type Description
AC_GT Integer (Number=A) Per-ALT allele count from the VCF GT column
AN_GT Integer (Number=1) Total alleles in non-missing VCF GT calls
AF_GT Float (Number=A) Allele frequency = AC_GT / AN_GT

These complement the existing two tiers:

  • Posterior (recommended): AF, AC, AN — expected values from posterior probabilities (with population prior, distinct from GT)
  • Observed: AC_obs, AN_obs, AF_obs — discrete counts from argmin(PL) genotypes (without population prior, distinct from GT)

Improvements

VCF header description overhaul

All VCF header descriptions have been systematically audited and rewritten for clarity:

  • Removed internal terminology: Replaced "posterior mode", "legacy mode", "hard genotype", and "Bayesian mode" with user-friendly computation-based descriptions.
  • GT-source clarification: Added "distinct from GT" to AC/AN/AF and AC_obs/AN_obs/AF_obs descriptions, making it explicit that these are NOT derived from the VCF GT column.
  • AF recommendation: The AF field description now includes "(recommended by BaseVar)" to guide users toward the preferred allele frequency metric.
  • AN description: Updated to clarify it equals 2 × number of samples.
  • AF_group description: Made more generic; removed LRT-specific reference since the field may use different estimation methods.
  • BaseQRankSum: Fixed inconsistent capitalization ("Alt Vs. Ref" → "Alt vs. Ref").

VCF 4.2 compliance fixes

  • AD: Type=StringType=Integer (VCF 4.2 spec compliance)
  • DP4: Number=ANumber=. (variable-length list, not per-allele)

Single-region VCF output optimization

When calling variants in a single region, BaseVar now directly renames the temp VCF file to the output instead of performing a read-write merge. This eliminates unnecessary I/O for single-region runs.

basevar v2.6.2

Choose a tag to compare

@ShujiaHuang ShujiaHuang released this 30 Jun 10:33

BaseVar v2.6.2 Release Notes

Overview

v2.6.2 is a correctness-focused release that fixes two latent bugs in the variant caller's PL (Phred-scaled genotype likelihood) indexing and AC/AN observation counting, and introduces key improvements to the posterior genotype calling mode. All bugs affect multi-allelic sites; bi-allelic behavior is unchanged.

What's New

Dosage-Based AC/AN/AF in Posterior Mode

In posterior mode (--gt-mode posterior, the default), INFO fields AC/AN/AF now report dosage-based values computed from genotype posterior probabilities:

  • AF = expected allele frequency from posterior dosage (recommended by BaseVar)
  • AC = round(expected allele count from dosage)
  • AN = 2 × N_samples

This provides more accurate allele frequency estimates for ultra-low coverage data compared to the previous reads-based counts. Legacy mode (--gt-mode legacy) behavior is unchanged.

Bug Fixes

fix some bugs

basevar v2.6.1

Choose a tag to compare

@ShujiaHuang ShujiaHuang released this 30 Jun 01:32

BaseVar v2.6.1 Release Notes

Bug Fix

v2.6.1 is a critical bug fix release that resolves Indel variant loss introduced by the binary batchfile format (v2.6.0). Approximately 2.2% of Indel variants were silently dropped during variant calling due to incorrect ref_base storage semantics in the .bbf binary format.

basevar v2.6.0

Choose a tag to compare

@ShujiaHuang ShujiaHuang released this 29 Jun 16:11

BaseVar v2.6.0 Release Notes

Bug Fixes

  1. Fix sparse index lockstep position loss
  2. Fix VCF coordinate corruption in binary batchfile reader

The fix adds a backfill step after the reader loop to ensure all samples have consistent ref_id/ref_pos values before calling the variant caller.

  1. Fix redundant file open in binary batchfile reader

Performance Improvements

  1. Binary batchfile read path optimizations

  2. Buffer-serialized binary I/O

  3. Eliminate redundant seek_virtual

  4. Dead code removal

What's New

New basevar dump subcommand

A new dump subcommand for inspecting intermediate binary batchfile (.bbf) and binary index (.bbi) files. This is useful for debugging, verifying file integrity, or examining per-sample read data at specific genomic positions.

# Inspect .bbi index summary (magic, version, entries, position range, footer integrity)
basevar dump sample.bbf.bbi

# List all index entries
basevar dump sample.bbf.bbi --entries

# Show .bbf header (sample IDs) only
basevar dump sample.bbf --header

# Show all positions in compact summary format
basevar dump sample.bbf

# Show per-sample details at a specific position
basevar dump sample.bbf -r chr11:5246595-5246595 -v

# Dump first 20 positions with full per-sample read data
basevar dump sample.bbf -n 20 -v

basevar v2.5.3

Choose a tag to compare

@ShujiaHuang ShujiaHuang released this 29 Jun 09:08

BaseVar v2.5.3 Release Notes

Overview

v2.5.3 is a performance optimization release that significantly reduces runtime overhead in the variant calling pipeline through four targeted improvements: eliminating ostringstream conversion bottlenecks, replacing per-base string allocations with char, adding move semantics for BamRecord, and introducing EM hot-start for the step-down procedure.

Upgrade Recommendation

All v2.5.2 users are recommended to upgrade to v2.5.3 for improved runtime performance with no change in output.