Does BCFTools merge -m all also merge partially overlapping variants with different starting positions?

Open
#327 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
c

Research direction

Start by examining the behavior of bcftools merge -m all described in the issue and compare it with vcfcreatemulti for partially overlapping records with different starting positions. Determine whether this behavior is intended; done means the expected behavior is decided and documented, with a focused regression test if support is added.

Written by the indexing model from the issue text.

Description

enhancement

Hi,

Does BCFTools merge -m all also merge partially overlapping variants?

When I merge two multi-sample vcf files with bcftools and then convert the complex variants in the merged vcf file to primitives (vcfallelicprimitives) I get duplicate variant records ( identical CHROM, POS, REF, ALT).

This seems to be caused by BCFTools not merging variant records from the 2 vcf files that only partially overlap, ie the variants don't have the same starting position but the starting positions are almost next to each other and the complex alleles overlap.

To solve this problem I currently have to process the merged vcf file with vcfcreatemulti from the vcflib package.
https://github.com/ekg/vcflib#vcfcreatemulti

I did expect "bcftools merge -m all" to have the functionality to merge variant records based on partially overlapping alleles, without having to have the exact same starting position for each variant record.

Can you confirm that this is or is not the case? And if not if this is something you are planning to add to bcftools?

Thank you!

Dominant language
C
Stars
891
Forks
277
Avg merge
2d 23h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from samtools/bcftools

All issues in samtools/bcftools

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.