#Script to download and make named lists of GO annotations for use in Metaneighbor Grabbed .gaf file from http://geneontology.org/gene-associations/goa_human.gaf.gz http://geneontology.org/gene-associations/goa_human_rna.gaf.gz Named character vector of all go terms, mapping to GO ids ```{r} #To convert GO ids to their related terms library(GO.db) goterms = Term(GOTERM) write.table(goterms, sep = "\t", file = '/home/werner/tools/metaneighbor_go_annot/goterms.txt' ) ``` ```{r} #41 lines of header for the full protien annotations go_metadata = read.table(file = '/home/werner/tools/metaneighbor_go_annot/goa_human.gaf', skip = 41, sep="\t", fill = T, quote = "") dim(go_metadata) ``` ```{r} head(go_metadata) ``` Get all the unique GO IDs make a named list, ```{r} go_id = unique(as.character(go_metadata$V5)) length(go_id) go_human_annots = vector(mode = 'list', length = length(go_id) ) names(go_human_annots) = go_id for(i in 1:length(go_id)){ gene_names = c(unique(as.character(go_metadata$V3[as.character(go_metadata$V5) == go_id[i]]))) go_human_annots[[i]] = gene_names } ``` ```{r} save(go_human_annots, file = '/home/werner/tools/metaneighbor_go_annot/GO_human_annot') ```