Skip to content

Link between variable and function to compute it #1115

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

Open
jeromekelleher opened this issue Aug 17, 2023 · 2 comments
Open

Link between variable and function to compute it #1115

jeromekelleher opened this issue Aug 17, 2023 · 2 comments
Labels
data representation Issues related to how data is represented: data types, data structures, indexes, access methods, etc

Comments

@jeromekelleher
Copy link
Collaborator

There doesn't seem to be any link between variables, and how they are computed either in the documentation, or in error messages. For example, I want to get variant_allele_frequency which I can search for in the docs and I find the spec, but this doesn't tell me that I need to call variant_stats to compute it. If I access the variable, I just get an error

    get_prob_dist(ds)
  File "/scratch/jk/work/github/sgkit-publication/src/collect_data.py", line 37, in get_prob_dist
    af = ds.variant_allele_frequency.values[:, 1]
  File "/home/jk/.local/lib/python3.9/site-packages/xarray/core/common.py", line 278, in __getattr__
    raise AttributeError(
AttributeError: 'Dataset' object has no attribute 'variant_allele_frequency'

It would be nice if the error message told me "you need to call sg.variant_stats(ds)

Likewise, I was looking at call_dosage, which I could find no documentation on.

I wonder if there's some sort of automatic annotation we could add to variables that would help with this?

@ravwojdyla I seem to remember you were thinking about things like this before??

@ravwojdyla ravwojdyla added the data representation Issues related to how data is represented: data types, data structures, indexes, access methods, etc label Aug 18, 2023
@ravwojdyla
Copy link
Collaborator

@jeromekelleher that's a great comment, and I can see how that would be an awesome improvement from a user perspective and especially for new users. I will take a look at the variable specification and get back to you on this.

@tomwhite
Copy link
Collaborator

#293 is related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data representation Issues related to how data is represented: data types, data structures, indexes, access methods, etc
Projects
None yet
Development

No branches or pull requests

3 participants