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
83 stars 12 forks source link

NA converted to first defined custom micro-organism #107

Closed bennsal closed 1 year ago

bennsal commented 1 year ago

When a data frame has an NA in the list of isolate names and you define a custom microorganism, then run as.mo, the NA is replaced with the name of the custom microorganism

 library(AMR)
Isolates <- c("Salmonella typhi", NA ,"Escherichia coli","Taleromyces marneffei")
Numbers <- c(1,2,3,4)
names <- data.frame(Isolates,Numbers)
as.mo(names$Isolates)
add_custom_microorganisms(
  data.frame(
    genus = "Talaromyces",
    species = "marneffei")) 
as.mo(names$Isolates)
msberends commented 1 year ago

Thanks for using our package!

True, that's a bug! Seems easy to fix, I'll look into it.

Many thanks for catching it.

msberends commented 1 year ago

I want to point out though, in your Isolates <- ... line you have Taleromyces with an 'E', while in the add_custom_microorganisms() call you have Talaromyces with an 'A' 🙂

Should not be much of a problem since the matching score will be high enough to end up with Talaromyces marneffei (which is the correct name).

bennsal commented 1 year ago

My incoming files have a lot of odd spellings in them, though this was my typo! AMRforR does a great job of regularising them - thank you!

msberends commented 1 year ago

The problem was (strangely enough) an internal issue with SNOMED codes when using NA as input and using custom microorganism codes. Anyway, fixed now!

You're welcome to test the latest beta:

remotes::install_github("msberends/AMR")
bennsal commented 1 year ago

Thanks for the super quick fix!

On Mon, 8 May 2023, at 12:07 PM, Dr. Matthijs Berends wrote:

The problem was (strangely enough) an internal issue with SNOMED codes when using NA as input and using custom microorganism codes. Anyway, fixed now!

You're welcome to test the latest beta:

remotes::install_github("msberends/AMR")

— Reply to this email directly, view it on GitHub https://github.com/msberends/AMR/issues/107#issuecomment-1538183983, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACIUJWYWVU2V7YW7545L6GTXFDHWHANCNFSM6AAAAAAXY6PS74. You are receiving this because you authored the thread.Message ID: @.***>