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 Sept. 18, 2023, 8:14 p.m.