Skip to content

Validate source compatibility before merging by position #1197

Description

@Duncan-JR

MultiSourceView currently joins sources and ancestral annotations by position without checking contigs, REF alleles or duplicate annotation rows. This can select the wrong ancestral allele for the Unified Genealogies inputs (#1166).

For example, at GRCh37 20:10002611:

Input REF ALT Ancestral allele
TGP and SGDP SNP A G —
Ensembl deletion ATTA A ATTA
Ensembl SNP A G A

The lookup code currently selects the first Ensembl row, assigning ATTA to the SNP instead of A.

To prevent errors like this, I think we need the following:

  1. Allow SNP filtering of the ancestral annotation input like with other sources, and reject remaining duplicate annotations at selected positions. This can follow the same filtering approach suggested in #1192.
  2. Exclude sites with missing ancestral state (., N and empty strings) from both inference and augment_sites.
  3. Check that selected records resolve to one shared contig name using each store's contig_id array. For example, TGP uses index 19 for 20; SGDP and Ensembl use index 0 for the same name. This requires fixing the bug in Fix minor inconsistency in ancestor inference algorithm #1194.
  4. Check that REF agrees between sample sources and the selected annotations, raising an error with the source names and position on disagreement.

Together with inference-site filtering in #1198, these checks should make joining by position safe.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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