Skip to content

Allow truncated samples (with missing data to left and right) #153

@hyanwong

Description

@hyanwong

I think it shouldn't be too hard to allow samples with missing data, presumably marked as a variant whose allelic state is set to tskit.NULL using the current notation this would be an allelic state equal to constants.UNKNOWN_ALLELE e.g.

sample_data.add_site(
    position=1234, genotypes=[0, 0, 1, tsinfer.constants.UNKNOWN_ALLELE], alleles=["G", "C"])

Allowing missing sites in the zarr storage would require setting sites.genotypes to dtype=np.int8 rather than np.uint8, but I guess that's fine. It would need a bit of hacking to pass the various error checks, and to skip matching that bit of the sample against the ancestors. But we have the code to do that for ancestor matching anyway, so I assume it would be a reasonably easy change.

(modified to reflect the fact that we currently use tsinfer.constants.UNKNOWN_ALLELE == 255)

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