Skip to content

Update bcftools - #8435

Merged
wm75 merged 52 commits into
galaxyproject:mainfrom
mertydn:update-bcftools
Nov 13, 2026
Merged

wm75 merged 52 commits into
galaxyproject:mainfrom
mertydn:update-bcftools

Conversation

@mertydn

@mertydn mertydn commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

This PR updates bcftools tool wrappers from 1.21 to 1.24 to expose newly added functionalities from recent bcftools releases, align with upstream changes, and fix bugs and documentation errors.

General & Macro Updates

  • Added shared --verbosity controls across wrappers (macro_verbosity).
  • Added shared --no-version controls across wrappers (macro_no_version).
  • Added @THREADS@ handling where supported.
  • Updated input handling: removed legacy vcf.gz references; all compressed VCF inputs now properly use vcf_bgzip.
  • Updated test fixtures: migrated from uncompressed mpileup.vcf to compressed mpileup.vcf.gz.
  • Added automatic bgzip and tabix indexing for tabular allele frequency files (--AF-file).
  • Enabled u (uncompressed BCF) and z (compressed VCF) output types, and added a shared compression_level (0-9) parameter.
  • Renamed the common collapse option any to all to match bcftools 1.22+.

Tool-Specific Changes

bcftools_annotate

  • Added parameters: --force, --single-overlaps, --merge-logic, --pair-logic, --keep-sites.
  • Fixed typo in help documentation examples (inut.vcf -> input.vcf) and added @TARGETS_HELP@.
  • Added two tests covering the new parameters and merge logic.

bcftools_call

  • Added parameters: --group-samples-tag and --keep-unseen-allele.
  • Updated tests to use mpileup.vcf.gz fixture.
  • Added a test verifying the new 1.24 parameters.

bcftools_concat

  • Added parameters: --naive-force, --drop-genotypes.
  • Added exact value for --rm-dups.
  • Fixed naive mode when output_type=v: forces intermediate compressed output (z) followed by bcftools view conversion to prevent compression type mismatch errors.
  • Separated --naive-force and --drop-genotypes into distinct test cases (since bcftools does not allow combining them).

bcftools_consensus

  • Fixed a Cheetah template syntax bug ($mode.haplotype.rule was missing $).
  • Added the -H I value.
  • Added parameters: --missing and --prefix.
  • Added a new test for the 1.24 parameters.

bcftools_convert_from_vcf

  • Enabled the GL tag option for .gen format output (previously commented out).
  • Added @THREADS@, @VERBOSITY@, and @NO_VERSION@.

bcftools_convert_to_vcf

  • Added @THREADS@, @VERBOSITY@, and @NO_VERSION@.
  • Expanded help documentation describing supported input formats (GEN, HAP, TSV).
  • Updated test to verify shared options.

bcftools_csq

  • Added parameters: --greedy and GFF options (--force, --unify-chr-names).
  • Added @THREADS@ support.
  • Updated test 3 to assert the new options.

bcftools_filter

  • Updated --SnpGap to accept variant-type suffixes with regex validation.
  • Added tests explicitly exercising 2:indel and 2:mnp syntax.
  • Added usage examples to the help section.

bcftools_gtcheck

  • Modernized parameter interface to match 1.24:
    • Removed obsolete parameters (all-sites, plot, target-sample, query-sample).
    • Added --distinctive-sites, --dry-run, --error-probability (-E), --keep-refs, --n-matches, --no-HWE-prob, --pairs (-p), --pairs-file (-P), and --use (-u).
  • Allowed genotypes (-g) input to accept vcf_bgzip.
  • Added sample, include, and exclude restriction macros.
  • Expanded documentation explaining sample swap and contamination detection.

bcftools_merge

  • Added parameters: --gvcf (with or without reference FASTA), --force-single, --missing-to-ref, --local-alleles, --unobserved (* / **), --missing-rules, and --filter-logic.
  • Added snp-ins-del option to --merge.
  • Added a test verifying the new parameters.

bcftools_mpileup

  • Updated default values to align with bcftools 1.24 built-in defaults:
    • tandem-qual: 100 → 500
    • min-ireads: 1 → 2
    • gap-frac: 0.002 → 0.05
  • Renamed --non-reference to --no-reference (per bcftools 1.22+).
  • Added parameters: --config (preset profile) and -M / --max-read-len.
  • Added new output annotation tags: NMBZ, QM, SCR, INFO/FS, INFO/MQSBZ.
  • Fixed documentation: replaced misplaced csq help text with proper mpileup documentation and examples.
  • Added a test covering --config, --no-version, and filtering options.

bcftools_norm

  • Replaced --do-not-normalize with a structured realign_mode select:
    • all (default, preserves previous wrapper behavior by normalizing all indels)
    • skip (-N, disables realignment)
    • length (-N NUM, skips realignment for events longer than specified bp)
  • Added a regression test asserting that -N is not present when running with default settings.
  • Added parameters: --multi-overlaps, --force, --gff-annot, --keep-sum, and exact value for -d.
  • Expanded help text with atomization examples.

bcftools_query

  • Added parameters: --disable-automatic-newline (-N), --print-filtered (-F), and --force-samples.
  • Documented additional format tags (%INFO, %FORMAT, %FUNCTION, %N_PASS, %PBINOM, %VKX) and added practical query examples.

bcftools_reheader

  • Added --fai option to update contig headers from a FASTA index.
  • Added @THREADS@ support.
  • Re-enabled and fixed sample renaming test cases.

bcftools_roh

  • Updated viterbi_training parameter from boolean to a float convergence threshold, as required by bcftools roh.
  • Added --AF-tag parameter.
  • Fixed sliding buffer size/overlap conditions for numeric checks.
  • Added tests covering --viterbi-training "1e-10" and general options.
  • Expanded help text explaining ROH detection and RG/ST output records.

bcftools_stats

  • Replaced legacy boolean --verbose flag with the shared macro_verbosity macro.
  • Updated test cases to use the bgzipped mpileup.vcf.gz fixture.
  • Re-enabled the compressed VCF test case.
  • Added test covering --1st-allele-only, --depth, --af-bins, --split-by-ID, and --verbosity.

bcftools_view

  • Added --trim-unseen-allele (-A / -AA).
  • Added allele count/frequency type selectors (nref, alt1, minor, major, nonmajor) for -c, -C, -q, -Q.
  • Added --force-samples and --no-update subset options.
  • Updated test 1 to assert new parameters.
  • Added practical examples to the help section.

FOR CONTRIBUTOR:

  • I have read the CONTRIBUTING.md document and this tool is appropriate for the tools-iuc repo.
  • Use of AI
    • The contribution is mostly AI generated
    • The contribution has been assisted by AI
  • License permits unrestricted use (educational + commercial)
  • This PR adds a new tool or tool collection
  • This PR updates an existing tool or tool collection
  • This PR does something else (explain below)

@mertydn
mertydn force-pushed the update-bcftools branch 2 times, most recently from 9d4e01f to ee075fa Compare October 3, 2026 00:43
…ro_verbosity and macro_no_version, add test cases
…tests

- Replace --do-not-normalize with realign_mode select (all, skip, length)
- Keep 'all' as default to preserve backwards-compatible normalization behavior
- Expose --multi-overlaps, --force, --gff-annot, and --keep-sum
- Wire shared macro_verbosity and macro_no_version
- Add test for new options and regression test for default normalization
- Expand documentation with atomization examples
…d tests

- Support SnpGap string syntax (e.g. 2:indel, 2:mnp) with regex validation
- Wire shared macro_verbosity and macro_no_version
- Add tests for inverted targets and SnpGap variant-type syntax
- Add usage examples to help section
…ig and tests

- Update defaults to match bcftools 1.24 (tandem-qual 500, min-ireads 2, gap-frac 0.05)

- Rename --non-reference to --no-reference
- Add --config, --max-read-len and etc. params
- Wire shared macro_verbosity and macro_no_version
- Replace misplaced csq help text with proper mpileup documentation
- Add test for new parameters
… options

- Add --gvcf support for gVCF block merging
- Expose --force-single, --missing-to-ref (-0), and --local-alleles
- Add --unobserved to drop unobserved alleles (* / **)
- Add --missing-rules and --filter-logic
- Wire shared macro_no_version
- Add test covering new parameters
…re shared macros

- Expose --trim-unseen-allele (-A / -AA)
- Add allele count/frequency type selectors (alt1, minor, major, etc.)
- Add --force-samples and --no-update options
- Wire shared macro_verbosity and macro_no_version
- Update test 1 to cover new parameters
- Add usage examples to help section
…and tests

