diff --git a/DESCRIPTION b/DESCRIPTION index c3d4dd0a..7ae540d2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 2.1.1.9084 -Date: 2024-09-30 +Version: 2.1.1.9086 +Date: 2024-10-02 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 fc0e0458..77bd9386 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 2.1.1.9084 +# AMR 2.1.1.9086 *(this beta version will eventually become v3.0. We're happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using [the instructions here](https://msberends.github.io/AMR/#latest-development-version).)* diff --git a/R/sysdata.rda b/R/sysdata.rda index aae784c9..9918dc4e 100755 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/data-raw/AMRforRGPT.pdf b/data-raw/AMRforRGPT.pdf new file mode 100644 index 00000000..68e3124e Binary files /dev/null and b/data-raw/AMRforRGPT.pdf differ diff --git a/data-raw/AMRforRGPT.pptx b/data-raw/AMRforRGPT.pptx new file mode 100644 index 00000000..07ca8aa3 Binary files /dev/null and b/data-raw/AMRforRGPT.pptx differ diff --git a/data-raw/AMRforRGPT.svg b/data-raw/AMRforRGPT.svg new file mode 100644 index 00000000..df39fe9b --- /dev/null +++ b/data-raw/AMRforRGPT.svg @@ -0,0 +1,2456 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data-raw/_pre_commit_checks.R b/data-raw/_pre_commit_checks.R index d87adb32..8bf82377 100644 --- a/data-raw/_pre_commit_checks.R +++ b/data-raw/_pre_commit_checks.R @@ -169,6 +169,7 @@ pre_commit_lst$MO_WHO_PRIORITY_GENERA <- c( "Coccidioides", "Cryptococcus", "Enterococcus", + "Escherichia", "Fusarium", "Haemophilus", "Helicobacter", diff --git a/data-raw/microorganisms.dta b/data-raw/microorganisms.dta index dd5b3a93..54cdc974 100644 Binary files a/data-raw/microorganisms.dta and b/data-raw/microorganisms.dta differ diff --git a/data-raw/microorganisms.feather b/data-raw/microorganisms.feather index 3cbb6da8..37becc61 100644 Binary files a/data-raw/microorganisms.feather and b/data-raw/microorganisms.feather differ diff --git a/data-raw/microorganisms.md5 b/data-raw/microorganisms.md5 index bfee2524..86f3d3f2 100644 --- a/data-raw/microorganisms.md5 +++ b/data-raw/microorganisms.md5 @@ -1 +1 @@ -5b5544d28deade33092925a6758277c4 +f38201f0751cfc3a0993dcf9141609a1 diff --git a/data-raw/microorganisms.parquet b/data-raw/microorganisms.parquet index bba8a34b..a41b866c 100644 Binary files a/data-raw/microorganisms.parquet and b/data-raw/microorganisms.parquet differ diff --git a/data-raw/microorganisms.rds b/data-raw/microorganisms.rds index ed5e1798..53dd25b9 100644 Binary files a/data-raw/microorganisms.rds and b/data-raw/microorganisms.rds differ diff --git a/data-raw/microorganisms.sav b/data-raw/microorganisms.sav index ee5f0ee4..3621fb7e 100644 Binary files a/data-raw/microorganisms.sav and b/data-raw/microorganisms.sav differ diff --git a/data-raw/microorganisms.txt b/data-raw/microorganisms.txt index 99934a87..ba36f6a6 100644 --- a/data-raw/microorganisms.txt +++ b/data-raw/microorganisms.txt @@ -23741,19 +23741,19 @@ "B_ECRBM_RMSM" "Erythromicrobium ramosum" "synonym" "Bacteria" "Pseudomonadota" "Alphaproteobacteria" "Sphingomonadales" "Erythrobacteraceae" "Erythromicrobium" "ramosum" "" "species" "Yurkov et al., 1994" "LPSN" "776049" "515600" "12988" "3221406" 2 "434593006" "B_ERMNS" "Erythromonas" "synonym" "Bacteria" "Pseudomonadota" "Alphaproteobacteria" "Sphingomonadales" "Sphingomonadaceae" "Erythromonas" "" "" "genus" "Yurkov et al., 1997" "LPSN" "515601" "1302" "515246" "8926" 2 "" "B_ERMNS_URSN" "Erythromonas ursincola" "synonym" "Bacteria" "Pseudomonadota" "Alphaproteobacteria" "Sphingomonadales" "Sphingomonadaceae" "Erythromonas" "ursincola" "" "species" "Yurkov et al., 1997" "LPSN" "776051" "515601" "774092" 2 "" -"B_ESCHR" "Escherichia" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "" "" "genus" "Castellani et al., 1919" "facultative anaerobe" "LPSN" "515602" "482" "11158430" 1.15 "407310004,407251000,407281008,407284000,407283006,407160000,407285004,407159005,407287007,407290001,407291002,407289005,407293004,407222004,407295006,407294005,407297003,407260008,407299000,407300008,407301007,103429008,124994003,407303005,407306002,407305003,407308001,407253002,407254008,407262000,407263005,407265003,407264004,407267006,407269009,407256005,407271009,407199008,407273007,407275000,407258006,407278003,407279006,407277008,407231004,407235008,407234007,407233001,407237000,407239002,407241001,407243003,407245005,407246006,407227005,407229008,715877003,407203008,407161001,407204002,407158002,407207009,407206000,407209007,407211003,407214006,407213000,407219001,407217004,407218009,407216008,407220007,407221006,407224003,407225002,414103002,407197005,407198000,407196001,407202003,407201005,407182007,407184008,407163003,407186005,407190007,407189003,407188006,407192004,407194003,407165005,407169004,407168007,407173001,407172006,407171004,407175008,406629008,406628000,407177000,407179002,407180004,407156003,407157007,116398008,417207000,64735005,713416009" -"B_ESCHR_ADCR" "Escherichia adecarboxylata" "synonym" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "adecarboxylata" "" "species" "Leclerc, 1962" "likely facultative anaerobe" "LPSN" "776052" "515602" "777447" 1.15 "" -"B_ESCHR_ALBR" "Escherichia albertii" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "albertii" "" "species" "Huys et al., 2003" "facultative anaerobe" "LPSN" "776053" "515602" "5427575" 1.15 "419388003" -"B_ESCHR_BLTT" "Escherichia blattae" "synonym" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "blattae" "" "species" "Burgess et al., 1973" "likely facultative anaerobe" "LPSN" "776056" "515602" "788468" 1.5 "" -"B_ESCHR_COLI" "Escherichia coli" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "coli" "" "species" "Castellani et al., 1919" "facultative anaerobe" "LPSN" "776057" "515602" "11286021" 1.15 "1095001000112106,715307006,737528008,416989002,116397003,414097009,414098004,414099007,414100004,116395006,735270003,116396007,83285000,116394005,112283007,710886005,710887001,710888006,710889003,414132004,721892009,416812001,416740004,417216001,457541006,710253004,416530004,417189006,409800005,713925008,444771000124108,838549008" -"B_ESCHR_COLI_COLI" "Escherichia coli coli" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "coli" "coli" "subspecies" "GBIF" "776057" "12233256" "11286021" 1.15 "" -"B_ESCHR_COLI_EXPR" "Escherichia coli expressing" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "coli" "expressing" "subspecies" "AmSOD" "GBIF" "776057" "12239548" "11286021" 1.15 "" -"B_ESCHR_DYSN" "Escherichia dysenteriae" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "dysenteriae" "" "species" "likely facultative anaerobe" "GBIF" "515602" "10862979" 1.5 "" -"B_ESCHR_FRGS" "Escherichia fergusonii" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "fergusonii" "" "species" "Farmer et al., 1985" "facultative anaerobe" "LPSN" "776059" "515602" "5427571" 1.15 "72461005" -"B_ESCHR_HRMN" "Escherichia hermannii" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "hermannii" "" "species" "Brenner et al., 1983" "facultative anaerobe" "LPSN" "776060" "515602" "5427572" 1.5 "85786000" -"B_ESCHR_MRMT" "Escherichia marmotae" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "marmotae" "" "species" "Liu et al., 2015" "likely facultative anaerobe" "LPSN" "792928" "515602" "8869052" 1.5 "14961000146107" -"B_ESCHR_RUYS" "Escherichia ruysiae" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "ruysiae" "" "species" "Van der Putten et al., 2021" "likely facultative anaerobe" "LPSN" "17322" "515602" "11776954" 1.5 "" -"B_ESCHR_VLNR" "Escherichia vulneris" "synonym" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "vulneris" "" "species" "Brenner et al., 1983" "likely facultative anaerobe" "LPSN" "776063" "515602" "796273" "5427573" 1.15 "" +"B_ESCHR" "Escherichia" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "" "" "genus" "Castellani et al., 1919" "facultative anaerobe" "LPSN" "515602" "482" "11158430" 1 "407310004,407251000,407281008,407284000,407283006,407160000,407285004,407159005,407287007,407290001,407291002,407289005,407293004,407222004,407295006,407294005,407297003,407260008,407299000,407300008,407301007,103429008,124994003,407303005,407306002,407305003,407308001,407253002,407254008,407262000,407263005,407265003,407264004,407267006,407269009,407256005,407271009,407199008,407273007,407275000,407258006,407278003,407279006,407277008,407231004,407235008,407234007,407233001,407237000,407239002,407241001,407243003,407245005,407246006,407227005,407229008,715877003,407203008,407161001,407204002,407158002,407207009,407206000,407209007,407211003,407214006,407213000,407219001,407217004,407218009,407216008,407220007,407221006,407224003,407225002,414103002,407197005,407198000,407196001,407202003,407201005,407182007,407184008,407163003,407186005,407190007,407189003,407188006,407192004,407194003,407165005,407169004,407168007,407173001,407172006,407171004,407175008,406629008,406628000,407177000,407179002,407180004,407156003,407157007,116398008,417207000,64735005,713416009" +"B_ESCHR_ADCR" "Escherichia adecarboxylata" "synonym" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "adecarboxylata" "" "species" "Leclerc, 1962" "likely facultative anaerobe" "LPSN" "776052" "515602" "777447" 1 "" +"B_ESCHR_ALBR" "Escherichia albertii" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "albertii" "" "species" "Huys et al., 2003" "facultative anaerobe" "LPSN" "776053" "515602" "5427575" 1 "419388003" +"B_ESCHR_BLTT" "Escherichia blattae" "synonym" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "blattae" "" "species" "Burgess et al., 1973" "likely facultative anaerobe" "LPSN" "776056" "515602" "788468" 1 "" +"B_ESCHR_COLI" "Escherichia coli" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "coli" "" "species" "Castellani et al., 1919" "facultative anaerobe" "LPSN" "776057" "515602" "11286021" 1 "1095001000112106,715307006,737528008,416989002,116397003,414097009,414098004,414099007,414100004,116395006,735270003,116396007,83285000,116394005,112283007,710886005,710887001,710888006,710889003,414132004,721892009,416812001,416740004,417216001,457541006,710253004,416530004,417189006,409800005,713925008,444771000124108,838549008" +"B_ESCHR_COLI_COLI" "Escherichia coli coli" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "coli" "coli" "subspecies" "GBIF" "776057" "12233256" "11286021" 1 "" +"B_ESCHR_COLI_EXPR" "Escherichia coli expressing" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "coli" "expressing" "subspecies" "AmSOD" "GBIF" "776057" "12239548" "11286021" 1 "" +"B_ESCHR_DYSN" "Escherichia dysenteriae" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "dysenteriae" "" "species" "likely facultative anaerobe" "GBIF" "515602" "10862979" 1 "" +"B_ESCHR_FRGS" "Escherichia fergusonii" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "fergusonii" "" "species" "Farmer et al., 1985" "facultative anaerobe" "LPSN" "776059" "515602" "5427571" 1 "72461005" +"B_ESCHR_HRMN" "Escherichia hermannii" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "hermannii" "" "species" "Brenner et al., 1983" "facultative anaerobe" "LPSN" "776060" "515602" "5427572" 1 "85786000" +"B_ESCHR_MRMT" "Escherichia marmotae" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "marmotae" "" "species" "Liu et al., 2015" "likely facultative anaerobe" "LPSN" "792928" "515602" "8869052" 1 "14961000146107" +"B_ESCHR_RUYS" "Escherichia ruysiae" "accepted" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "ruysiae" "" "species" "Van der Putten et al., 2021" "likely facultative anaerobe" "LPSN" "17322" "515602" "11776954" 1 "" +"B_ESCHR_VLNR" "Escherichia vulneris" "synonym" "Bacteria" "Pseudomonadota" "Gammaproteobacteria" "Enterobacterales" "Enterobacteriaceae" "Escherichia" "vulneris" "" "species" "Brenner et al., 1983" "likely facultative anaerobe" "LPSN" "776063" "515602" "796273" "5427573" 1 "" "P_ESTST" "Estiastra" "accepted" "Protozoa" "" "" "" "" "Estiastra" "" "" "genus" "Eisenack, 1959" "GBIF" "3208159" "7" 2 "" "P_ESTST_MAGN" "Estiastra magna" "accepted" "Protozoa" "" "" "" "" "Estiastra" "magna" "" "species" "Eisenack, 1959" "GBIF" "4918097" "3208159" 2 "" "P_ESTST_MINM" "Estiastra minima" "accepted" "Protozoa" "" "" "" "" "Estiastra" "minima" "" "species" "Volkova, 1969" "GBIF" "4918094" "3208159" 2 "" diff --git a/data-raw/microorganisms.xlsx b/data-raw/microorganisms.xlsx index 55bc8e45..6e9b9c19 100644 Binary files a/data-raw/microorganisms.xlsx and b/data-raw/microorganisms.xlsx differ diff --git a/data/microorganisms.rda b/data/microorganisms.rda index 4ebf915b..3d8ac4ce 100644 Binary files a/data/microorganisms.rda and b/data/microorganisms.rda differ diff --git a/index.md b/index.md index f0665b93..d1336891 100644 --- a/index.md +++ b/index.md @@ -9,6 +9,8 @@ * Integrates with **WHONET**, ATC, **EARS-Net**, PubChem, **LOINC**, **SNOMED CT**, and **NCBI** * 100% free of costs and dependencies, highly suitable for places with **limited resources** + +

