R/xrefExists.R

Defines functions xrefExists

Documented in xrefExists

xrefExists <- function(mapper, source, identifier, compactIdentifier = NA) {
    if (!is.na(compactIdentifier)) {
        source <- gsub(":.*", "", compactIdentifier)
        identifier <- gsub(".*:", "", compactIdentifier)
        datasource <- getDataSource(prefix = source)
    } else {
        datasource <- getDataSource(code = source)
    }
    xref <- .jnew("org/bridgedb/Xref", identifier, datasource)
    mapper$xrefExists(xref)
}
egonw/BridgeDbR documentation built on Nov. 8, 2024, 4:21 a.m.