R/validation_tests.R

Defines functions validate_bioc_views

Documented in validate_bioc_views

## These are test functions that can be called from the unit tests of any BioC
## package.

validate_bioc_views <- function(pkg)
{
    bvStr <- packageDescription(pkg)$biocViews
    checkTrue(!is.null(bvStr), paste("No biocViews defined for package", pkg))
    bvStr <- gsub(" ", "", bvStr)
    views <- strsplit(bvStr, ",")[[1]]
    biocViewsVocab <- NULL
    data("biocViewsVocab", envir=environment())
    nodes <- nodes(biocViewsVocab)
    for (view in views)
    {
        checkTrue(view %in% nodes, 
            paste("Invalid view", view, "in package", pkg))
    }
    invisible(NULL)
}

Try the biocViews package in your browser

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

biocViews documentation built on Nov. 19, 2020, 2:01 a.m.