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

VCF writer gives cryptic error when nodes with an individual are not flagged as samples #2257

Closed
benjeffery opened this issue May 10, 2022 · 3 comments
Labels
enhancement New feature or request Python API Issue is about the Python API
Milestone

Comments

@benjeffery
Copy link
Member

benjeffery commented May 10, 2022

Currently, if you try to dump a VCF of a tree sequence where the nodes that have individuals are not sample nodes you get the error:

LibraryError: Cannot generate genotypes for non-samples when isolated nodes are considered as missing

I think the VCF code should give an earlier error as it puts together the list of samples.

@benjeffery benjeffery added enhancement New feature or request Python API Issue is about the Python API labels May 10, 2022
@benjeffery benjeffery added this to the Python 0.5.0 milestone May 10, 2022
@benjeffery
Copy link
Member Author

At the same time give an nice error if there are individuals with no nodes, currently results in a KeyError.

@jeromekelleher
Copy link
Member

The issue Shing was hitting here is having a bunch of unreferenced individuals in the data model. Probably the right thing to is to tolerate this but to emit a warning (ignoring x individuals with no corresponding nodes).

If the individual does refer to a node, but the node is not a sample then this should be an error I think.

@jeromekelleher
Copy link
Member

Moving this up as we need it to generate VCFs for the pedigree generated tree sequences here: https://zenodo.org/record/6839683#.Yt-v43XMKEI

They contain individuals in the pedigree that are not samples - which is a perfectly reasonable thing to do, so we need to come up with a reasonable approach to dealing with this, which does the right thing in this instance.

jeromekelleher added a commit to jeromekelleher/tskit that referenced this issue Jul 26, 2022
jeromekelleher added a commit to jeromekelleher/tskit that referenced this issue Jul 26, 2022
jeromekelleher added a commit to jeromekelleher/tskit that referenced this issue Jul 27, 2022
jeromekelleher added a commit to jeromekelleher/tskit that referenced this issue Jul 28, 2022
Closes tskit-dev#2257

Interface tweaks.

Add explict error text to vcf tests
jeromekelleher added a commit to jeromekelleher/tskit that referenced this issue Jul 28, 2022
Closes tskit-dev#2257

Interface tweaks.

Add explict error text to vcf tests
jeromekelleher added a commit to jeromekelleher/tskit that referenced this issue Jul 28, 2022
jeromekelleher added a commit to jeromekelleher/tskit that referenced this issue Jul 28, 2022
@mergify mergify bot closed this as completed in 2d0d33e Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Python API Issue is about the Python API
Projects
None yet
Development

No branches or pull requests

2 participants