This R script allows
- listing all of the available organisms on PubMLST API
- listing all of the available schemes for a given organisms (including dates of last changes to schemes and numbers of profiles included in each of the schemes)
- downloading specified scheme
- downloading specified scheme profiles
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
Rscript --vanilla pubMLST_scheme_scraper.R --help
To list available organisms on PubMLST
Rscript --vanilla pubMLST_scheme_scraper.R -f list_organisms
To list available schemes for a given organism
Rscript --vanilla pubMLST_scheme_scraper.R -f list_organism_schemes -o abaumannii
To download scheme profiles for a given organism and scheme ID
Rscript --vanilla pubMLST_scheme_scraper.R -f download_scheme_profiles -o abaumannii -s 1
To download scheme
Rscript --vanilla pubMLST_scheme_scraper.R -f download_scheme -o abaumannii -s 1