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

Display methods for Variant #2367

Closed
jeromekelleher opened this issue Jun 27, 2022 · 5 comments · Fixed by #2384
Closed

Display methods for Variant #2367

jeromekelleher opened this issue Jun 27, 2022 · 5 comments · Fixed by #2384
Assignees
Labels
enhancement New feature or request Python API Issue is about the Python API
Milestone

Comments

@jeromekelleher
Copy link
Member

When we print out a Variant we get <tskit.genotypes.Variant object at 0x7f58b0483430>

We should add a str and repr_html to fix this.

Did this change in 0.5.0? Was Variant a dataclass before, and therefore inherited display methods?

@jeromekelleher jeromekelleher added enhancement New feature or request Python API Issue is about the Python API labels Jun 27, 2022
@jeromekelleher jeromekelleher added this to the Python 0.5.1 (paper) milestone Jun 27, 2022
@benjeffery
Copy link
Member

Ah, yes, I think it was a dataclass. This def needs doing.

@szhan szhan self-assigned this Jun 28, 2022
@szhan
Copy link
Member

szhan commented Jun 28, 2022

I just chatted with @benjeffery about this. Resolving this issue involves adding the methods __str__() and _repr_html_() to the Variant class. The methods should print out details about the Site and allele counts derived from the genotypes (?). Also, it should be able to deal with the case where a Variant instance isn't assigned to a Site instance yet.

@jeromekelleher
Copy link
Member Author

Yes, it would be really nice to add some useful information to these!

@szhan
Copy link
Member

szhan commented Jul 5, 2022

Should it also show all the information about the Site as well as the number of missing genotypes?

@benjeffery
Copy link
Member

Should it also show all the information about the Site as well as the number of missing genotypes?

Sure, I don't think that is overkill.

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

Successfully merging a pull request may close this issue.

3 participants