Comments (10)
Definitely something to improve! I was just working on it the other week. Which version of the package did you use?
from amr.
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.
I updated to v2.1.1 today so it should be latest release!
from amr.
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.
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.
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.
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.
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.
It does, but it seems to default to the soft tissue breakpoints, rendering urine cultures resistant.
from amr.
Closing as part of wider issue in #142
from amr.
Related Issues (20)
- AMR HOT 3
- Group isolates HOT 7
- Not all mo_transforms work with antibiogram HOT 1
- Check groups for antibiotics: aminoglycosides all right? HOT 1
- as.sir reports invalid results as coming from wrong columns HOT 2
- extra factor level in class SIR (as.sir/is.sir) HOT 5
- `as.mo()`: give preference to species if subspecies is non-existent
- Add denominators to each antibiotic in antibiogram HOT 5
- Acknowledge data availability when using `first_isolate(method = "phenotype)`
- Error when antibiogram empty HOT 4
- Teleomorph vs anamorph ID of yeasts HOT 3
- scale_y_percent HOT 1
- AMR 3.0: let reverse dependencies know HOT 1
- scale_x_mic not working HOT 2
- suppress information 'warning' with as.mo mo_gramstain etc HOT 2
- Turn off information as.mo mo_gramstain etc HOT 3
- uti is false bug? HOT 4
- Some organisms not in database HOT 2
- Extrapolating breakpoints for animals in line with CLSI VET09 document HOT 5
- as.sir() hangs in latest beta if unknown column present HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amr.