R/virus_data.R

Defines functions get.available.viruses get.supplied.comparison.template.path.virus

get.supplied.comparison.template.path.virus <- function(virus, region) {
    if (length(region) == 0 || region == "") {
        return(NULL)
    }
    path <- system.file("extdata", "Vir", virus, region, "comparison",
                        "templates", package = "openPrimeR")
    csv.file <- list.files(path, full.names = TRUE)[1]
    if (!file.exists(csv.file)) {
        warning(paste0("Template comparison data for ", virus, " and ", region, 
                       ",not found!"))
        return(NULL)
    }
    res <- list(datapath = csv.file, name = region)
    return(res)
}

get.available.viruses <- function() {
    # determine for which viruses there are available template sequences
    virus.folder <- system.file("extdata", "Vir", package = "openPrimeR")
    virs <- basename(list.dirs(virus.folder, recursive = FALSE))
    return(virs)
}

Try the openPrimeRui package in your browser

Any scripts or data that you put into this service are public.

openPrimeRui documentation built on Nov. 8, 2020, 6:44 p.m.