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

NA converted to first defined custom micro-organism #107

Closed
bennsal opened this issue May 7, 2023 · 5 comments
Closed

NA converted to first defined custom micro-organism #107

bennsal opened this issue May 7, 2023 · 5 comments
Labels
bug Something isn't working, labelled wrong or otherwise erroneous

Comments

@bennsal
Copy link

bennsal commented May 7, 2023

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
Copy link
Owner

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 msberends added the bug Something isn't working, labelled wrong or otherwise erroneous label May 8, 2023
@msberends
Copy link
Owner

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
Copy link
Author

bennsal commented May 8, 2023

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
Copy link
Owner

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
Copy link
Author

bennsal commented May 8, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, labelled wrong or otherwise erroneous
Projects
None yet
Development

No branches or pull requests

2 participants