Skip to content

bcftools merge: support single-file edge case [enhancement] #2100

@jan-glx

Description

@jan-glx

If bcftools merge is called with only a single vcf file, it fails with:

About:   Merge multiple VCF/BCF files from non-overlapping sample sets to create one multi-sample file
Note that only records from different files can be merged, never from the same file. For "vertical" merge
take a look at "bcftools norm" instead.  
Usage:   bcftools merge [options] <A.vcf.gz> <B.vcf.gz> [...] 

This is quite a useful error message.
However, since I have to merge a varying number of vcf files for a large number of sets of vcf files with various cardinality, including 1 but thankfully not 0, I currently need check the number of files for each set upfront and use cp /bcftools view instead if the current set has only one file. Therefore, I thik it would be great if bcftools merge would only warn, not error in the single file case, i.e if usage was relaxed to Usage: bcftools merge [options] <A.vcf.gz> [<B.vcf.gz>] [...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions