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

website update

This commit is contained in:
dr. M.S. (Matthijs) Berends 2019-01-12 19:31:30 +01:00
parent 3661df7365
commit cda7087722
8 changed files with 57 additions and 39 deletions

View File

@ -21,7 +21,7 @@
#' Guess antibiotic column
#'
#' This tries to find a column name in a data set based on information from the \code{\link{antibiotics}} data set. You can look for an antibiotic (trade) of abbreviation and it will search the data for any column containing a name or ATC code of that antibiotic.
#' This tries to find a column name in a data set based on information from the \code{\link{antibiotics}} data set. You can look for an antibiotic (trade) name or abbreviation and it will search the \code{data.frame} for any column containing a name or ATC code of that antibiotic.
#' @param tbl a \code{data.frame}
#' @param col a character to look for
#' @param verbose a logical to indicate whether additional info should be printed

View File

@ -25,23 +25,23 @@
#' @inheritParams first_isolate
#' @param col_ab column name of \code{tbl} with antimicrobial interpretations (\code{R}, \code{I} and \code{S})
#' @param col_date column name of the date, will be used to calculate years if this column doesn't consist of years already
#' @param year_min lowest year to use in the prediction model, dafaults the lowest year in \code{col_date}
#' @param year_max highest year to use in the prediction model, defaults to 15 years after today
#' @param year_min lowest year to use in the prediction model, dafaults to the lowest year in \code{col_date}
#' @param year_max highest year to use in the prediction model, defaults to 10 years after today
#' @param year_every unit of sequence between lowest year found in the data and \code{year_max}
#' @param minimum minimal amount of available isolates per year to include. Years containing less observations will be estimated by the model.
#' @param model the statistical model of choice. Valid values are \code{"binomial"} (or \code{"binom"} or \code{"logit"}) or \code{"loglin"} or \code{"linear"} (or \code{"lin"}).
#' @param I_as_R treat \code{I} as \code{R}
#' @param preserve_measurements logical to indicate whether predictions of years that are actually available in the data should be overwritten with the original data. The standard errors of those years will be \code{NA}.
#' @param info print textual analysis with the name and \code{\link{summary}} of the model.
#' @param I_as_R a logical to indicate whether values \code{I} should be treated as \code{R}
#' @param preserve_measurements a logical to indicate whether predictions of years that are actually available in the data should be overwritten by the original data. The standard errors of those years will be \code{NA}.
#' @param info a logical to indicate whether textual analysis should be printed with the name and \code{\link{summary}} of the statistical model.
#' @return \code{data.frame} with columns:
#' \itemize{
#' \item{\code{year}}
#' \item{\code{value}, the same as \code{estimated} when \code{preserve_measurements = FALSE}, and a combination of \code{observed} and \code{estimated} otherwise}
#' \item{\code{se_min}, the lower bound of the standard error with a minimum of \code{0}}
#' \item{\code{se_max} the upper bound of the standard error with a maximum of \code{1}}
#' \item{\code{observations}, the total number of observations, i.e. S + I + R}
#' \item{\code{observed}, the original observed values}
#' \item{\code{estimated}, the estimated values, calculated by the model}
#' \item{\code{se_min}, the lower bound of the standard error with a minimum of \code{0} (so the standard error will never go below 0\%)}
#' \item{\code{se_max} the upper bound of the standard error with a maximum of \code{1} (so the standard error will never go above 100\%)}
#' \item{\code{observations}, the total number of available observations in that year, i.e. S + I + R}
#' \item{\code{observed}, the original observed resistant percentages}
#' \item{\code{estimated}, the estimated resistant percentages, calculated by the model}
#' }
#' @seealso The \code{\link{portion}} function to calculate resistance, \cr \code{\link{lm}} \code{\link{glm}}
#' @rdname resistance_predict
@ -182,7 +182,7 @@ resistance_predict <- function(tbl,
year_min <- max(year_min, year_lowest, na.rm = TRUE)
}
if (is.null(year_max)) {
year_max <- year(Sys.Date()) + 15
year_max <- year(Sys.Date()) + 10
}
years_predict <- seq(from = year_min, to = year_max, by = year_every)

