R/get_names.R

Defines functions get_names

Documented in get_names

## return the names of GOs, toghether with root node in a dataframe

get_names=function(go_ids, term_df=NULL, godir=NULL){
    
    # check if term is user-defined or get the integrated version
    term = eval_term(term_df, godir)
    
    # remove obsolete terms
    term = term[term[,5]==0,]
    # find names for GOs
    out = data.frame(go_ids, term[match(go_ids, term[,4]) ,2:3])
    colnames(out) = c("go_id", "go_name", "root_node")
    rownames(out) = 1:nrow(out)
    out[,1] = as.character(out[,1]) 
    return(out)
}

Try the GOfuncR package in your browser

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

GOfuncR documentation built on Nov. 8, 2020, 8:27 p.m.