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

ENH: Make sample type an Auspice filter #228

Open
corneliusroemer opened this issue Apr 4, 2022 · 7 comments
Open

ENH: Make sample type an Auspice filter #228

corneliusroemer opened this issue Apr 4, 2022 · 7 comments

Comments

@corneliusroemer
Copy link

I think it would be nice to have sample type enabled as an Auspice filter.

It should be as easy as adding a few lines to the auspice_config.json that's used for exporting.

That way, one could quickly filter down to new samples as opposed to reference tree samples.

@yatisht
Copy link
Owner

yatisht commented Apr 4, 2022

@jmcbroome would this be easy to add?

@jmcbroome
Copy link
Collaborator

I'm afraid I'm lacking some context for this request. We don't use an "Auspice_config" json, we have a simple Nextstrain json format hardcoded into matUtils. Would "sample type" be some kind of metadata tagging that we could set a coloring by, similar to country? How would "sample type" be determined? Would this be part of an output from calling an UShER placement, and the samples would be tagged by whether they were added in that call?

@corneliusroemer
Copy link
Author

Happy to explain @jmcbroome :)

You already have it as a color by:
image

All that's needed is to add a little bit of code to the hardcoded auspice.json part here:

{"filters",json::array({"country"})},

I'll see what needs to be added to get it to work - it should just be a very small code change.

@corneliusroemer
Copy link
Author

Right now, filters seems to be empty, at least in the auspice.json produced by online Usher:
image

Maybe a bug? Or maybe I'm looking at the wrong part of the code.

@corneliusroemer
Copy link
Author

corneliusroemer commented Apr 4, 2022

Alright, so all you have to do is add the following inside filter:

"filters": ["country","userOrOld"]

That's it!

I manually edited an auspice.json produced by usher conforming with the above and it works 🎉

image

@corneliusroemer
Copy link
Author

Here's an auspice config.json I found in this repo. Not sure whether it's used at all.

https://github.com/yatisht/usher/blob/master/workflows/config/config.json

@corneliusroemer
Copy link
Author

@jmcbroome what I don't understand is why the filters array was empty. It should have already contained country but didn't. Any idea why?

The weird thing is, that I can only find a description mentioning matUtils while the description of the web produced auspice.json has a different description. So that may be why country isn't showing in the filter.

std::string desc = "JSON generated by matUtils. If you have metadata you wish to display, you can now drag on a CSV/TSV file and it will be added into this view, [see here](https://docs.nextstrain.org/projects/auspice/en/latest/advanced-functionality/drag-drop-csv-tsv.html) for more info.";

@AngieHinrichs do you have an idea where the web version of auspice meta comes from?

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

No branches or pull requests

3 participants