Vcf api fixes - #432
Merged
Merged
Conversation
The drop_genotypes keyword on write_vcf / VcfWriter was redundant: bcftools view -G semantics (omitting the FORMAT field and all sample columns from both header and records) are produced entirely by clearing the reader's sample selection with reader.set_samples([]), which the CLI already does for -G. With samples cleared, the flag had no effect on the header (driven by sample count) or records (write_chunk forces gt=None when num_samples == 0), and its phased-genotype branch was already dead code. Its only standalone effect was emitting malformed VCF (GT stripped but sample columns retained). Drop the parameter from write_vcf and VcfWriter and simplify write_chunk. The CLI keeps the -G/--drop-genotypes flag and its validations; only the redundant plumbing into write_vcf is removed. set_samples([]) is now the documented, tested way to drop genotypes.
Previously a fill_tags tag with no corresponding virtual field for the store was silently dropped. write_vcf / VcfWriter now raise ValueError listing the unknown tag(s) and the tags available for the store, so a direct API caller gets immediate feedback instead of a silently unfilled INFO field. The CLI keeps its own --fill-tags validator; this makes the writer self-defending for non-CLI callers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.