View File

@ -232,16 +232,23 @@
<div id="short-introduction" class="section level3">
<h3 class="hasAnchor">
<a href="#short-introduction" class="anchor"></a>Short introduction</h3>
<div id="taxonomic-reference-data" class="section level4">
<h4 class="hasAnchor">
<a href="#taxonomic-reference-data" class="anchor"></a>Taxonomic reference data</h4>
<p><img src="reference/figures/itis_logo.jpg" height="60px"></p>
<p>This package contains the <strong>complete microbial taxonomic data</strong> (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, <a href="https://www.itis.gov" class="uri">https://www.itis.gov</a>).</p>
<p>All ~20,000 (sub)species from <strong>the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package</strong>, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.</p>
<p>Read more about ITIS <a href="./reference/ITIS.html">in our manual</a>.</p>
</div>
<div id="overview-of-functions" class="section level4">
<h4 class="hasAnchor">
<a href="#overview-of-functions" class="anchor"></a>Overview of functions</h4>
<p>The <code>AMR</code> package basically does four important things:</p>
<ol>
<li>It <strong>cleanses existing data</strong>, by transforming it to reproducible and profound <em>classes</em>, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect:</li>
</ol>
<ul>
<li>Use <code><a href="reference/as.mo.html">as.mo()</a></code> to get an ID of a microorganism. The IDs are human readable for the trained eye - the ID of <em>Klebsiella pneumoniae</em> is “B_KLBSL_PNE” (B stands for Bacteria) and the ID of <em>S. aureus</em> is “B_STPHY_AUR”. The function takes almost any text as input that looks like the name or code of a microorganism like “E. coli”, “esco” and “esccol”. Even <code><a href="reference/as.mo.html">as.mo("MRSA")</a></code> will return the ID of <em>S. aureus</em>. Moreover, it can group all coagulase negative and positive <em>Staphylococci</em>, and can transform <em>Streptococci</em> into Lancefield groups. To find bacteria based on your input, it uses Artificial Intelligence to look up values in the included ITIS data, consisting of more than 18,000 microorganisms.</li>
<li>Use <code><a href="reference/as.mo.html">as.mo()</a></code> to get an ID of a microorganism. The IDs are human readable for the trained eye - the ID of <em>Klebsiella pneumoniae</em> is “B_KLBSL_PNE” (B stands for Bacteria) and the ID of <em>S. aureus</em> is “B_STPHY_AUR”. The function takes almost any text as input that looks like the name or code of a microorganism like “E. coli”, “esco” or “esccol” and tries to find expected results using artificial intelligence (AI) on the included ITIS data set, consisting of almost 20,000 microorganisms. It is <em>very</em> fast, please see our <a href="./articles/benchmarks.html">benchmarks</a>. Moreover, it can group <em>Staphylococci</em> into coagulase negative and positive (CoNS and CoPS, see <a href="./reference/as.mo.html#source">source</a>) and can categorise <em>Streptococci</em> into Lancefield groups (like beta-haemolytic <em>Streptococcus</em> Group B, <a href="./reference/as.mo.html#source">source</a>).</li>
<li>Use <code><a href="reference/as.rsi.html">as.rsi()</a></code> to transform values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like “&lt;=0.002; S” (combined MIC/RSI) will result in “S”.</li>
<li>Use <code><a href="reference/as.mic.html">as.mic()</a></code> to cleanse your MIC values. It produces a so-called factor (called <em>ordinal</em> in SPSS) with valid MIC values as levels. A value like “&lt;=0.002; S” (combined MIC/RSI) will result in “&lt;=0.002”.</li>
<li>Use <code><a href="reference/as.atc.html">as.atc()</a></code> to get the ATC code of an antibiotic as defined by the WHO. This package contains a database with most LIS codes, official names, DDDs and even trade names of antibiotics. For example, the values “Furabid”, “Furadantin”, “nitro” all return the ATC code of Nitrofurantoine.</li>
@ -283,9 +290,14 @@
</ul>
</li>
</ul>
<hr>
</div>
<div id="partners" class="section level4">
<h4 class="hasAnchor">
<a href="#partners" class="anchor"></a>Partners</h4>
<p>The development of this package is part of, related to, or made possible by:</p>
<p><a href="https://www.rug.nl"><img src="./logo_rug.png" height="60px"></a> <a href="https://www.umcg.nl"><img src="./logo_umcg.png" height="60px"></a> <a href="https://www.certe.nl"><img src="./logo_certe.png" height="60px"></a> <a href="http://www.eurhealth-1health.eu"><img src="./logo_eh1h.png" height="60px"></a> <a href="http://www.eurhealth-1health.eu"><img src="./logo_interreg.png" height="60px"></a></p>
</div>
</div>
</div>
</div>

View File

@ -47,7 +47,7 @@
<script src="../extra.js"></script>
<meta property="og:title" content="Guess antibiotic column — guess_ab_col" />
<meta property="og:description" content="This tries to find a column name in a data set based on information from the antibiotics data set. You can look for an antibiotic (trade) of abbreviation and it will search the data for any column containing a name or ATC code of that antibiotic." />
<meta property="og:description" content="This tries to find a column name in a data set based on information from the antibiotics data set. You can look for an antibiotic (trade) name or abbreviation and it will search the data.frame for any column containing a name or ATC code of that antibiotic." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" />
@ -223,7 +223,7 @@
<div class="ref-description">
<p>This tries to find a column name in a data set based on information from the <code><a href='antibiotics.html'>antibiotics</a></code> data set. You can look for an antibiotic (trade) of abbreviation and it will search the data for any column containing a name or ATC code of that antibiotic.</p>
<p>This tries to find a column name in a data set based on information from the <code><a href='antibiotics.html'>antibiotics</a></code> data set. You can look for an antibiotic (trade) name or abbreviation and it will search the <code>data.frame</code> for any column containing a name or ATC code of that antibiotic.</p>
</div>

View File

@ -253,11 +253,11 @@
</tr>
<tr>
<th>year_min</th>
<td><p>lowest year to use in the prediction model, dafaults the lowest year in <code>col_date</code></p></td>
<td><p>lowest year to use in the prediction model, dafaults to the lowest year in <code>col_date</code></p></td>
</tr>
<tr>
<th>year_max</th>
<td><p>highest year to use in the prediction model, defaults to 15 years after today</p></td>
<td><p>highest year to use in the prediction model, defaults to 10 years after today</p></td>
</tr>
<tr>
<th>year_every</th>
@ -273,15 +273,15 @@
</tr>
<tr>
<th>I_as_R</th>
<td><p>treat <code>I</code> as <code>R</code></p></td>
<td><p>a logical to indicate whether values <code>I</code> should be treated as <code>R</code></p></td>
</tr>
<tr>
<th>preserve_measurements</th>
<td><p>logical to indicate whether predictions of years that are actually available in the data should be overwritten with the original data. The standard errors of those years will be <code>NA</code>.</p></td>
<td><p>a logical to indicate whether predictions of years that are actually available in the data should be overwritten by the original data. The standard errors of those years will be <code>NA</code>.</p></td>
</tr>
<tr>
<th>info</th>
<td><p>print textual analysis with the name and <code><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></code> of the model.</p></td>
<td><p>a logical to indicate whether textual analysis should be printed with the name and <code><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></code> of the statistical model.</p></td>
</tr>
</table>
@ -290,11 +290,11 @@
<p><code>data.frame</code> with columns:</p><ul>
<li><p><code>year</code></p></li>
<li><p><code>value</code>, the same as <code>estimated</code> when <code>preserve_measurements = FALSE</code>, and a combination of <code>observed</code> and <code>estimated</code> otherwise</p></li>
<li><p><code>se_min</code>, the lower bound of the standard error with a minimum of <code>0</code></p></li>
<li><p><code>se_max</code> the upper bound of the standard error with a maximum of <code>1</code></p></li>
<li><p><code>observations</code>, the total number of observations, i.e. S + I + R</p></li>
<li><p><code>observed</code>, the original observed values</p></li>
<li><p><code>estimated</code>, the estimated values, calculated by the model</p></li>
<li><p><code>se_min</code>, the lower bound of the standard error with a minimum of <code>0</code> (so the standard error will never go below 0%)</p></li>
<li><p><code>se_max</code> the upper bound of the standard error with a maximum of <code>1</code> (so the standard error will never go above 100%)</p></li>
<li><p><code>observations</code>, the total number of available observations in that year, i.e. S + I + R</p></li>
<li><p><code>observed</code>, the original observed resistant percentages</p></li>
<li><p><code>estimated</code>, the estimated resistant percentages, calculated by the model</p></li>
</ul>

View File

@ -59,6 +59,8 @@ To find out how to conduct AMR analysis, please [continue reading here to get st
### Short introduction
#### Taxonomic reference data
<img src="man/figures/itis_logo.jpg" height="60px">
This package contains the **complete microbial taxonomic data** (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, https://www.itis.gov).
@ -67,11 +69,13 @@ All ~20,000 (sub)species from **the taxonomic kingdoms Bacteria, Fungi and Proto
Read more about ITIS [in our manual](./reference/ITIS.html).
#### Overview of functions
The `AMR` package basically does four important things:
1. It **cleanses existing data**, by transforming it to reproducible and profound *classes*, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect:
* Use `as.mo()` to get an ID of a microorganism. The IDs are human readable for the trained eye - the ID of *Klebsiella pneumoniae* is "B_KLBSL_PNE" (B stands for Bacteria) and the ID of *S. aureus* is "B_STPHY_AUR". The function takes almost any text as input that looks like the name or code of a microorganism like "E. coli", "esco" and "esccol". Even `as.mo("MRSA")` will return the ID of *S. aureus*. Moreover, it can group all coagulase negative and positive *Staphylococci*, and can transform *Streptococci* into Lancefield groups. To find bacteria based on your input, it uses Artificial Intelligence to look up values in the included ITIS data, consisting of more than 18,000 microorganisms.
* Use `as.mo()` to get an ID of a microorganism. The IDs are human readable for the trained eye - the ID of *Klebsiella pneumoniae* is "B_KLBSL_PNE" (B stands for Bacteria) and the ID of *S. aureus* is "B_STPHY_AUR". The function takes almost any text as input that looks like the name or code of a microorganism like "E. coli", "esco" or "esccol" and tries to find expected results using artificial intelligence (AI) on the included ITIS data set, consisting of almost 20,000 microorganisms. It is *very* fast, please see our [benchmarks](./articles/benchmarks.html). Moreover, it can group *Staphylococci* into coagulase negative and positive (CoNS and CoPS, see [source](./reference/as.mo.html#source)) and can categorise *Streptococci* into Lancefield groups (like beta-haemolytic *Streptococcus* Group B, [source](./reference/as.mo.html#source)).
* Use `as.rsi()` to transform values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like "<=0.002; S" (combined MIC/RSI) will result in "S".
* Use `as.mic()` to cleanse your MIC values. It produces a so-called factor (called *ordinal* in SPSS) with valid MIC values as levels. A value like "<=0.002; S" (combined MIC/RSI) will result in "<=0.002".
* Use `as.atc()` to get the ATC code of an antibiotic as defined by the WHO. This package contains a database with most LIS codes, official names, DDDs and even trade names of antibiotics. For example, the values "Furabid", "Furadantin", "nitro" all return the ATC code of Nitrofurantoine.
@ -100,7 +104,9 @@ The `AMR` package basically does four important things:
* Results of 40 antibiotics (each antibiotic in its own column) with a total of 38,414 antimicrobial results
* Real and genuine data
----
#### Partners
The development of this package is part of, related to, or made possible by:
<a href="https://www.rug.nl"><img src="./logo_rug.png" height="60px"></a>
<a href="https://www.umcg.nl"><img src="./logo_umcg.png" height="60px"></a>

View File

@ -14,7 +14,7 @@ guess_ab_col(tbl = NULL, col = NULL, verbose = FALSE)
\item{verbose}{a logical to indicate whether additional info should be printed}
}
\description{
This tries to find a column name in a data set based on information from the \code{\link{antibiotics}} data set. You can look for an antibiotic (trade) of abbreviation and it will search the data for any column containing a name or ATC code of that antibiotic.
This tries to find a column name in a data set based on information from the \code{\link{antibiotics}} data set. You can look for an antibiotic (trade) name or abbreviation and it will search the \code{data.frame} for any column containing a name or ATC code of that antibiotic.
}
\section{Read more on our website!}{

View File

@ -21,9 +21,9 @@ rsi_predict(tbl, col_ab, col_date, year_min = NULL, year_max = NULL,
\item{col_date}{column name of the date, will be used to calculate years if this column doesn't consist of years already}
\item{year_min}{lowest year to use in the prediction model, dafaults the lowest year in \code{col_date}}
\item{year_min}{lowest year to use in the prediction model, dafaults to the lowest year in \code{col_date}}
\item{year_max}{highest year to use in the prediction model, defaults to 15 years after today}
\item{year_max}{highest year to use in the prediction model, defaults to 10 years after today}
\item{year_every}{unit of sequence between lowest year found in the data and \code{year_max}}
@ -31,22 +31,22 @@ rsi_predict(tbl, col_ab, col_date, year_min = NULL, year_max = NULL,
\item{model}{the statistical model of choice. Valid values are \code{"binomial"} (or \code{"binom"} or \code{"logit"}) or \code{"loglin"} or \code{"linear"} (or \code{"lin"}).}
\item{I_as_R}{treat \code{I} as \code{R}}
\item{I_as_R}{a logical to indicate whether values \code{I} should be treated as \code{R}}
\item{preserve_measurements}{logical to indicate whether predictions of years that are actually available in the data should be overwritten with the original data. The standard errors of those years will be \code{NA}.}
\item{preserve_measurements}{a logical to indicate whether predictions of years that are actually available in the data should be overwritten by the original data. The standard errors of those years will be \code{NA}.}
\item{info}{print textual analysis with the name and \code{\link{summary}} of the model.}
\item{info}{a logical to indicate whether textual analysis should be printed with the name and \code{\link{summary}} of the statistical model.}
}
\value{
\code{data.frame} with columns:
\itemize{
\item{\code{year}}
\item{\code{value}, the same as \code{estimated} when \code{preserve_measurements = FALSE}, and a combination of \code{observed} and \code{estimated} otherwise}
\item{\code{se_min}, the lower bound of the standard error with a minimum of \code{0}}
\item{\code{se_max} the upper bound of the standard error with a maximum of \code{1}}
\item{\code{observations}, the total number of observations, i.e. S + I + R}
\item{\code{observed}, the original observed values}
\item{\code{estimated}, the estimated values, calculated by the model}
\item{\code{se_min}, the lower bound of the standard error with a minimum of \code{0} (so the standard error will never go below 0\%)}
\item{\code{se_max} the upper bound of the standard error with a maximum of \code{1} (so the standard error will never go above 100\%)}
\item{\code{observations}, the total number of available observations in that year, i.e. S + I + R}
\item{\code{observed}, the original observed resistant percentages}
\item{\code{estimated}, the estimated resistant percentages, calculated by the model}
}
}
\description{