GithubHelp home page GithubHelp logo

Comments (10)

msberends avatar msberends commented on September 27, 2024 1

Definitely something to improve! I was just working on it the other week. Which version of the package did you use?

from amr.

samueljpearce avatar samueljpearce commented on September 27, 2024

I think my issue was using as.sir within mutate_if. However, using it outside of a mutate function results in a different problem where as.sir tries to interpret non-mic columns. For example, running as.sir(guideline = "CLSI", breakpoint_type = "animal", host = "host", uti = "urine"), on a dataframe consisting of "mo", "host", "urine" and a series of antimicrobial MIC columns gives this error: Warning: in as.sir(): 171 results in column 'mo' truncated (100%) that were invalid antimicrobial interpretations: "Dog" OK.

from amr.

samueljpearce avatar samueljpearce commented on September 27, 2024

I updated to v2.1.1 today so it should be latest release!

from amr.

msberends avatar msberends commented on September 27, 2024

It is, but you might be interested in our latest beta version that is all about veterinary medicine :)

Please read this: https://msberends.github.io/AMR/news/index.html

You can now set animal species! Supports 20 languages.

Iā€™m curious if this solves your problem with uti as well.

You can try the latest version using:

install.packages("AMR", repos = "https://msberends.r-universe.dev/")

Would be awesome if you could let me know if this revamped approach works for you!

from amr.

samueljpearce avatar samueljpearce commented on September 27, 2024

Oh I missed that v2.1.1.9015 wasn't on CRAN yet. Thanks for letting me know - I will try it out!

from amr.

samueljpearce avatar samueljpearce commented on September 27, 2024

Iā€™m curious if this solves your problem with uti as well.

Yes and no. As I thought, the mutate_if(x, is.mic, as.sir) method doesn't seem to work (the same happens with the new "host" column). I'm no expert with R but I would think this is because it is mutating at the specified point (i.e. columns that match is.mic) and therefore the function does not have the scope to access the specimen and host columns. Does it work for you?

When using as.sir(data, ...) it does still seem to try and interpret other columns, but at least it doesn't seem to affect the output as far as I can tell.

from amr.

samueljpearce avatar samueljpearce commented on September 27, 2024

The more I use this argument, the harder I find it is to get consistent behaviour from it but I think I may have found the problem. I've created a minimal example dataset attached.

minimal_reproducible_example.csv

With this minimal example, if you run as.sir(data, guideline = "CLSI", breakpoint_type = "animal", uti = "uti", host = "host") on the whole dataset, it incorrectly identifies many E. coli isolates as resistant to AMP. However, if you run only say, the first 30 samples, it correctly identifies them as sensitive or resistant.

It seems to be that the breakpoints do not get applied correctly to each host if there are multiple. For example, using this dataset, the above as.sir function will correctly identify dog urine isolates as S or R. Once you include isolate 33 which is a cat, they all seem to become resistant.

The canine and feline breakpoints should be the same for AMP and E. coli, so I did some digging into the clinical_breakpoints dataset and it does not actually have the feline uncomplicated UTI breakpoint for AMP, even though it is in the CLSI VET01 2023 guidelines.

Therefore, I think it is blanket applying the soft tissue breakpoint for cats, to both the cat and dog isolates, rendering them all resistant.

from amr.

msberends avatar msberends commented on September 27, 2024

Wow, thanks so much for your time!

Consistent behaviour is the most important thing, so some bits must be changed in the functions, no doubt about that.

The canine and feline breakpoints should be the same for AMP and E. coli, so I did some digging into the clinical_breakpoints dataset and it does not actually have the feline uncomplicated UTI breakpoint for AMP, even though it is in the CLSI VET01 2023 guidelines.

This is also a very important thing, I need to check why this is the case. Are you not getting notes that dogs breakpoints are being used?

from amr.

samueljpearce avatar samueljpearce commented on September 27, 2024

It does, but it seems to default to the soft tissue breakpoints, rendering urine cultures resistant.

from amr.

samueljpearce avatar samueljpearce commented on September 27, 2024

Closing as part of wider issue in #142

from amr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.