1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-26 07:26:13 +01:00

add MIC values

add badges to readme
This commit is contained in:
dr. M.S. (Matthijs) Berends 2018-03-13 11:57:30 +01:00
parent 4ea0333349
commit e4b371d30a
No known key found for this signature in database
GPG Key ID: AE86720DBCDA4567
5 changed files with 15 additions and 10 deletions

2
NEWS
View File

@ -1,6 +1,8 @@
## 0.1.1 ## 0.1.1
- `EUCAST_rules` applies for amoxicillin even if ampicillin is missing - `EUCAST_rules` applies for amoxicillin even if ampicillin is missing
- Edited column names to comply with GLIMS, the laboratory information system - Edited column names to comply with GLIMS, the laboratory information system
- Added more valid MIC values
- Renamed 'Daily Defined Dose' to 'Defined Daily Dose'
## 0.1.0 ## 0.1.0
- First submission to CRAN. - First submission to CRAN.

View File

@ -158,7 +158,7 @@ plot.rsi <- function(x, ...) {
#' Class 'mic' #' Class 'mic'
#' #'
#' This transforms a vector to a new class\code{mic}, which is an ordered factor valid MIC values as levels. Invalid MIC values will be translated as \code{NA} with a warning. #' This transforms a vector to a new class\code{mic}, which is an ordered factor with valid MIC values as levels. Invalid MIC values will be translated as \code{NA} with a warning.
#' @rdname as.mic #' @rdname as.mic
#' @param x vector #' @param x vector
#' @param na.rm a logical indicating whether missing values should be removed #' @param na.rm a logical indicating whether missing values should be removed
@ -207,24 +207,29 @@ as.mic <- function(x, na.rm = FALSE) {
"<0.012", "<=0.012", "0.012", ">=0.012", ">0.012", "<0.012", "<=0.012", "0.012", ">=0.012", ">0.012",
"<0.016", "<=0.016", "0.016", ">=0.016", ">0.016", "<0.016", "<=0.016", "0.016", ">=0.016", ">0.016",
"<0.023", "<=0.023", "0.023", ">=0.023", ">0.023", "<0.023", "<=0.023", "0.023", ">=0.023", ">0.023",
"<0.025", "<=0.025", "0.025", ">=0.025", ">0.025",
"<0.03", "<=0.03", "0.03", ">=0.03", ">0.03", "<0.03", "<=0.03", "0.03", ">=0.03", ">0.03",
"<0.032", "<=0.032", "0.032", ">=0.032", ">0.032", "<0.032", "<=0.032", "0.032", ">=0.032", ">0.032",
"<0.047", "<=0.047", "0.047", ">=0.047", ">0.047", "<0.047", "<=0.047", "0.047", ">=0.047", ">0.047",
"<0.05", "<=0.05", "0.05", ">=0.05", ">0.05", "<0.05", "<=0.05", "0.05", ">=0.05", ">0.05",
"<0.06", "<=0.06", "0.06", ">=0.06", ">0.06", "<0.06", "<=0.06", "0.06", ">=0.06", ">0.06",
"<0.0625", "<=0.0625", "0.0625", ">=0.0625", ">0.0625", "<0.0625", "<=0.0625", "0.0625", ">=0.0625", ">0.0625",
"<0.063", "<=0.063", "0.063", ">=0.063", ">0.063",
"<0.064", "<=0.064", "0.064", ">=0.064", ">0.064", "<0.064", "<=0.064", "0.064", ">=0.064", ">0.064",
"<0.09", "<=0.09", "0.09", ">=0.09", ">0.09", "<0.09", "<=0.09", "0.09", ">=0.09", ">0.09",
"<0.094", "<=0.094", "0.094", ">=0.094", ">0.094", "<0.094", "<=0.094", "0.094", ">=0.094", ">0.094",
"<0.12", "<=0.12", "0.12", ">=0.12", ">0.12", "<0.12", "<=0.12", "0.12", ">=0.12", ">0.12",
"<0.125", "<=0.125", "0.125", ">=0.125", ">0.125", "<0.125", "<=0.125", "0.125", ">=0.125", ">0.125",
"<0.128", "<=0.128", "0.128", ">=0.128", ">0.128", "<0.128", "<=0.128", "0.128", ">=0.128", ">0.128",
"<0.16", "<=0.16", "0.16", ">=0.16", ">0.16",
"<0.19", "<=0.19", "0.19", ">=0.19", ">0.19", "<0.19", "<=0.19", "0.19", ">=0.19", ">0.19",
"<0.25", "<=0.25", "0.25", ">=0.25", ">0.25", "<0.25", "<=0.25", "0.25", ">=0.25", ">0.25",
"<0.256", "<=0.256", "0.256", ">=0.256", ">0.256", "<0.256", "<=0.256", "0.256", ">=0.256", ">0.256",
"<0.32", "<=0.32", "0.32", ">=0.32", ">0.32",
"<0.38", "<=0.38", "0.38", ">=0.38", ">0.38", "<0.38", "<=0.38", "0.38", ">=0.38", ">0.38",
"<0.5", "<=0.5", "0.5", ">=0.5", ">0.5", "<0.5", "<=0.5", "0.5", ">=0.5", ">0.5",
"<0.512", "<=0.512", "0.512", ">=0.512", ">0.512", "<0.512", "<=0.512", "0.512", ">=0.512", ">0.512",
"<0.64", "<=0.64", "0.64", ">=0.64", ">0.64",
"<0.75", "<=0.75", "0.75", ">=0.75", ">0.75", "<0.75", "<=0.75", "0.75", ">=0.75", ">0.75",
"<1", "<=1", "1", ">=1", ">1", "<1", "<=1", "1", ">=1", ">1",
"<1.5", "<=1.5", "1.5", ">=1.5", ">1.5", "<1.5", "<=1.5", "1.5", ">=1.5", ">1.5",
@ -284,26 +289,23 @@ is.mic <- function(x) {
#' @exportMethod as.double.mic #' @exportMethod as.double.mic
#' @export #' @export
#' @importFrom dplyr %>%
#' @noRd #' @noRd
as.double.mic <- function(x, ...) { as.double.mic <- function(x, ...) {
as.double(gsub('(<=)|(>=)', '', as.character(x))) as.double(gsub('(<|=|>)+', '', as.character(x)))
} }
#' @exportMethod as.integer.mic #' @exportMethod as.integer.mic
#' @export #' @export
#' @importFrom dplyr %>%
#' @noRd #' @noRd
as.integer.mic <- function(x, ...) { as.integer.mic <- function(x, ...) {
as.integer(gsub('(<=)|(>=)', '', as.character(x))) as.integer(gsub('(<|=|>)+', '', as.character(x)))
} }
#' @exportMethod as.numeric.mic #' @exportMethod as.numeric.mic
#' @export #' @export
#' @importFrom dplyr %>%
#' @noRd #' @noRd
as.numeric.mic <- function(x, ...) { as.numeric.mic <- function(x, ...) {
as.numeric(gsub('(<=)|(>=)', '', as.character(x))) as.numeric(gsub('(<|=|>)+', '', as.character(x)))
} }
#' @exportMethod print.mic #' @exportMethod print.mic

View File

@ -37,8 +37,8 @@
#' @param info print progress #' @param info print progress
#' @details \strong{Why this is so important} \cr #' @details \strong{Why this is so important} \cr
#' To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode \href{https://www.ncbi.nlm.nih.gov/pubmed/17304462}{[1]}. If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all \emph{S. aureus} isolates would be overestimated, because you included this MRSA more than once. It would be \href{https://en.wikipedia.org/wiki/Selection_bias}{selection bias}. #' To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode \href{https://www.ncbi.nlm.nih.gov/pubmed/17304462}{[1]}. If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all \emph{S. aureus} isolates would be overestimated, because you included this MRSA more than once. It would be \href{https://en.wikipedia.org/wiki/Selection_bias}{selection bias}.
#'
#' \strong{\code{points_threshold}} \cr #' \strong{Using parameter \code{points_threshold}} \cr
#' To compare key antibiotics, the difference between antimicrobial interpretations will be measured. A difference from I to S|R (or vice versa) means 0.5 points. A difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, an isolate will be (re)selected as a first weighted isolate. #' To compare key antibiotics, the difference between antimicrobial interpretations will be measured. A difference from I to S|R (or vice versa) means 0.5 points. A difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, an isolate will be (re)selected as a first weighted isolate.
#' @keywords isolate isolates first #' @keywords isolate isolates first
#' @export #' @export

View File

@ -13,7 +13,7 @@ AMR can also be predicted for the forthcoming years with the `rsi_predict` funct
It also contains functions to translate antibiotic codes from the lab (like `"AMOX"`) or the [WHO](https://www.whocc.no/atc_ddd_index/?code=J01CA04&showdescription=no) (like `"J01CA04"`) to trivial names (like `"amoxicillin"`) and vice versa. It also contains functions to translate antibiotic codes from the lab (like `"AMOX"`) or the [WHO](https://www.whocc.no/atc_ddd_index/?code=J01CA04&showdescription=no) (like `"J01CA04"`) to trivial names (like `"amoxicillin"`) and vice versa.
## How to get it? ## How to get it?
[![CRAN_Badge](http://www.r-pkg.org/badges/version/AMR)](http://cran.r-project.org/package=AMR) [![CRAN_Badge](http://www.r-pkg.org/badges/version/AMR)](http://cran.r-project.org/package=AMR)[![CRAN_Downloads](https://cranlogs.r-pkg.org/badges/grand-total/AMR)](http://cran.r-project.org/package=AMR)[![Travis_Build](https://travis-ci.org/msberends/AMR.svg?branch=master)](https://travis-ci.org/msberends/AMR)
This package is available on CRAN (latest stable version) and also here on GitHub (latest development version). This package is available on CRAN (latest stable version) and also here on GitHub (latest development version).

View File

@ -52,6 +52,7 @@ Determine first (weighted) isolates of all microorganisms of every patient per e
\details{ \details{
\strong{Why this is so important} \cr \strong{Why this is so important} \cr
To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode \href{https://www.ncbi.nlm.nih.gov/pubmed/17304462}{[1]}. If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all \emph{S. aureus} isolates would be overestimated, because you included this MRSA more than once. It would be \href{https://en.wikipedia.org/wiki/Selection_bias}{selection bias}. To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode \href{https://www.ncbi.nlm.nih.gov/pubmed/17304462}{[1]}. If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all \emph{S. aureus} isolates would be overestimated, because you included this MRSA more than once. It would be \href{https://en.wikipedia.org/wiki/Selection_bias}{selection bias}.
\strong{\code{points_threshold}} \cr \strong{\code{points_threshold}} \cr
To compare key antibiotics, the difference between antimicrobial interpretations will be measured. A difference from I to S|R (or vice versa) means 0.5 points. A difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, an isolate will be (re)selected as a first weighted isolate. To compare key antibiotics, the difference between antimicrobial interpretations will be measured. A difference from I to S|R (or vice versa) means 0.5 points. A difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, an isolate will be (re)selected as a first weighted isolate.
} }