From 7e0e171512f88f278a00a23f64be7232e3f8e280 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Thu, 23 May 2019 19:39:07 +0200 Subject: [PATCH] website update --- R/ab.R | 3 -- R/freq.R | 18 ++++++------ R/mdro.R | 2 +- R/misc.R | 4 +-- docs/articles/MDR.html | 59 +++++++++++++++++++-------------------- docs/reference/as.ab.html | 11 ++++++-- man/as.ab.Rd | 3 -- 7 files changed, 49 insertions(+), 51 deletions(-) diff --git a/R/ab.R b/R/ab.R index f20b5a38..c90c206b 100755 --- a/R/ab.R +++ b/R/ab.R @@ -31,9 +31,6 @@ #' @details All entries in the \code{\link{antibiotics}} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. #' #' Use the \code{\link{ab_property}} functions to get properties based on the returned antibiotic ID, see Examples. -#' -#' In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups. -#' Source: \url{https://www.whocc.no/atc/structure_and_principles/} #' @section Source: #' World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/} #' diff --git a/R/freq.R b/R/freq.R index 776fe011..c5e5653e 100755 --- a/R/freq.R +++ b/R/freq.R @@ -639,13 +639,13 @@ format_header <- function(x, markdown = FALSE, decimal.mark = ".", big.mark = ", # class and mode if (is.null(header$columns)) { - if (markdown == TRUE) { - header$class <- paste0("`", header$class, "`") - } + # if (markdown == TRUE) { + # header$class <- paste0("`", header$class, "`") + # } if (!header$mode %in% header$class) { - if (markdown == TRUE) { - header$mode <- paste0("`", header$mode, "`") - } + # if (markdown == TRUE) { + # header$mode <- paste0("`", header$mode, "`") + # } header$class <- header$class %>% rev() %>% paste(collapse = " > ") %>% paste0(silver(paste0(" (", header$mode, ")"))) } else { header$class <- header$class %>% rev() %>% paste(collapse = " > ") @@ -654,9 +654,9 @@ format_header <- function(x, markdown = FALSE, decimal.mark = ".", big.mark = ", } # levels if (!is.null(header$levels)) { - if (markdown == TRUE) { - header$levels <- paste0("`", header$levels, "`") - } + # if (markdown == TRUE) { + # header$levels <- paste0("`", header$levels, "`") + # } if (header$ordered == TRUE) { levels_text <- paste0(header$levels, collapse = " < ") } else { diff --git a/R/mdro.R b/R/mdro.R index 6cd37db3..4f889f89 100755 --- a/R/mdro.R +++ b/R/mdro.R @@ -88,7 +88,7 @@ mdro <- function(x, if (is.null(col_mo) & guideline$code == "tb") { message(blue("NOTE: No column found as input for `col_mo`,", bold("assuming all records contain", - italic("Mycobacterium tuberculosis.")))) + italic("Mycobacterium tuberculosis.\n")))) x$mo <- AMR::as.mo("Mycobacterium tuberculosis") col_mo <- "mo" } diff --git a/R/misc.R b/R/misc.R index 0dab33fb..3cc651ce 100755 --- a/R/misc.R +++ b/R/misc.R @@ -219,7 +219,7 @@ get_column_abx <- function(x, if (!all(soft_dependencies %in% names(x))) { # missing a soft dependency may lower the reliability missing <- soft_dependencies[!soft_dependencies %in% names(x)] - missing <- paste0("`", missing, "` (", ab_name(missing, tolower = TRUE), ")") + missing <- paste0(missing, " (", ab_name(missing, tolower = TRUE), ")") warning('Reliability might be improved if these antimicrobial results would be available too: ', paste(missing, collapse = ", "), immediate. = TRUE, call. = FALSE) @@ -229,7 +229,7 @@ get_column_abx <- function(x, } generate_warning_abs_missing <- function(missing, any = FALSE) { - missing <- paste0("`", missing, "` (", ab_name(missing, tolower = TRUE), ")") + missing <- paste0(missing, " (", ab_name(missing, tolower = TRUE), ")") if (any == TRUE) { any_txt <- c(" any of", "is") } else { diff --git a/docs/articles/MDR.html b/docs/articles/MDR.html index 53017aa5..bbcbda36 100644 --- a/docs/articles/MDR.html +++ b/docs/articles/MDR.html @@ -242,18 +242,18 @@

The data set looks like this now:

head(my_TB_data)
 #   rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
-# 1          R         R            S          I            S            S
-# 2          S         R            I          R            S            R
-# 3          S         S            S          S            R            R
-# 4          R         S            R          S            S            S
-# 5          I         R            R          S            R            R
-# 6          S         S            S          S            S            S
+# 1          S         S            R          S            R            S
+# 2          R         R            S          S            R            S
+# 3          R         S            R          R            S            S
+# 4          S         I            R          S            R            R
+# 5          R         S            R          R            S            S
+# 6          I         I            S          S            R            S
 #   kanamycin
 # 1         S
 # 2         R
 # 3         S
 # 4         R
-# 5         R
+# 5         S
 # 6         R

We can now add the interpretation of MDR-TB to our data set:

my_TB_data$mdr <- mdr_tb(my_TB_data)
@@ -263,15 +263,14 @@
 # Version:   WHO/HTM/TB/2014.11
 # Author:    WHO (World Health Organization)
 # Source:    https://www.who.int/tb/publications/pmdt_companionhandbook/en/
-# Warning: Reliability might be improved if these antimicrobial results
-# would be available too: `CAP` (capreomycin), `RIB` (rifabutin), `RFP`
-# (rifapentine)
+# Warning: Reliability might be improved if these antimicrobial results would +# be available too: CAP (capreomycin), RIB (rifabutin), RFP (rifapentine)

And review the result with a frequency table:

freq(my_TB_data$mdr)

Frequency table of mdr from my_TB_data (5,000 x 8)

-

Class: factor > ordered (numeric)
+

Class: factor > ordered (numeric)
Length: 5,000 (of which NA: 0 = 0.00%)
-Levels: 5: Negative < Mono-resistance < Poly-resistance < Multidrug res...
+Levels: 5: Negative < Mono-resistance < Poly-resistance < Multidrug resistance…
Unique: 5

@@ -286,40 +285,40 @@ Unique: 5

- - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + diff --git a/docs/reference/as.ab.html b/docs/reference/as.ab.html index 4ef255d8..f9b5006c 100644 --- a/docs/reference/as.ab.html +++ b/docs/reference/as.ab.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9003 + 0.6.1.9037 @@ -116,6 +116,13 @@ Predict antimicrobial resistance +
  • + + + + Determine multi-drug resistance (MDR) + +
  • @@ -262,8 +269,6 @@

    All entries in the antibiotics data set have three different identifiers: a human readable EARS-Net code (column ab, used by ECDC and WHONET), an ATC code (column atc, used by WHO), and a CID code (column cid, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.

    Use the ab_property functions to get properties based on the returned antibiotic ID, see Examples.

    -

    In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups. - Source: https://www.whocc.no/atc/structure_and_principles/

    Source

    diff --git a/man/as.ab.Rd b/man/as.ab.Rd index 55760474..858c6232 100644 --- a/man/as.ab.Rd +++ b/man/as.ab.Rd @@ -22,9 +22,6 @@ Use this function to determine the antibiotic code of one or more antibiotics. T All entries in the \code{\link{antibiotics}} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. Use the \code{\link{ab_property}} functions to get properties based on the returned antibiotic ID, see Examples. - -In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups. - Source: \url{https://www.whocc.no/atc/structure_and_principles/} } \section{Source}{
  • 1 Mono-resistance3,28865.8%3,28865.8%3,24064.8%3,24064.8%
    2 Negative68613.7%3,97479.5%64112.8%3,88177.6%
    3 Multidrug resistance56011.2%4,53490.7%63812.8%4,51990.4%
    4 Poly-resistance2695.4%4,80396.1%2795.6%4,79896.0%
    5 Extensive drug resistance1973.9%2024.0% 5,000 100.0%