https://msberends.github.io/AMR

https://doi.org/10.18637/jss.v104.i03

diff --git a/man/as.mo.Rd b/man/as.mo.Rd index 300c7fa3..bfa5de0e 100644 --- a/man/as.mo.Rd +++ b/man/as.mo.Rd @@ -207,7 +207,7 @@ Furthermore, When calculating the matching score, all characters in \eqn{x} and \eqn{n} are ignored that are other than A-Z, a-z, 0-9, spaces and parentheses. -All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., \code{"E. coli"} will return the microbial ID of \emph{Escherichia coli} (\eqn{m = 0.598}, a highly prevalent microorganism found in humans) and not \emph{Entamoeba coli} (\eqn{m = 0.381}, a less prevalent microorganism in humans), although the latter would alphabetically come first. +All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., \code{"E. coli"} will return the microbial ID of \emph{Escherichia coli} (\eqn{m = 0.688}, a highly prevalent microorganism found in humans) and not \emph{Entamoeba coli} (\eqn{m = 0.381}, a less prevalent microorganism in humans), although the latter would alphabetically come first. } \section{Reference Data Publicly Available}{ diff --git a/man/mo_matching_score.Rd b/man/mo_matching_score.Rd index ecc589f7..b6d0f0bd 100644 --- a/man/mo_matching_score.Rd +++ b/man/mo_matching_score.Rd @@ -55,7 +55,7 @@ Furthermore, When calculating the matching score, all characters in \eqn{x} and \eqn{n} are ignored that are other than A-Z, a-z, 0-9, spaces and parentheses. -All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., \code{"E. coli"} will return the microbial ID of \emph{Escherichia coli} (\eqn{m = 0.598}, a highly prevalent microorganism found in humans) and not \emph{Entamoeba coli} (\eqn{m = 0.381}, a less prevalent microorganism in humans), although the latter would alphabetically come first. +All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., \code{"E. coli"} will return the microbial ID of \emph{Escherichia coli} (\eqn{m = 0.688}, a highly prevalent microorganism found in humans) and not \emph{Entamoeba coli} (\eqn{m = 0.381}, a less prevalent microorganism in humans), although the latter would alphabetically come first. } \section{Reference Data Publicly Available}{ diff --git a/pkgdown/assets/AMRforRGPT.svg b/pkgdown/assets/AMRforRGPT.svg new file mode 100644 index 00000000..df39fe9b --- /dev/null +++ b/pkgdown/assets/AMRforRGPT.svg @@ -0,0 +1,2456 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkgdown/assets/logo.svg b/pkgdown/assets/logo.svg index 40c6633c..964c0eca 100644 --- a/pkgdown/assets/logo.svg +++ b/pkgdown/assets/logo.svg @@ -6,7 +6,7 @@ xml:space="preserve" id="svg2" version="1.1" - sodipodi:docname="AMR-new-logo-shape.svg" + sodipodi:docname="logo.svg" inkscape:version="1.3.2 (091e20e, 2023-11-25)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" @@ -26,14 +26,14 @@ inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" showguides="true" - inkscape:zoom="1.1061075" - inkscape:cx="344.90318" - inkscape:cy="321.84936" - inkscape:window-width="1920" - inkscape:window-height="1103" - inkscape:window-x="0" + inkscape:zoom="0.93102768" + inkscape:cx="239.52027" + inkscape:cy="341.02101" + inkscape:window-width="1632" + inkscape:window-height="1044" + inkscape:window-x="83" inkscape:window-y="43" - inkscape:window-maximized="1" + inkscape:window-maximized="0" inkscape:current-layer="svg2" />image/svg+xml +AMR for R logoimage/svg+xmlMatthijs BerendsAMR for R logo diff --git a/pkgdown/extra.css b/pkgdown/extra.css index 1001de1c..957e9ce1 100644 --- a/pkgdown/extra.css +++ b/pkgdown/extra.css @@ -66,8 +66,31 @@ --bs-dropdown-link-hover-color: var(--amr-green-light) !important; --bs-dropdown-link-hover-bg: var(--amr-green-dark) !important; --bs-dropdown-link-active-color: white !important; - } + +/* Python page */ +body.amr-for-python * { + --amr-green-light: #FFD43B; /* Python yellow */ + --amr-green-light-rgb: 255, 212, 59; + --amr-green-dark: #306998; /* Python blue */ + --amr-green-dark-rgb: 48, 105, 152; + --amr-green-middle: #b1bc5e; /* Adjusted middle yellow */ + --amr-green-middle-rgb: 177, 188, 94; + --bs-success: var(--amr-green-dark) !important; + --bs-light: var(--amr-green-light) !important; + --bs-info: var(--amr-green-middle) !important; + --bs-link-color: var(--amr-green-dark) !important; + --bs-link-color-rgb: var(--amr-green-dark-rgb) !important; + --bs-primary: var(--amr-green-dark) !important; + --bs-primary-color: var(--amr-green-dark) !important; + --bs-primary-rgb: var(--amr-green-dark-rgb) !important; + --bs-secondary-color: var(--amr-green-dark) !important; + --bs-navbar-active-color: var(--amr-green-light) !important; + --bs-dropdown-bg: var(--amr-green-dark) !important; + --bs-dropdown-link-hover-color: var(--amr-green-light) !important; + --bs-dropdown-link-hover-bg: var(--amr-green-dark) !important; +} + .nav-text.text-muted, .bg-primary .navbar-nav .show>.nav-link, .bg-primary .navbar-nav .nav-link.active, diff --git a/pkgdown/extra.js b/pkgdown/extra.js index 81adf46c..752c9a38 100644 --- a/pkgdown/extra.js +++ b/pkgdown/extra.js @@ -52,7 +52,7 @@ $(document).ready(function() { // make Python part more fancy - prepare for CSS if (window.location.href.includes('AMR_for_Python')) { $('body').addClass('amr-for-python'); - $('img[src="logo.svg"]').attr('src', 'logo_python.svg'); + $('img[src="../logo.svg"]').attr('src', '../logo_python.svg'); } // add doctoral titles to authors diff --git a/pkgdown/favicon/android-chrome-192x192.png b/pkgdown/favicon/android-chrome-192x192.png deleted file mode 100644 index 1136846c..00000000 Binary files a/pkgdown/favicon/android-chrome-192x192.png and /dev/null differ diff --git a/pkgdown/favicon/android-chrome-512x512.png b/pkgdown/favicon/android-chrome-512x512.png deleted file mode 100644 index 57a4d9af..00000000 Binary files a/pkgdown/favicon/android-chrome-512x512.png and /dev/null differ diff --git a/pkgdown/favicon/apple-touch-icon-120x120.png b/pkgdown/favicon/apple-touch-icon-120x120.png index ccd827a0..1bf3a541 100644 Binary files a/pkgdown/favicon/apple-touch-icon-120x120.png and b/pkgdown/favicon/apple-touch-icon-120x120.png differ diff --git a/pkgdown/favicon/apple-touch-icon-152x152.png b/pkgdown/favicon/apple-touch-icon-152x152.png index 2154078f..60911862 100644 Binary files a/pkgdown/favicon/apple-touch-icon-152x152.png and b/pkgdown/favicon/apple-touch-icon-152x152.png differ diff --git a/pkgdown/favicon/apple-touch-icon-180x180.png b/pkgdown/favicon/apple-touch-icon-180x180.png index 40a4a482..d699b8f5 100644 Binary files a/pkgdown/favicon/apple-touch-icon-180x180.png and b/pkgdown/favicon/apple-touch-icon-180x180.png differ diff --git a/pkgdown/favicon/apple-touch-icon-60x60.png b/pkgdown/favicon/apple-touch-icon-60x60.png index 3df68aae..20f9fa43 100644 Binary files a/pkgdown/favicon/apple-touch-icon-60x60.png and b/pkgdown/favicon/apple-touch-icon-60x60.png differ diff --git a/pkgdown/favicon/apple-touch-icon-76x76.png b/pkgdown/favicon/apple-touch-icon-76x76.png index fe255914..3553f201 100644 Binary files a/pkgdown/favicon/apple-touch-icon-76x76.png and b/pkgdown/favicon/apple-touch-icon-76x76.png differ diff --git a/pkgdown/favicon/apple-touch-icon.png b/pkgdown/favicon/apple-touch-icon.png index ec34b750..3cb783cf 100644 Binary files a/pkgdown/favicon/apple-touch-icon.png and b/pkgdown/favicon/apple-touch-icon.png differ diff --git a/pkgdown/favicon/browserconfig.xml b/pkgdown/favicon/browserconfig.xml deleted file mode 100644 index 60da9bba..00000000 --- a/pkgdown/favicon/browserconfig.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - #128f76 - - - diff --git a/pkgdown/favicon/favicon-16x16.png b/pkgdown/favicon/favicon-16x16.png index aaaf09ec..0d18bab4 100644 Binary files a/pkgdown/favicon/favicon-16x16.png and b/pkgdown/favicon/favicon-16x16.png differ diff --git a/pkgdown/favicon/favicon-32x32.png b/pkgdown/favicon/favicon-32x32.png index d2d054cd..b9479fb4 100644 Binary files a/pkgdown/favicon/favicon-32x32.png and b/pkgdown/favicon/favicon-32x32.png differ diff --git a/pkgdown/favicon/favicon.ico b/pkgdown/favicon/favicon.ico index c5d59fec..acabb5e8 100644 Binary files a/pkgdown/favicon/favicon.ico and b/pkgdown/favicon/favicon.ico differ diff --git a/pkgdown/favicon/mstile-150x150.png b/pkgdown/favicon/mstile-150x150.png deleted file mode 100644 index 29ef584c..00000000 Binary files a/pkgdown/favicon/mstile-150x150.png and /dev/null differ diff --git a/pkgdown/favicon/mstile-310x310.png b/pkgdown/favicon/mstile-310x310.png deleted file mode 100644 index 9873e8e9..00000000 Binary files a/pkgdown/favicon/mstile-310x310.png and /dev/null differ diff --git a/pkgdown/favicon/safari-pinned-tab.svg b/pkgdown/favicon/safari-pinned-tab.svg deleted file mode 100644 index 5450bcdf..00000000 --- a/pkgdown/favicon/safari-pinned-tab.svg +++ /dev/null @@ -1,512 +0,0 @@ - - - - -Created by potrace 1.14, written by Peter Selinger 2001-2017 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pkgdown/favicon/site.webmanifest b/pkgdown/favicon/site.webmanifest deleted file mode 100644 index 16638772..00000000 --- a/pkgdown/favicon/site.webmanifest +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "AMR for R", - "short_name": "AMR for R", - "icons": [ - { - "src": "/android-chrome-192x192.png?v=newlogo", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "/android-chrome-512x512.png?v=newlogo", - "sizes": "512x512", - "type": "image/png" - } - ], - "theme_color": "#128f76", - "background_color": "#128f76", - "display": "standalone" -} diff --git a/vignettes/AMR_for_Python.Rmd b/vignettes/AMR_for_Python.Rmd index f6cd5755..37a7fe1a 100755 --- a/vignettes/AMR_for_Python.Rmd +++ b/vignettes/AMR_for_Python.Rmd @@ -26,7 +26,9 @@ knitr::opts_chunk$set( The `AMR` package for R is an incredible tool for antimicrobial resistance (AMR) data analysis, providing extensive functionality for working with microbial and antimicrobial properties. But what if you're working in Python and still want to benefit from the robust features of `AMR`? -Luckily, there is no need to port the package to Python! With the help of `rpy2`, a powerful Python package, you can easily access R from Python and call functions from the `AMR` package to process your own data. This post will guide you through setting up `rpy2` and show you how to use R functions from `AMR` in Python to supercharge your antimicrobial resistance analysis. +The best way is to access R directly from Python with the help of `rpy2`, a simple yet powerful Python package. You can easily call functions from the `AMR` package to process your own data in your own Python environment. This post will guide you through setting up `rpy2` and show you how to use R functions from `AMR` in Python to supercharge your antimicrobial resistance analysis. + + # What is `rpy2`? @@ -43,17 +45,37 @@ Before diving into the examples, you’ll need to install both R and `rpy2`. Her ## Step 1: Install R -Ensure that you have R installed on your system. You can download R from [CRAN](https://cran.r-project.org/). +Ensure that R is installed on your system. R has minimal dependencies and is very simple to install: + +* **Linux** + * Ubuntu / Debian: + `sudo apt install r-base` + * Fedora: + `sudo dnf install R` + * CentOS/RHEL: + `sudo yum install R` + * Arch Linux: + `sudo pacman -S r` +* **macOS** (with Homebrew): + `brew install r` +* **Other Systems:** + Visit the [CRAN download page](https://cran.r-project.org). ## Step 2: Install the `AMR` package in R -Once you have R installed, open your R console and install the `AMR` package: +On Linux and macOS, open Terminal and run: + +```bash +Rscript -e 'install.packages("AMR")' +``` + +For other systems, open your R console and install the `AMR` package by running: ```r install.packages("AMR") ``` -You can also install the latest development version of the `AMR` package if needed: +On any system, you can also install the latest development version of the `AMR` package by setting `repos` to our beta channel: ```r install.packages("AMR", repos = "https://msberends.r-universe.dev") @@ -69,7 +91,7 @@ pip install rpy2 ## Step 4: Test `rpy2` Installation -To ensure everything is set up correctly, you can test your installation by running the following Python script: +To ensure everything is set up correctly, you can test your installation by running the following Python script, which essentially runs R in the background: ```python import rpy2.robjects as ro @@ -80,11 +102,11 @@ ro.r('1 + 1') If this returns `2`, you're good to go! -# Working with AMR in Python using `rpy2` +# Working with `AMR` in Python Now that we have `rpy2` set up, let’s walk through some practical examples of using the `AMR` package within Python. -## Example 1: Loading `AMR` and Example Data +## Example 1: Converting Taxonomic Data Let’s start by converting taxonomic user input to valid taxonomy using the `AMR` package, from within Python: @@ -94,9 +116,6 @@ import rpy2.robjects as ro from rpy2.robjects.packages import importr from rpy2.robjects import pandas2ri -# Enable conversion between pandas and R data frames -pandas2ri.activate() - # Load the AMR package from R amr = importr('AMR') @@ -105,15 +124,12 @@ data = pd.DataFrame({ 'microorganism': ['E. coli', 'S. aureus', 'P. aeruginosa', 'K. pneumoniae'] }) -# Convert the Python DataFrame to an R DataFrame -r_data = pandas2ri.py2rpy(data) - # Apply mo_name() from the AMR package to the 'microorganism' column -ro.globalenv['r_data'] = r_data +ro.globalenv['r_data'] = data ro.r('r_data$mo_name <- mo_name(r_data$microorganism)') # Retrieve and print the modified R DataFrame in Python -result = ro.r('as.data.frame(r_data)') +result = ro.r('r_data') result = pandas2ri.rpy2py(result) print(result) ```