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

Comparing datasets - remapping alleles. #1099

Open
benjeffery opened this issue Jun 29, 2023 · 0 comments
Open

Comparing datasets - remapping alleles. #1099

benjeffery opened this issue Jun 29, 2023 · 0 comments

Comments

@benjeffery
Copy link
Collaborator

We often have the use case of comparing two or more datasets where the corresponding sites have different allele mappings. For example, the ordering could be different, or one dataset could have alleles that aren't in the other.
This makes directly comparing the genotype arrays annoying and error prone. I would be good to have come API support for re-mapping the alleles in sgkit.

Maybe something like ds.remap_alleles(allele_mapping) which returns a dataset with the remapped alleles? allele_mapping would either be:

  • a dict such as {'A':1, 'G':56, '-':2} that would be used across all variants.
  • a list of dicts which a mapping for each variant.

There could then be an additional method that creates a mapping dict from a set of datasets. This splitting of the functionality allows using either fixed mappings like ACTG or one based on the alleles seen.

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

No branches or pull requests

1 participant