mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 07:26:12 +01:00
(v0.8.0.9001) guideline text on as.rsi()
This commit is contained in:
parent
1b8e2366f7
commit
666126cd5e
@ -1,6 +1,6 @@
|
||||
Package: AMR
|
||||
Version: 0.8.0.9000
|
||||
Date: 2019-10-16
|
||||
Version: 0.8.0.9001
|
||||
Date: 2019-10-21
|
||||
Title: Antimicrobial Resistance Analysis
|
||||
Authors@R: c(
|
||||
person(role = c("aut", "cre"),
|
||||
|
5
NEWS.md
5
NEWS.md
@ -1,9 +1,10 @@
|
||||
# AMR 0.8.0.9000
|
||||
<small>Last updated: 16-Oct-2019</small>
|
||||
# AMR 0.8.0.9001
|
||||
<small>Last updated: 21-Oct-2019</small>
|
||||
|
||||
### New
|
||||
|
||||
### Changes
|
||||
* When running `as.rsi()` over a data set, it will now print the guideline that will be used
|
||||
|
||||
|
||||
# AMR 0.8.0
|
||||
|
25
R/rsi.R
25
R/rsi.R
@ -254,8 +254,28 @@ exec_as.rsi <- function(method, x, mo, ab, guideline) {
|
||||
class = c("rsi", "ordered", "factor"))
|
||||
}
|
||||
|
||||
get_guideline <- function(guideline) {
|
||||
guideline_param <- toupper(guideline)
|
||||
if (guideline_param %in% c("CLSI", "EUCAST")) {
|
||||
guideline_param <- AMR::rsi_translation %>%
|
||||
filter(guideline %like% guideline_param) %>%
|
||||
pull(guideline) %>%
|
||||
sort() %>%
|
||||
rev() %>%
|
||||
.[1]
|
||||
}
|
||||
|
||||
if (!guideline_param %in% AMR::rsi_translation$guideline) {
|
||||
stop(paste0("invalid guideline: '", guideline,
|
||||
"'.\nValid guidelines are: ", paste0("'", rev(sort(unique(AMR::rsi_translation$guideline))), "'", collapse = ", ")),
|
||||
call. = FALSE)
|
||||
}
|
||||
|
||||
guideline_param
|
||||
}
|
||||
|
||||
#' @rdname as.rsi
|
||||
#' @importFrom crayon red blue
|
||||
#' @importFrom crayon red blue bold
|
||||
#' @export
|
||||
as.rsi.data.frame <- function(x, col_mo = NULL, guideline = "EUCAST", ...) {
|
||||
x <- x
|
||||
@ -273,6 +293,9 @@ as.rsi.data.frame <- function(x, col_mo = NULL, guideline = "EUCAST", ...) {
|
||||
if (is.null(col_mo)) {
|
||||
stop("`col_mo` must be set.", call. = FALSE)
|
||||
}
|
||||
|
||||
guideline <- get_guideline(guideline)
|
||||
message(blue("Interpreting using guideline", bold(guideline)))
|
||||
|
||||
# transform all MICs
|
||||
ab_cols <- colnames(x)[sapply(x, is.mic)]
|
||||
|
@ -84,7 +84,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -192,6 +192,10 @@
|
||||
<a href="#amr-for-r" class="anchor"></a><code>AMR</code> (for R) <img src="./logo.png" align="right" height="120px">
|
||||
</h1></div>
|
||||
<p><em>(<help title="Too Long, Didn't Read">TLDR</help> - to find out how to conduct AMR analysis, please <a href="./articles/AMR.html">continue reading here to get started</a>.</em></p>
|
||||
<blockquote>
|
||||
<p><em>18 October 2019</em><br><strong>METHODS PAPER PREPRINTED</strong><br>
|
||||
A methods paper about this package has been preprinted at bioRxiv. Please see <a href="https://doi.org/10.1101/810622">here for the publishers page</a> or <a href="https://www.biorxiv.org/content/early/2019/10/18/810622.full.pdf">click here for the PDF</a>.</p>
|
||||
</blockquote>
|
||||
<hr>
|
||||
<div id="what-is-amr-for-r" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
|
@ -84,7 +84,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -231,11 +231,11 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div id="amr-0-8-0-9000" class="section level1">
|
||||
<div id="amr-0-8-0-9001" class="section level1">
|
||||
<h1 class="page-header">
|
||||
<a href="#amr-0-8-0-9000" class="anchor"></a>AMR 0.8.0.9000<small> Unreleased </small>
|
||||
<a href="#amr-0-8-0-9001" class="anchor"></a>AMR 0.8.0.9001<small> Unreleased </small>
|
||||
</h1>
|
||||
<p><small>Last updated: 16-Oct-2019</small></p>
|
||||
<p><small>Last updated: 21-Oct-2019</small></p>
|
||||
<div id="new" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#new" class="anchor"></a>New</h3>
|
||||
@ -243,6 +243,9 @@
|
||||
<div id="changes" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#changes" class="anchor"></a>Changes</h3>
|
||||
<ul>
|
||||
<li>When running <code><a href="../reference/as.rsi.html">as.rsi()</a></code> over a data set, it will now print the guideline that will be used</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="amr-0-8-0" class="section level1">
|
||||
@ -1305,7 +1308,7 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
|
||||
<div id="tocnav">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#amr-0-8-0-9000">0.8.0.9000</a></li>
|
||||
<li><a href="#amr-0-8-0-9001">0.8.0.9001</a></li>
|
||||
<li><a href="#amr-0-8-0">0.8.0</a></li>
|
||||
<li><a href="#amr-0-7-1">0.7.1</a></li>
|
||||
<li><a href="#amr-0-7-0">0.7.0</a></li>
|
||||
|
@ -84,7 +84,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
4
index.md
4
index.md
@ -2,6 +2,10 @@
|
||||
|
||||
*(<help title="Too Long, Didn't Read">TLDR</help> - to find out how to conduct AMR analysis, please [continue reading here to get started](./articles/AMR.html).*
|
||||
|
||||
> *18 October 2019*
|
||||
> **METHODS PAPER PREPRINTED**
|
||||
> A methods paper about this package has been preprinted at bioRxiv. Please see [here for the publishers page](https://doi.org/10.1101/810622) or [click here for the PDF](https://www.biorxiv.org/content/early/2019/10/18/810622.full.pdf).
|
||||
|
||||
----
|
||||
|
||||
### What is `AMR` (for R)?
|
||||
|
Loading…
Reference in New Issue
Block a user