Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: regression in multiallelic support for simgenotype #195

Merged
merged 16 commits into from
Mar 5, 2023
Merged

Conversation

aryarm
Copy link
Member

@aryarm aryarm commented Mar 1, 2023

In PR #163, we started using the GenotypesRefAlt class in simgenotype to make it consistent with our other tools. Unfortunately, the GenotypesRefAlt class only supports biallelic genotypes. But since simgenotype had previously supported multi-allelic variants, this became a regression.

This PR adds support for multi-allelic variants in the GenotypesRefAlt class and its children by changing the variants property to store a variable-length list of alleles instead of assuming that there are only ever two alleles. This is officially a BREAKING change to the haptools data API, specifically for the GenotypesRefAlt class, the GenotypesPLINK class and the GenotypesAncestry class!

Also, the GenotypesRefAlt class will be officially renamed to GenotypesVCF! It's something I've liked to do for a while and figured we might as well do it now while we're breaking everything, anyway.

Note that this PR does not add support for tandem repeats yet. You'll be able to read and write multi-allelic variants in the GenotypesRefAlt class but not much else besides that. For example, you shouldn't use this class for association analyses of multi-allelic variants because the data property of the class simply stores their index, not their dosage.

@aryarm
Copy link
Member Author

aryarm commented Mar 1, 2023

I'm keeping this as a draft PR because there are still a few things to do:

  • update the haptools data docs
  • add tests for multi-allelic reading and writing
  • figure out desired behavior for handling unphased and non-missing genotypes in simgenotype @mlamkin7
    • and depending on what we decide, we might also want to document the decision?
  • add support for writing missing genotypes in the GenotypesVCF and GenotypesAncestry classes? and add tests for this
  • update the API docs

@aryarm aryarm changed the title fix: multiallelic support in simgenotype fix: regression in multiallelic support for simgenotype Mar 1, 2023
@aryarm aryarm marked this pull request as ready for review March 1, 2023 20:51
@aryarm aryarm requested review from mlamkin7 and removed request for mlamkin7 March 1, 2023 20:51
@aryarm aryarm marked this pull request as draft March 1, 2023 22:03
@mlamkin7
Copy link
Collaborator

mlamkin7 commented Mar 3, 2023

I'm keeping this as a draft PR because there are still a few things to do:

  • update the haptools data docs

  • add tests for multi-allelic reading and writing

  • figure out desired behavior for handling unphased and non-missing genotypes in simgenotype @mlamkin7

    • and depending on what we decide, we might also want to document the decision?
  • add support for writing missing genotypes in the GenotypesVCF and GenotypesAncestry classes? and add tests for this

  • update the API docs

Melissa thinks its best if we have support for writing missing genotypes and store that instead of removing the sample or variant. For handling unphased we can keep as is right now.

@aryarm
Copy link
Member Author

aryarm commented Mar 3, 2023

ok, great - I'll add support for missing genotypes soon

For handling unphased we can keep as is right now.

ok, so we don't want to check that the reference panel is phased, then?

@mlamkin7
Copy link
Collaborator

mlamkin7 commented Mar 3, 2023

Correct

@aryarm aryarm marked this pull request as ready for review March 4, 2023 19:59
@aryarm aryarm merged commit b57f91f into main Mar 5, 2023
@aryarm aryarm deleted the fix/outputvcf branch March 5, 2023 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants