farhat-lab / gentb-site

The genTB project, the Django site, variant calling and prediciton pipeline, and mapping pipeline with hooks to two ravens
https://gentb.hms.harvard.edu
Other
8 stars 11 forks source link

Antibiogram app #254

Closed mahafarhat closed 2 years ago

mahafarhat commented 3 years ago

We want to create a modified version of the Maps, that only has 'country' and 'drug' side tabs. This new 'antibiogram' app, will be displayed alongside Maps, Predict, and Data on the main website and on the upper bar.

The input is Avika's antibiogram dataset. We are aiming for a display that has the features of the following Tableau map: https://public.tableau.com/views/MarginalResistance/Sheet1?:language=en-US&publish=yes&:display_count=n&:origin=viz_share_link (one example)

There are three types of antibiograms we want to display (this will be an initial fork with three options: margin, rifampicin susceptible and rifampicin resistant. https://public.tableau.com/app/profile/avika8515

We have the option of embedding this new feature as a Tableau frame: https://help.tableau.com/current/pro/desktop/en-us/embed.htm

doctormo commented 3 years ago

First draft of this antibiograms feature is now live:

https://gentb.hms.harvard.edu/maps/antibiogram/

This includes:

mahafarhat commented 3 years ago

Some features to refine/add:

**A reminder of which variable we need for each 'estimate type'

  1. marginal resistance rate (p_a_r )
  2. mono-resistance (mean_snp10_res_rs)
  3. resistance-among RR (mean_snp10_res_rr)
doctormo commented 3 years ago
doctormo commented 3 years ago

I've fixed what I can for today, I'm improved the apps flexibility so it'll be much easier to change some of the items above no matter what happens, and should allow us to show more types of data in the maps.

I'll add the filtering next week if the details can be provided. Mostly I just need to know the mechanism expected.

avdixit commented 3 years ago

Yes the correct columns are:

mono-resistance (mean_snp10_rs) resistance-among RR (mean_snp10_rr)

avdixit commented 3 years ago

Filtering:

mahafarhat commented 3 years ago

A reminder that these tableau maps are what we need, you can use these as examples of the filtering: We are aiming for a display that has the features of the following Tableau map: https://public.tableau.com/views/MarginalResistance/Sheet1?:language=en-US&publish=yes&:display_count=n&:origin=viz_share_link (one example)

There are three types of antibiograms we want to display (this will be an initial fork with three options: margin, rifampicin susceptible and rifampicin resistant. https://public.tableau.com/app/profile/avika8515

mahafarhat commented 3 years ago

the three maps should represent the filtering by estimate type, as noted above in the thread

doctormo commented 3 years ago

Note to future: the filtering mechanisms are evident in the example tablue in the first posting.

mahafarhat commented 3 years ago

Regarding "Instead of seeing a separate “Drug” tab, can we have a drop down menu near the map to select the drug of interest?" Please engineer this if it will take < 5 hours of work.

doctormo commented 3 years ago

Today the drug filtering was moved into the main body and a start was made on getting the other filtering to work. Although this is proving to be a bit more involved it's progressing nicely.

Screenshot from 2021-09-06 16-53-26

doctormo commented 3 years ago

Question for next week: when you say "Estimate type" what you mean is "These are the different columns which the data should be based on"? which isn't a filter, it's a selector (or data source). Please confirm as filtering on these columns can be possible, but if the map always shows the same column in the map colours you may get grumpy.

If it's true that these are different map column sources. Wouldn't it be better to have them as three different maps on the side (where you currently see "World") instead of trying to make them fit in as a fancy filter?

avdixit commented 3 years ago

Thanks Martin - i see what you mean. I think it would better to have them as a filter rather than three different maps. I could’ve just made the table in a more “long” format then it would have been a filter. Maha may also have additional thoughts.

avdixit commented 3 years ago

On further thought, three different Maps does sound like a simpler solution but I would defer to Maha on this. A few additional comments:

doctormo commented 3 years ago

Hi Avika, some of the items above are because the fixes are not deployed yet. Please bare with me while I get the map situation sorted out.

@mahafarhat Are multiple maps ok?

avdixit commented 3 years ago

Thanks Martin! I can confirm on behalf of @mahafarhat that multiple maps as you suggested are good to go, we discussed this on Friday.

doctormo commented 3 years ago

@avdixit I've put together the software and deployed it to o2 and have created three maps based on the above instructions ( we can tweak these further)

You can see the maps here: https://gentb.hms.harvard.edu/maps/antibiogram/

I'll do some more testing to see how it goes on live. But for now I'm attaching an animated gif of how you can create and edit the map information as needed:

adding-a-new-map

mahafarhat commented 2 years ago

@doctormo one last feature, and one minor fix to add and we can close this issue. 1- I noticed the map color scale does not adapt to the data range for each map, e.g. click mono-resistance > drug=LEVO > Limit by sample size = 50 and you get this all white map image

I do care a lot about the difference between 0.5% and 2.5% in that plot, can we scale the color palate so it only spans the range of available variable values based on the filtering?

2- please delete marginal resistance from the title of the map

doctormo commented 2 years ago

This should now be fixed.

Screenshot from 2021-09-27 13-44-20