msberends / AMR

Functions to simplify and standardise antimicrobial resistance (AMR) data analysis and to work with microbial and antimicrobial properties by using evidence-based methods, as described in https://doi.org/10.18637/jss.v104.i03.
https://msberends.github.io/AMR/
Other
85 stars 14 forks source link

strange results for P. aer when using BRMO-guideline within MDRO() #21

Closed jukkiebah closed 3 years ago

jukkiebah commented 3 years ago

Hai

When i use the mdro() function with the dutch wip-brmo guidelines (or when using the equivalent brmo() function), I get strange results for my Pseudomonas aeruginosa isolates: A portion (~8%, n=1080 isolates) are labeled MDRO/BRMO positive, the rest is negative. However the positive isolates have reason ‘not covered by BRMO guideline ", and in results for non-susceptible it says “” (aka the string is empy). I am not entirely sure if these are labeled correctly, so I want to be able to see which antibiotics are labeled by the algoritm as non-susceptible. These isolates are covered by the guideline, so I think there is a mistake in there somewhere. Thanks!

msberends commented 3 years ago

Can you share a couple of rows that should have been flagged?

E.g., using

df %>%
  # this assumes dplyr 1.0.0 or later and
  # that your mo column is named 'microorganism':
  select(microorganism, where(is.rsi)) %>%
  saveRDS("psae.rds")

And then uploading psae.rds here?

msberends commented 3 years ago

Or any other way I can see some antibiotic results 😃

Can also be plain text. Don't put too much effort into it, I can work with any bunch of text or data.

jukkiebah commented 3 years ago

Thank you!

hereby:

psae.feather.zip

msberends commented 3 years ago

Alright, I could reproduce it:

# AMR 1.5.0
# dplyr 1.0.2
# cleaner 1.5.1 - for freq()

psae <- arrow::read_feather("/Users/msberends/Downloads/psae.feather")
psae2 <- psae %>%
  mutate(Microbe_ID = as.mo(Microbe_ID)) %>%
  mutate_if(is.rsi.eligible, as.rsi) %>%
  rename_with(as.ab, where(is.rsi)) %>% 
  filter(mo_genus() == "Pseudomonas",
         mo_species() == "aeruginosa")

nrow(psae2)
#> [1] 15872

psae2 %>% mutate(brmo = brmo())
#> NOTE: Using column 'Microbe_ID' as input for `col_mo`.
#> NOTE: Auto-guessing columns suitable for analysis (using only the first 10,000 rows)... OK.
#> 
#> Only results with 'R' are considered as resistance. Use `combine_SI = FALSE` to also consider 'I' as resistance.
#> 
#> Determining multidrug-resistant organisms (MDRO), according to:
#> Guideline: WIP-Richtlijn Bijzonder Resistente Micro-organismen (BRMO)
#> Author(s): RIVM (Rijksinstituut voor de Volksgezondheid)
#> Version:   Revision as of December 2017
#> Source:    https://www.rivm.nl/Documenten_en_publicaties/Professioneel_Praktisch/Richtlijnen/Infectieziekten/WIP_Richtlijnen/WIP_Richtlijnen/Ziekenhuizen/WIP_richtlijn_BRMO_Bijzonder_Resistente_Micro_Organismen_ZKH
#> 
#> => Found 1080 BRMOs out of 15872 isolates (6.8%)

verbose <- brmo(psae2, verbose = TRUE)
freq(verbose$reason)
#> Frequency table 
#> 
#> Class:      character
#> Length:     15,872
#> Available:  15,872 (100%, NA: 0 = 0%)
#> Unique:     2
#> 
#> Shortest:   25
#> Longest:    29
#> 
#>      Item                             Count   Percent   Cum. Count   Cum. Percent
#> ---  ------------------------------  ------  --------  -----------  -------------
#> 1    too few antibiotics are R        14792    93.20%        14792         93.20%
#> 2    not covered by BRMO guideline     1080     6.80%        15872        100.00%

Where it says 'too few antibiotics are R', this should of course not be the case. Also found the reason - the 'reason' field was not being set in P. aeruginosa in the Dutch guideline. It also applied to the German guideline.

This is now fixed (still have to upload the fix):

psae2 %>% 
  slice(1:15) %>% # only first 15 rows
  brmo(verbose = TRUE)
row_number Microbe_ID MDRO reason columns_nonsusceptible
1 B_PSDMN_AERG Negative too few antibiotics are R
2 B_PSDMN_AERG Negative too few antibiotics are R
3 B_PSDMN_AERG Negative too few antibiotics are R
4 B_PSDMN_AERG Negative too few antibiotics are R
5 B_PSDMN_AERG Negative too few antibiotics are R
6 B_PSDMN_AERG Negative too few antibiotics are R
7 B_PSDMN_AERG Positive at least 3 classes contain R CAZ, CIP, MEM, TZP
8 B_PSDMN_AERG Negative too few antibiotics are R
9 B_PSDMN_AERG Negative too few antibiotics are R
10 B_PSDMN_AERG Negative too few antibiotics are R
11 B_PSDMN_AERG Negative too few antibiotics are R
12 B_PSDMN_AERG Positive at least 3 classes contain R CAZ, CIP, MEM
13 B_PSDMN_AERG Positive at least 3 classes contain R CAZ, CIP, TZP
14 B_PSDMN_AERG Negative too few antibiotics are R
15 B_PSDMN_AERG Negative too few antibiotics are R
msberends commented 3 years ago

Many thanks for catching this bug!!

jukkiebah commented 3 years ago

Thanx! Is there a way to use customized MRDO settings? Ie our hospital has a classification which is different from the wip guideline.

Op vr 15 jan. 2021 om 21:28 schreef Matthijs Berends < notifications@github.com>

Many thanks for catching this bug!!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/msberends/AMR/issues/21#issuecomment-761181023, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKLHRBYJ6XPSAQM3OVPSXMDS2CQQRANCNFSM4WASENRA .

msberends commented 3 years ago

Sure, great idea. Let’s have the discussion in #23.