- Change viterbi_training from boolean to float convergence threshold
- Expose --AF-tag parameter
- Fix buffer_size and buffer_overlap conditions
- Wire shared macro_verbosity
- Add tests covering general options and --viterbi-training
- Expand documentation for ROH and Viterbi training
…e shared macros

- Expose --group-samples-tag for single-sample calling
- Expose --keep-unseen-allele to retain unobserved alleles
- Wire shared macro_verbosity and macro_no_version
- Update test inputs to use bgzipped mpileup fixture
- Add test for 1.24 parameters
… new options

- Expose --force, --single-overlaps, and --pair-logic
- Add --merge-logic for tabular annotations
- Add --keep-sites to preserve filtered sites
- Wire shared macro_verbosity and macro_no_version
- Fix typo in help examples and add targets help
- Add tests covering new parameters
…ing, -H I, --prefix

- Fix missing $ prefix in mode.haplotype.rule Cheetah evaluation
- Add -H I (IUPAC code for all genotypes)
- Add --missing option to mark missing genotypes with a custom character
- Add --prefix to prepend string to output sequence names
- Wire shared macro_verbosity
- Add test for new 1.24 parameters
- Expose --distinctive-sites, --dry-run, and --error-probability (-E)
- Add --keep-refs, --n-matches, and --no-HWE-prob
- Add --pairs (-p), --pairs-file (-P), and --use (-u)
- Add samples, include, and exclude restriction macros
- Wire shared macro_verbosity
- Update test and expand help documentation
…d expand docs

- Expose --disable-automatic-newline (-N) and --print-filtered (-F)
- Add --force-samples option
- Wire shared macro_verbosity
- Document new format fields (%INFO, %FORMAT, %PBINOM, %VKX)
- Add practical usage examples to help section
… wire verbosity

- Expose --fai option to update contig headers from FASTA index
- Add @threads@ support
- Wire shared macro_verbosity
- Fix and re-enable sample renaming tests
- Expand help documentation
… and tests

- Expose --greedy option
- Add GFF options: --force and --unify-chr-names
- Add @threads@ support
- Wire shared macro_verbosity and macro_no_version
- Update test 3 to cover new options
… tests

- Replace --verbose boolean with shared macro_verbosity
- Update test cases to use bgzipped mpileup fixture
- Re-enable compressed VCF test case
- Add test for depth, af-bins, split-by-ID, and verbosity options
- Fix user_tstv regex validator
…os, update docs

- Enable GL option for .gen tag selection
- Add @threads@ support
- Wire shared macro_verbosity and macro_no_version
- Capitalize labels for Galaxy consistency
- Update tests and expand format documentation
… and tests

- Add @threads@ support
- Wire shared macro_verbosity and macro_no_version

- Update test 7 to cover shared options
- Expand input format documentation in help section
- Wire shared macro_verbosity in general options
- Add verbosity check to test 5
- Wire shared macro_verbosity and macro_no_version
- Update test 2 to check for verbosity and no-version options
Comment thread tools/bcftools/bcftools_concat.xml Resolved
Comment thread tools/bcftools/bcftools_norm.xml Resolved
Comment thread tools/bcftools/bcftools_norm.xml Resolved
Comment thread tools/bcftools/bcftools_norm.xml Resolved
Comment thread tools/bcftools/bcftools_norm.xml Resolved
Comment thread tools/bcftools/bcftools_norm.xml Resolved
Comment thread tools/bcftools/bcftools_norm.xml Resolved
Comment thread tools/bcftools/bcftools_cnv.xml Resolved
Comment thread tools/bcftools/test-data/mpileup.vcf Resolved
@mertydn
mertydn requested a review from wm75 November 12, 2026 12:21
wm75 added 10 commits November 13, 2026 09:57
1. Better explanation of options
2. Remove unused "none" macro - the default
3. Use previously unused "id" macro where appropriate.
--collapse is deprecated but still works. Remove support for it from the
wrapper later, then reintroduce --pair-logic with more descriptive help.
These need to be done properly. Leave to next update.
@wm75

wm75 commented Nov 13, 2026

Copy link
Copy Markdown
Member

@mertydn I just pushed some minimal fixes. The idea would be to get this merged fast, then do another round of improvements and bring back the gt_check and annotate changes I dismissed this time on v1.25, which is out since 2 weeks by now).

@wm75
wm75 merged commit c083da6 into galaxyproject:main Nov 13, 2026
13 checks passed
@mvdbeek

mvdbeek commented Nov 13, 2026

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants