R/gene2GO.R

Defines functions gene2GO

gene2GO <- function(gene, godata, dropCodes) {
    goAnno <- godata@geneAnno
    if (! "EVIDENCE" %in% colnames(goAnno)) {
        warning("Evidence codes not found, 'drop' parameter will be ignored...")
    } else {
        goAnno <- goAnno[!goAnno$EVIDENCE %in% dropCodes,]
    }
    go <- as.character(unique(goAnno[goAnno[,1] == gene, "GO"]))
    go[!is.na(go)]
}
YuLab-SMU/GOSemSim documentation built on April 23, 2024, 11:35 a.m.