diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..88cf75fa --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +*.dta filter=lfs diff=lfs merge=lfs -text +*.sas filter=lfs diff=lfs merge=lfs -text +*.sav filter=lfs diff=lfs merge=lfs -text +data-raw/*.dta filter=lfs diff=lfs merge=lfs -text +data-raw/*.sas filter=lfs diff=lfs merge=lfs -text +data-raw/*.sav filter=lfs diff=lfs merge=lfs -text diff --git a/.github/prehooks/post-checkout b/.github/prehooks/post-checkout new file mode 100755 index 00000000..cab40f26 --- /dev/null +++ b/.github/prehooks/post-checkout @@ -0,0 +1,3 @@ +#!/bin/sh +command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-checkout.\n"; exit 2; } +git lfs post-checkout "$@" diff --git a/.github/prehooks/post-commit b/.github/prehooks/post-commit new file mode 100755 index 00000000..9443f416 --- /dev/null +++ b/.github/prehooks/post-commit @@ -0,0 +1,3 @@ +#!/bin/sh +command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-commit.\n"; exit 2; } +git lfs post-commit "$@" diff --git a/.github/prehooks/post-merge b/.github/prehooks/post-merge new file mode 100755 index 00000000..828b7089 --- /dev/null +++ b/.github/prehooks/post-merge @@ -0,0 +1,3 @@ +#!/bin/sh +command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-merge.\n"; exit 2; } +git lfs post-merge "$@" diff --git a/.github/prehooks/pre-commit b/.github/prehooks/pre-commit index 070725aa..dc8344db 100755 --- a/.github/prehooks/pre-commit +++ b/.github/prehooks/pre-commit @@ -5,7 +5,7 @@ echo "Running pre-commit hook..." # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo ">> Updating R documentation..." if command -v Rscript > /dev/null; then - if "$(Rscript -e 'cat(all(c('"'roxygen2'"', '"'pkgload'"') %in% rownames(installed.packages())))')" == "TRUE"; then + if [ "$(Rscript -e 'cat(all(c('"'roxygen2'"', '"'pkgload'"') %in% rownames(installed.packages())))')" = "TRUE" ]; then Rscript -e "suppressMessages(roxygen2::roxygenise())" currentpkg=`Rscript -e "cat(pkgload::pkg_name())"` git add man/* @@ -59,6 +59,9 @@ git add DESCRIPTION # set version number to NEWS file if [ -e "NEWS.md" ]; then + if [ "$currentpkg" = "your" ]; then + currentpkg="" + fi sed -i -- "1s/.*/# ${currentpkg} ${currentversion}/" NEWS.md echo ">> - updated NEWS.md" # remove leftover on macOS diff --git a/.github/prehooks/pre-commit.save b/.github/prehooks/pre-commit.save new file mode 100755 index 00000000..ddb33066 --- /dev/null +++ b/.github/prehooks/pre-commit.save @@ -0,0 +1,71 @@ +#!/bin/sh + +echo "Running pre-commit hook..." + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +echo ">> Updating R documentation..." +if command -v Rscript > /dev/null; then + if [ "$(Rscript -e 'cat(all(c('"'roxygen2'"', '"'pkgload'"') %in% rownames(installed.packages())))')" = "TRUE" ]; then + Rscript -e "suppressMessages(roxygen2::roxygenise())" + currentpkg=`Rscript -e "cat(pkgload::pkg_name())"` + git add man/* + echo ">> done." + else + echo ">> R packages 'roxygen2' and 'pkgload' are not installed!" + currentpkg="your" + fi +else + echo ">> R is not available on your system!" + currentpkg="your" +fi +echo ">> " + + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +echo ">> Updating semantic versioning and date..." + +# get tags from remote, and remove tags not on remote: +git fetch origin --prune --prune-tags --quiet +currenttagfull=`git describe --tags --abbrev=0` +currenttag=`git describe --tags --abbrev=0 | sed 's/v//'` +if [ "$currenttag" = "" ]; then + # there is no tag, so set tag to 0.0.1 and commit index to current count + echo ">> - no git tags found, create some using v(x).(y).(z)" + currenttag="0.0.1" + currentcommit=`git rev-list --count HEAD` +else + # there is a tag, so base version number on that + currentcommit=`git rev-list --count ${currenttagfull}..HEAD` + if (( "$currentcommit" == 0 )); then + # tag is new, so this must become the version number + currentversion="$currenttag" + fi + echo ">> - latest tag is '${currenttagfull}', with ${currentcommit} previous commits" +fi +if [ "$currentversion" = "" ]; then + # combine tag (e.g. 1.2.3) and commit number (like 5) increased by 9000 to indicate beta version + currentversion="$currenttag.$((currentcommit + 9001))" # results in e.g. 1.2.3.9005 +fi +echo ">> - ${currentpkg} pkg version set to ${currentversion}" + +# set version number and date to DESCRIPTION file +sed -i -- "s/^Version: .*/Version: ${currentversion}/" DESCRIPTION +sed -i -- "s/^Date: .*/Date: $(date '+%Y-%m-%d')/" DESCRIPTION +echo ">> - updated DESCRIPTION" +# remove leftover on macOS +rm -f DESCRIPTION-- +# add to commit +git add DESCRIPTION + +# set version number to NEWS file +if [ -e "NEWS.md" ]; then + sed -i -- "1s/.*/# ${currentpkg} ${currentversion}/" NEWS.md + echo ">> - updated NEWS.md" + # remove leftover on macOS + rm -f NEWS.md-- + # add to commit + git add NEWS.md +else + echo ">> - no NEWS.md found!" +fi +echo ">> " diff --git a/.github/prehooks/pre-push b/.github/prehooks/pre-push new file mode 100755 index 00000000..81a9cc63 --- /dev/null +++ b/.github/prehooks/pre-push @@ -0,0 +1,3 @@ +#!/bin/sh +command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\n"; exit 2; } +git lfs pre-push "$@" diff --git a/DESCRIPTION b/DESCRIPTION index 64e60bc7..4577074b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.8.1.9026 -Date: 2022-08-25 +Version: 1.8.1.9027 +Date: 2022-08-26 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) data analysis and to work with microbial and antimicrobial properties by diff --git a/NEWS.md b/NEWS.md index 8e10b3df..0b26273f 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# your 1.8.1.9026 +# AMR 1.8.1.9027 ### New * EUCAST 2022 and CLSI 2022 guidelines have been added for `as.rsi()`. EUCAST 2022 is now the new default guideline for all MIC and disks diffusion interpretations. diff --git a/data-raw/antibiotics.dta b/data-raw/antibiotics.dta index 71f9a8a7..c8bc9271 100644 Binary files a/data-raw/antibiotics.dta and b/data-raw/antibiotics.dta differ diff --git a/data-raw/antibiotics.sas b/data-raw/antibiotics.sas index aeeb0def..ebe9c9cc 100644 Binary files a/data-raw/antibiotics.sas and b/data-raw/antibiotics.sas differ diff --git a/data-raw/antibiotics.sav b/data-raw/antibiotics.sav index 2b827172..70e90abb 100644 Binary files a/data-raw/antibiotics.sav and b/data-raw/antibiotics.sav differ diff --git a/data-raw/antivirals.dta b/data-raw/antivirals.dta index 918b103e..3874f209 100644 Binary files a/data-raw/antivirals.dta and b/data-raw/antivirals.dta differ diff --git a/data-raw/antivirals.sas b/data-raw/antivirals.sas index 58c852da..17f3327c 100644 Binary files a/data-raw/antivirals.sas and b/data-raw/antivirals.sas differ diff --git a/data-raw/antivirals.sav b/data-raw/antivirals.sav index e8ae0140..cbf1630a 100644 Binary files a/data-raw/antivirals.sav and b/data-raw/antivirals.sav differ diff --git a/data-raw/dosage.dta b/data-raw/dosage.dta index 0bfa0854..7c4661dc 100644 Binary files a/data-raw/dosage.dta and b/data-raw/dosage.dta differ diff --git a/data-raw/dosage.sas b/data-raw/dosage.sas index c5ab2af2..c8e6365f 100644 Binary files a/data-raw/dosage.sas and b/data-raw/dosage.sas differ diff --git a/data-raw/dosage.sav b/data-raw/dosage.sav index 0340b74a..cc9a2f81 100644 Binary files a/data-raw/dosage.sav and b/data-raw/dosage.sav differ diff --git a/data-raw/intrinsic_resistant.dta b/data-raw/intrinsic_resistant.dta index ffbb644c..812300b4 100644 Binary files a/data-raw/intrinsic_resistant.dta and b/data-raw/intrinsic_resistant.dta differ diff --git a/data-raw/intrinsic_resistant.sas b/data-raw/intrinsic_resistant.sas index 1b69ec88..fbca8242 100644 Binary files a/data-raw/intrinsic_resistant.sas and b/data-raw/intrinsic_resistant.sas differ diff --git a/data-raw/intrinsic_resistant.sav b/data-raw/intrinsic_resistant.sav index c4b89ffd..b8afdf9d 100644 Binary files a/data-raw/intrinsic_resistant.sav and b/data-raw/intrinsic_resistant.sav differ diff --git a/data-raw/microorganisms.dta b/data-raw/microorganisms.dta index 74e1f46d..d1cbc96a 100644 Binary files a/data-raw/microorganisms.dta and b/data-raw/microorganisms.dta differ diff --git a/data-raw/microorganisms.old.dta b/data-raw/microorganisms.old.dta index 4e7a7358..83c21259 100644 Binary files a/data-raw/microorganisms.old.dta and b/data-raw/microorganisms.old.dta differ diff --git a/data-raw/microorganisms.old.sas b/data-raw/microorganisms.old.sas index 5d9891bb..3d4ff5d1 100644 Binary files a/data-raw/microorganisms.old.sas and b/data-raw/microorganisms.old.sas differ diff --git a/data-raw/microorganisms.old.sav b/data-raw/microorganisms.old.sav index fd371edf..ffece487 100644 Binary files a/data-raw/microorganisms.old.sav and b/data-raw/microorganisms.old.sav differ diff --git a/data-raw/microorganisms.sas b/data-raw/microorganisms.sas index 2b7b3cd9..0dedb8e3 100644 Binary files a/data-raw/microorganisms.sas and b/data-raw/microorganisms.sas differ diff --git a/data-raw/microorganisms.sav b/data-raw/microorganisms.sav index 467e2ea4..95efeff1 100644 Binary files a/data-raw/microorganisms.sav and b/data-raw/microorganisms.sav differ diff --git a/data-raw/rsi_translation.dta b/data-raw/rsi_translation.dta index af8ac783..df85d2dc 100644 Binary files a/data-raw/rsi_translation.dta and b/data-raw/rsi_translation.dta differ diff --git a/data-raw/rsi_translation.sas b/data-raw/rsi_translation.sas index 85169287..6d41d6c7 100644 Binary files a/data-raw/rsi_translation.sas and b/data-raw/rsi_translation.sas differ diff --git a/data-raw/rsi_translation.sav b/data-raw/rsi_translation.sav index 7107fe3d..d36e1d54 100644 Binary files a/data-raw/rsi_translation.sav and b/data-raw/rsi_translation.sav differ diff --git a/vignettes/datasets.Rmd b/vignettes/datasets.Rmd index 8c862633..3c86447f 100644 --- a/vignettes/datasets.Rmd +++ b/vignettes/datasets.Rmd @@ -25,7 +25,7 @@ knitr::opts_chunk$set( library(AMR) library(dplyr) -options(knitr.kable.NA = '') +options(knitr.kable.NA = "") structure_txt <- function(dataset) { paste0("A data set with ", @@ -94,8 +94,6 @@ All reference data (about microorganisms, antibiotics, R/SI interpretation, EUCA On this page, we explain how to download them and how the structure of the data sets look like. -

If you are reading this page from within R, please visit our website, which is automatically updated with every code change.

- ## Microorganisms (currently accepted names) `r structure_txt(microorganisms)` @@ -104,8 +102,6 @@ This data set is in R available as `microorganisms`, after you load the `AMR` pa `r download_txt("microorganisms")` -**NOTE: The exported files for SAS, SPSS and Stata do not contain SNOMED codes, as their file size would exceed 100 MB; the file size limit of GitHub.** Advice? Use R instead. - ### Source Our full taxonomy of microorganisms is based on the authoritative and comprehensive: