Skip to content

Handle deletions with different reference alleles when generating variant_id #415

Description

@svarona

The current logic for generating variant_id assumes that the reference allele (REF) is unique for a given genomic position. As a result, variants are identified using only:

{position}_{ALT}

This assumption is valid for most SNVs but breaks down for deletions, where different deletions can start at the same position while having different reference alleles.

For example:

Sample POS REF ALT
sample1 121 AAT A
sample2 121 AA A

With the current implementation, both variants are assigned the same identifier: 121_A

However, they represent different biological variants:

AAT → A (e.g. c.delAT)
AA → A (e.g. c.delA)

Since variant annotations are stored independently of samples, the database ends up containing multiple annotations associated with the same variant_id.

When variant information is later retrieved for a specific sample, the database cannot determine which annotation corresponds to the original variant and returns both annotations, leading to incorrect results.

Expected behavior:

The variant_id should uniquely identify a variant, including deletions with different reference alleles. Variants that share the same position and ALT but have different REF alleles should receive different identifiers.

Suggested solution:

Review the variant_id generation strategy so that it uniquely represents all variant types. For example, incorporating the reference allele into the identifier (or adopting another canonical representation) would distinguish variants such as:

121_AAT_A
121_AA_A

This will require a manual curation part at some point.

Impact:

Prevents annotation collisions in the database.
Ensures each sample retrieves only the annotation corresponding to its actual variant.
Improves the correctness of variant storage and downstream annotation queries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions