Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
jan-glx opened this issue Feb 15, 2024 · 1 comment
Closed

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

jan-glx opened this issue Feb 15, 2024 · 1 comment

Comments

@jan-glx
Copy link

jan-glx commented Feb 15, 2024

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>] [...]

@pd3 pd3 closed this as completed in d092f00 Feb 23, 2024
@pd3
Copy link
Member

pd3 commented Feb 23, 2024

There is now a new option --force-single which allows to run a single file through merge.

Note this could be further enhanced by allowing PL to LPL conversion as requested by #2105. (Not done by this commit)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants