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

Make gene order in genotype color-by customizable #1549

Closed
joverlee521 opened this issue Sep 20, 2022 · 5 comments
Closed

Make gene order in genotype color-by customizable #1549

joverlee521 opened this issue Sep 20, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@joverlee521
Copy link
Contributor

Context

Related to #1548

Description

Currently, the order of genes in the genotype color-by dropdown option is listed alphabetically, with the exception of "nucleotide" which is added last (which will soon be changed in response to #1548).

Users may want to highlight an antigenically important gene (e.g. the "S" gene in SARS-CoV-2) and display the gene first in the dropdown. We should allow users to customize the display order of genes in this dropdown in the dataset JSON.

@jameshadfield
Copy link
Member

jameshadfield commented Sep 20, 2022

They are only alphabetical because that's how augur is exporting them -- the order they appear in the json→meta→genome_annotations dict is the order they will appear in auspice's dropdown. It would be nice to be able to customise this, but I think that functionality belongs in augur. (Not sure whether the place for this is augur translate or augur export v2).

Note: This relies on stable key ordering going from JSON to JS. This isn't always the case -- for instance, a gene name which is a (string) integer will be lifted to the top of the order. I'm not aware of any genes which are integers, so for our purposes I think we can treat it as stable and avoid a schema change.

@jameshadfield
Copy link
Member

I'm going to close this as nextstrain/augur#1052 should resolve

@joverlee521
Copy link
Contributor Author

Hmm, I was thinking the key ordering in genome_annotations is not reliable, so it should be a separate array field for listing the order of genes.

@tsibley
Copy link
Member

tsibley commented Sep 21, 2022

JSON objects are technically unordered, but some languages (incl. Python and JS) preserve order when encoding/decoding their native equivalent type to/from JSON objects. So if we care about interop with other JSON encoders/decoders, we may not want to rely on ordering of object fields.

@j23414
Copy link

j23414 commented Jan 19, 2023

Linking the Advanced Gene Viewing Options question to this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants