-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Labels
Python APIIssue is about the Python APIIssue is about the Python API
Milestone
Description
There are often times when we'd like to get the genotypes for a given site as the actual alleles rather than the indexes into the alleles list. (This is what #2168 was about, I assume.)
We can add this as a method to the Variant class easily enough. We can just raise an error if there are any non-1 length alleles in there.
What do we call it?
This is the replacement also for the old as_bytes option, which basically did the same thing.
It might look something like
def genotypes_as_alleles(self): -> str
"""
Returns a string s in which s[j] is the value of ``var.alleles[var.genotypes[j]]``. Raises an error if
all alleles are not of length 1.
"""Metadata
Metadata
Assignees
Labels
Python APIIssue is about the Python APIIssue is about the Python API