This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Mapping unique GO term description given a specific GO id

I have a list of GO ids and I want to find unique term description such that if I provide say 200 GO IDs I will get 200 specific GO terms. The code snippet I am using is given below. Although it kind of works ,but for one GO ids I get several terms like for my 200 GO ids I get 2577 GO terms where as I am interested in a specific unique GO term. The output that I want is like this GO:0007254 = JNK cascade

library(biomaRT)
mart <- useMart(biomart = "ENSEMBL_MART_ENSEMBL", dataset = "drerio_gene_ensembl", host = "asia.ensembl.org")

v1 <-c(target)   # The list of GO ids that I want to pass as a list.
go_list <- getBM(attributes=c("go_id", "name_1006", "namespace_1003"),
              filters = "go",
              values = c(v1),
              mart=mart, uniqueRows = TRUE)
genomics

Are you actually passing in c("v1") in your real code or are you using just v1? The former is wrong.

I have used whole data with c(v1) removing the quotes and I get 2557 GO ids given 234 GO terms, without finding out unique GO terms.

1 answer

You correct that the biomaRt call pulls more than just your "filtering" subset.

A simple solution is to do the following:

go_list <- subset(go_list,go_id %in% v1)

Such command is not returning any result.

That suggest that none of the values in v1 are present in the drerio annotation... or your object is formatted incorrectly.

library(biomaRt)
mart <- biomaRt:::useMart(biomart = "ENSEMBL_MART_ENSEMBL", dataset = "drerio_gene_ensembl", host = "asia.ensembl.org")  

v1 <- c(list("GO:0000003","GO:0016020","GO:0016491","GO:0006122","GO:0008121"))
go_list <- biomaRt:::getBM(attributes=c("go_id", "name_1006", "namespace_1003"),
          filters = "go",
          values = v1,
          mart=mart)
go_list <- subset(go_list,go_id %in% v1)
go_list

        go_id                                                   name_1006
10 GO:0000003                                                reproduction
11 GO:0016020                                                    membrane
13 GO:0016491                                     oxidoreductase activity
25 GO:0006122 mitochondrial electron transport, ubiquinol to cytochrome c
31 GO:0008121                   ubiquinol-cytochrome-c reductase activity
       namespace_1003
10 biological_process
11 cellular_component
13 molecular_function
25 biological_process
31 molecular_function

Log in to answer this question.