This R script allows
- listing all of the available cgMLST schemes on cgMLST.org
- finding the version and/or date and time of the last change on scheme of interest
- downloading specified schemes from cgMLST.org
In case you would like to use this script you can easily install all the required packages by running the code below in your R session:
# Listing required packages
required_packages <- c("tidyverse", "rvest", "knitr", "optparse")
# Check if required packages are installed
missing_packages <- setdiff(required_packages, installed.packages()[,"Package"])
# Install missing packages
if (length(missing_packages) > 0) {
message("Installing missing packages: ", paste(missing_packages, collapse = ", "))
install.packages(missing_packages)
}
The script can be used directly from command line.
To see help message
Rscript --vanilla cgMLSTorg_scheme_scraper.R --help
To list all available schemes on cgMLST.org
Rscript --vanilla cgMLSTorg_scheme_scraper.R
To finding the date and time of the last change on scheme of interest
Rscript --vanilla cgMLSTorg_scheme_scraper.R -f last_change -i Abaumannii
To download specific scheme
Rscript --vanilla cgMLSTorg_scheme_scraper.R -f download -i Abaumannii