R/ftp-currentRelease.R

Defines functions currentRelease

Documented in currentRelease

#' Current WormBase release
#'
#' @note Updated 2021-02-18.
#' @export
#'
#' @return `character(1)`.
#' WormBase release release (e.g. WS271).
#'
#' @examples
#' currentRelease()
currentRelease <- function() {
    suppressMessages({
        file <- transmit(
            remoteDir = pasteUrl(
                "ftp.wormbase.org",
                "pub",
                "wormbase",
                "releases",
                "current-production-release",
                protocol = "ftp"
            ),
            pattern = "^letter",
            download = FALSE
        )
    })
    x <- sub(pattern = "^letter\\.", replacement = "", x = basename(file))
    assert(
        isString(x),
        isMatchingRegex(x, pattern = "^WS\\d{3}$")
    )
    x
}
steinbaugh/worminfo documentation built on Oct. 6, 2023, 9:40 a.m.