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

Add denominators to each antibiotic in antibiogram #153

Open
andrewjmc opened this issue May 16, 2024 · 2 comments
Open

Add denominators to each antibiotic in antibiogram #153

andrewjmc opened this issue May 16, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@andrewjmc
Copy link

I have another suggestion. Sometimes one might wish to add raw denominator (and/or numerator) data to an antibiogram for each result. It might be verbose, but could be used for some downstream processing.

I tested a small hard-coded modification to the antibiogram code, with success except for the use of the digits parameter (I must have misunderstood some context). It would be little addition to have a parameter like raw_n with default NA and possible values of "N/D" and "D".

I'll be interested in your thoughts!

function (x, antibiotics = where(is.sir), mo_transform = "shortname", ab_transform = NULL, syndromic_group = NULL, add_total_n = TRUE, only_all_tested = FALSE, digits = 0, col_mo = NULL, language = get_AMR_locale(), minimum = 30, combine_SI = TRUE, sep = " + ", info = interactive()) { ... out <- out %pm>% pm_summarise(SI = paste0(round(numerator * 100/total, digits = digits), "% (", total, ")")) ... long_to_wide <- function(object, digs) { #object$SI <- round(object$SI * 100, digits = digs) ... }
@msberends
Copy link
Owner

msberends commented May 20, 2024

Yes, that's a nice idea. They are 'kind of' added already at the moment, where I for the implementation followed this table from a recent paper to present the data. It's also shown in our manual:

image

The first column contains the denominators, but that can of course be different per antibiotic. That's not optimal. Where would you want to present the D or N/D then? Perhaps instead of the %SI?

@msberends msberends added the enhancement New feature or request label May 20, 2024
@andrewjmc
Copy link
Author

Thanks, I had noted the ability to provide in aggregate. In the example I gave I have presented by appending to the %SI, e.g. 6 becomes 6% (6/100). But it could be implemented with flexibility to provide denominators only, e.g. 6% (100). Alternative approaches could duplicate columns (e.g. AMK % and AMK n/d) or rows (e.g. CoNS % and CoNS n/d).

For me, I'm thinking of it more for downstream processing than for presentation - i.e. could be included as a hover detail in a plotly chart. There are use cases for presentation. If it is provided in a structured way, users can post-process to present richly-formatted tables (e.g. present the denominator in a small font size, different colour).

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

2 participants